Repository navigation
CSV export shows raw cents instead of a formatted amount (#188) - #189
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 prints a formatted decimal amount (10.00) instead of raw integer cents (1000), by formatting it withformatCentsinexportCsv. The HTTP route and CLIexportpick up the fix throughexportCsv.Closes #188
Plan
Plan comment (rev 1), approved with
/factory approve:amountcells are45.00,12.00,30.00, verified bybun test tests/csv.test.ts10.05, verified bybun test tests/csv.test.tsbun test tests/csv.test.ts tests/routes.test.ts tests/cli.test.tsmake checkLeft out on purpose (non-goals):
src/money/**(including the separatesplitCentsremainder defect), CSV header, escaping and SQL,src/routes/**,src/cli.ts,public/index.html, and all protected paths.Gate evidence
FACTORY_GATES: status=GREEN passed=3 failed=0 skipped=1 failed_gates=auditThe
auditgate is optional and was skipped. It is not part ofmake check.Verify verdict
Verdict: pass in 1 round, with no reviewer findings. Evidence is in
.factory/runs/issue-188/verdict-comment.md.The tests bite. With
src/csv.tsreverted, both new tests fail on assertions: the amounts come out as"4500","1200","3000"and1005. With the change,bun test tests/csv.test.ts tests/routes.test.ts tests/cli.test.tsgives 16 pass, 0 fail.Pre-existing issues the reviewer noted, not caused by this diff and worth separate issues:
csvEscapedoesn't quote\ror neutralise spreadsheet formulas.splitCentsdrops the remainder.Risk and rollback
Low: it changes one non-protected module (
src/csv.ts) plus a new test file, with no schema or API-shape change. Only the text of the amount cell changes.formatCentsthrows on non-integer cents, so a bad value now fails loudly instead of being exported. To roll back, revert this PR; nothing else depends on it.Factory run
Proof: the new test fails without the change.
5 stage runs, 2m 47s, $1.09.
Went well
Needed help