Repository navigation
fix(printers): align receipt and KOT semantic parity - #620
Merged
Merged
Conversation
Contributor
Greptile SummaryThe PR aligns semantic content across backend, WebUSB, and browser receipt/KOT renderers.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| frontend/src/lib/printer/tax-components.ts | The updated merge preserves the bill-scoped order while filling missing table and customer relations from the relation-complete fallback order, resolving the prior finding. |
| frontend/src/lib/printer/print-document.ts | Receipt document construction now propagates hydrated redeemed-points and balance fields. |
| shared/print/document.ts | Shared KOT semantics now include pending-item filtering, customer metadata, and add-on quantities. |
| main/printers/document-kot.ts | Backend KOT rendering adopts the shared filtering and aligned metadata, quantity, and instruction conventions. |
| main/routes/bills.ts | Bill detail endpoints now hydrate earned, redeemed, and current loyalty point values. |
| tests/tax-components.test.ts | Focused coverage verifies that fallback relations are merged without replacing the child-scoped order payload. |
Reviews (4): Last reviewed commit: "fix: hydrate receipt relations from fall..." | Re-trigger Greptile
… updated the stale KOT assertion to the consistent `>>` marker. Passed printer, print-parity, print-document, tax-components, lint, backend build, frontend typecheck, and frontend production build checks. CodeQL’s workflow run was already successful
…int-parity.test.ts by canonicalizing ampersands to an internal marker. npm run test:print-parity passed: 492 assertions, 0 failures; git diff --check passed
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.
Intent
Implement Phase 5 of the FloCafe internationalization and printing remediation plan: align non-financial semantic content across intended-equivalent receipt and KOT paths.
Inspect the existing printing architecture and parity fixtures before editing. Render add-ons and special instructions in compact WebUSB receipts. Align served/ready item filtering across backend, WebUSB, and browser KOT paths. Preserve add-on quantities in KOT output. Align order numbers, special-instruction markers, table/customer fields, and loyalty display where the existing print contract intends equivalence.
Acceptance criteria:
Keep this as a semantic-parity-only change. Do not alter financial policy or amounts, locale bootstrap or translation quality, timezone behavior, country-pack templates, currency precision, printer capability architecture, raster output, broad routing, or unrelated UI. Start from the current FloCafe default branch after merged PR #619. Phase 5A country-pack charge-row parity remains separately deferred until its output-contract compatibility decision is settled. Use the full no-mistakes delivery path; after this phase lands, continue only with the next planned phase and preserve the one-worker-at-a-time sequence.
What Changed
Risk Assessment
✅ Low: The change is bounded to semantic print-content normalization and read-side hydration, with no additional source-verifiable defects found.
Testing
Installed locked dependencies temporarily, ran the focused print parity, KOT regression, document, bills API, and tax hydration tests successfully, and captured direct rendered output plus browser HTML evidence. Browser screenshot capture was unavailable because no browser connection was exposed. Linters and the full repository suite were not run per the targeted-test boundary.
Evidence: Direct print surfaces
Evidence: Browser KOT HTML
Evidence: Print parity results
Evidence: KOT regression results
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm run test:print-paritynpm exec -- ts-node --transpile-only -P tests/tsconfig.json tests/phase3-print-regressions.test.tsnpm run test:print-documentnpm run test:bills-print-apinpm run test:tax-componentsDirect production-renderer harness for compact WebUSB receipt, backend KOT, WebUSB KOT, and browser KOT HTMLBrowser availability check viaagent.browsers.list()✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.