feat(parser): warn when receipt totals do not reconcile #108
No reviewers
Labels
No labels
area:backend
area:frontend
area:infra
area:ocr
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
phase:M1
phase:M2
phase:M3
phase:M4
phase:M5
phase:M6
phase:M7
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
TJC/bill-splitter!108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/95-reconcile-warning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ReconciliationValidator(Parsing/Validation):sum(items) + tax + tip + servicevs the printed grand total, warning on a gap over a 2 minor-unit toleranceReceiptParseEngine.ParseTraced; cross-line, so it appends a warning but adds no trace entryreconciling-simple(balances, no warning) andmismatch-missing-item(dropped item line fires the warning)defune-at-quantity: printed subtotal 151.20 + service 22.68 = 173.88 total, but parsed items sum to 149.80 - a genuine ~GBP1.40 receipt/OCR discrepancyding-dong-amount: "Whole @$28.00" parses as a phantom item, inflating items by 28.00 over the receipt's own 164.00 + service 16.40 = 180.40westminster-column-drift: the "6.50" price whose name drifted onto a separate line is parked, losing GBP6.50 from the item sumTest plan
dotnet test backend/tests/BillSplitter.Tests/BillSplitter.Tests.csproj --nologo- 93 passedCloses #95
Closing: the reconcile signal this adds already exists.
SplitCalculatorcomputes the items-vs-total checksum (bill.checksumMinor), andChecksumBannersurfaces it on the review screen - formatted and live as the host edits ("Items + extras are X over/under the printed total").ReconciliationValidatorwas a third copy of that arithmetic, and routing it throughocr.warningsmisframed it inParserWarningsas a skipped line with raw minor units. After merging main and dropping the warning, this branch nets to zero diff vs main, so there is nothing left to merge.Pull request closed