You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
design: define order void and archive semantics #703
area:backendBackend (Express/SQLite)priority:highHigh priority against the backlogstate:needs-designNeeds a design/scope decision before work startstype:designArchitecture/design decision needed before implementation
Inventory & recipe waste invariant (docs/reference/product-invariants.md:402-406): cancelling pending lines restores product stock & recipe_snapshot supplies; voiding started (preparing/ready/served/completed) lines treats depletion as physical waste and does not restore stock.
Post-payment reversals: main/services/refund.ts & main/routes/refunds.ts (Staff Approval PIN tiers, refund_issued written to order_audit_log via main/db.ts:11688).
Distinct from #1450 (pre-go-live full transactional test-data purge with backup).
Directly informs #287 (append-only audit event taxonomy) and Phase 4 tombstones in the upcoming Open Integration Platform RFC.
Design decisions to lock: (1) exact allowed state transitions for whole-order void (unpaid vs partially_paid vs paid), (2) required permission + Staff Approval PIN threshold for order void/archive, (3) archived_at soft-archive visibility in Orders, Search FTS (orders_search_fts), and Z-reports/Daily Sales exports.
area:backendBackend (Express/SQLite)priority:highHigh priority against the backlogstate:needs-designNeeds a design/scope decision before work startstype:designArchitecture/design decision needed before implementation
Activity
khaira777 commentedon Nov 28, 2026
Codebase anchor & alignment update (
origin/main@3cef9027):Current implementation anchors:
main/routes/order-items.ts:259-362,449-489(voided,void_adjustment,cancelled,voided_atKDS visibility) andmain/routes/orders.ts(order cancel, item edit).docs/reference/product-invariants.md:402-406): cancellingpendinglines restores product stock &recipe_snapshotsupplies; voiding started (preparing/ready/served/completed) lines treats depletion as physical waste and does not restore stock.main/services/refund.ts&main/routes/refunds.ts(Staff Approval PIN tiers,refund_issuedwritten toorder_audit_logviamain/db.ts:11688).main/routes/reports.ts:847excludes('cancelled', 'voided', 'void_adjustment', 'refunded').Cross-issue alignment:
#1450(pre-go-live full transactional test-data purge with backup).#287(append-only audit event taxonomy) and Phase 4 tombstones in the upcoming Open Integration Platform RFC.unpaidvspartially_paidvspaid), (2) required permission + Staff Approval PIN threshold for order void/archive, (3)archived_atsoft-archive visibility in Orders, Search FTS (orders_search_fts), and Z-reports/Daily Sales exports.