Skip to content

Prepare durable discount decisions with exact sale receipts - #1011

Closed
sridharkalaibala wants to merge 4 commits into
codex/business-pushfrom
codex/business-decisions
Closed

sridharkalaibala wants to merge 4 commits into
codex/business-pushfrom
codex/business-decisions

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

Remote discount decisions need to identify the exact bill and distinguish owner approval from application at checkout. Add a durable decision ledger with scoped revision checks, expiry, cancellation, one execution claim and an atomic audit timeline. This is an internal foundation: no phone or till route enables remote approval yet.

The bounded pricing preview reuses checkout tax/header calculations without numbering, stock, payment, register-lock or kitchen writes. A pre-commit gate receives the actual write pricing and can persist an immutable decision receipt with the sale. Acknowledgement verifies that receipt against the source, operation, approver, revision, execution and exact amounts. Uncertain retries reconcile the existing execution instead of running a second sale.

The first intent contract supports a new paid sale with a bill-level discount and two-decimal currency; unsupported combinations fail explicitly. Existing local manager approval is unchanged. Desktop/Gateway authentication, recent step-up, routes, mobile UI and automatic recovery remain integration gates in docs/BUSINESS_DECISIONS.md.

Validation: 602 related unit tests and eight real-Mongo integration tests pass. Coverage includes concurrent approvers, idempotent retries, expiry, self/scope denial, edited bills, stock rollback, actual Mongoose pricing/receipt persistence, nested receipt immutability, mismatched receipts and lost-response reconciliation. Formatting, attribution and collection classification pass; lint has no errors and existing warnings remain. No new CI jobs were added. Stacked on #1010.

@sridharkalaibala

Copy link
Copy Markdown
Contributor Author

The complete Business companion stack, including this change, is integrated into develop through #1023. All checks, including CodeQL, passed before merge. Closing this superseded stacked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant