Repository navigation
CSV export shows raw cents instead of a formatted amount (#161) - #167
Closed
Param-Harrison wants to merge 2 commits into
Closed
Param-Harrison wants to merge 2 commits into
Param-Harrison wants to merge 2 commits into
Conversation
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
The CSV export's
amountcolumn now goes throughformatCents, so it reads45.00instead of raw cents (4500). The CLIexportcommand and the/export.csvroute shareexportCsv, so both get the fix.Closes #161
Plan
Plan comment (rev 1) on issue #161, risk low:
flat-4b(45.00,12.00,30.00). Verified bybun test tests/csv.test.ts(exportCsv formats the amount column as a decimal amount).1005exports as10.05). Verified bybun test tests/csv.test.ts(exportCsv keeps the cents of a non-round amount).exportprints formatted amounts. Verified bybun test tests/cli.test.ts(splitbill export prints formatted amounts).make check.Non-goals, all respected: no changes to
src/money/**, to the CSV columns, header, order or escaping, to routes, the CLI, the db or protected paths, and no schema change or float money math.Gate evidence
FACTORY_GATES: status=GREEN passed=3 failed=0 skipped=1 failed_gates=audit
Verify verdict
Verdict comment on issue #161: pass, AC-1 to AC-4 all pass, no reviewer findings. The test that bites: with
src/csv.tsreverted,exportCsv keeps the cents of a non-round amountfails (Expected: "10.05" Received: "1005"), and the other two new tests fail too. All three are assertion failures, not compile errors.Not in this PR:
csvEscapedoesn't quote\rand doesn't guard against spreadsheet formula injection. Both exist onmainalready and should be their own issue.Risk and rollback
Low: the only production change is in
src/csv.ts, and it reuses the existingformatCents. Only the text of the amount values changes, and no schema or protected path is involved. To roll back, revert this PR's commit. No data migration is needed because amounts are still stored as integer cents.Factory run
5 stage runs, 3m 35s, $0.95.
Went well
Needed help