The request
Test four-currency invoice CLI output with full JSON proofs
Read the full request
Finish the seeded invoice CLI's missing proof while preserving its correct implementation, unchanged ten acceptance criteria and ALL existing assertions. The previous review accepted the added USD tax tests and ID sorting proof but refused c2 because JPY/KWD tests asserted totals only. Do not change invoice-reconcile.js; extend the existing real-subprocess tests and accurate documentation in one coherent phase. Add one four-currency input with no credits/payments and compare the ENTIRE parsed output to literal expected JSON, not to values calculated by the implementation. Invoices are deliberately supplied in unsorted order K,J,U,E and must come out E,J,K,U. Each has one line: E EUR quantity3 unitPrice"1.005" taxBps2000; J JPY quantity3 unitPrice"10.5" taxBps1000; K KWD quantity3 unitPrice"1.2345" taxBps500; U USD quantity1 unitPrice"10.01" taxBps825. Exact invoice fields in output: E: currency EUR, subtotal3.02 tax0.60 total3.62 credited0.00 paid0.00 balance3.62 status open. J: currency JPY, subtotal32 tax3 total35 credited0 paid0 balance35 status open. K: currency KWD, subtotal3.704 tax0.185 total3.889 credited0.000 paid0.000 balance3.889 status open. U: currency USD, subtotal10.01 tax0.83 total10.84 credited0.00 paid0.00 balance10.84 status open. All monetary values are strings with exactly the displayed precision. payments is empty; duplicates is exactly {invoices:0,credits:0,payments:0}. Run the identical input twice and compare actual output bytes and unchanged input bytes. Also add explicit per-line rounding proof: EUR invoice L has THREE separate lines quantity1 unitPrice"0.005", taxBps0: subtotal0.03 tax0.00 total0.03 balance0.03, credited0.00 paid0.00, open. Retain the USD nonzero-tax cases including the HALF UP tie, large exact arithmetic, partial status, two allocations within a payment, duplicate counts after settlement, primitive-string currency checks and refusal byte preservation, schema boundary tests, code-unit ordering and all file-identity protections. Add independent invoice totals for JPY and KWD HALF UP tax ties if not already asserted: JPY subtotal5 taxBps1000 yields tax1 total6; KWD subtotal0.005 taxBps1000 yields tax0.001 total0.006. Assert full corresponding invoice fields including credited/paid zeros and balance. Execute the full npm test suite and help command, preserve failure/recovery evidence, update README with observed results, and deliver the complete existing artifact. Do not claim an assertion is covered solely because a suite prints passed. Do not remove or simplify another regression to make this change pass.
The journey
- Read the requestTurned it into a list of things it would have to prove before calling the work done.
- Did the workPlanned the pieces, built them and checked the result as it went.
- Sent back by the final reviewThe last check did not accept the first result, and said what was missing.
- CorrectedThe missing parts were fixed and the work was checked again.
- Delivered4 files handed over.
The result
- invoice-reconcile.js5.3 KB
- package.json178 B
- README.md3.5 KB
- test/invoice-reconcile.test.js13.2 KB