Repository navigation
CSV export shows raw cents instead of a formatted amount (#146) - #151
Closed
Param-Harrison wants to merge 3 commits into
Closed
Param-Harrison wants to merge 3 commits into
Param-Harrison wants to merge 3 commits into
Conversation
Param-Harrison
marked this pull request as ready for review
October 8, 2026 21:24
Contributor
Author
|
/factory revise add a test for an amount under one dollar, like 5 cents |
Param-Harrison
marked this pull request as draft
October 8, 2026 21:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
exportCsvnow writes theamountcolumn withformatCents, so the CSV route and the CLIexportcommand show10.00instead of raw cents (1000). Onlysrc/csv.tschanged in production code.Closes #146
Plan
Plan comment (rev 1) on issue #146:
formatCents(amountCents)(1000 →10.00, 1005 →10.05). Checked bybun test tests/csv.test.ts.date,payer,description,amount, with one row per expense. Checked bybun test tests/csv.test.ts.GET /api/groups/flat-4b/export.csvreturns formatted amounts, e.g.45.00. Checked bybun test tests/routes.test.ts.make check.Left out on purpose (non-goals):
src/money/cents.tsis untouched. ThesplitCentsremainder defect is a separate issue.src/routes/export.ts,src/cli.ts, the schema and the SQL query are untouched.Gate evidence
FACTORY_GATES: status=GREEN passed=3 failed=0 skipped=1 failed_gates=auditVerify verdict
Verdict comment on issue #146: pass, all four ACs pass and the reviewer had no findings.
The test that bites:
exportCsv keeps non-zero cents (1005 -> 10.05)fails withsrc/csv.tsreverted (Expected: "10.05" Received: "1005"). Revertingsrc/csv.tsmakes all 4 new tests fail.Risk and rollback
Low: the change is confined to one non-protected module, with no schema or API-shape change. Only the format of the amount values changes. To roll back, revert this PR. Nothing is stored in a new format, because amounts stay integer cents in the database.
Factory run
5 stage runs, 4m 31s, $0.95.
Went well
Needed help