## feat: Per-item loyalty cashback, unified checkout UI, settings cleanup - #9
Merged
Merged
Conversation
…in list, remove configurable points fields
khaira777
added a commit
that referenced
this pull request
Jul 5, 2026
…ts/discounts/tax/loyalty) Integration tests (7 files, 123 assertions): - Happy path: order→discount→bill→payment→completed - Tax correctness: India GST calculation and recalculation - Payment integrity: split payments, wallet double-spend, zero-amount rejection - Order lifecycle: status transitions, cancel with PIN - Bill reconciliation: discount sync, add-items sync - Loyalty points: cashback, idempotency, wallet balance - Discount edge cases: combined discounts, max limits, addon prices Bug fixes: - #3: Add-items filters cancelled items from total recalculation - #4: Add-items syncs bill after updating order total - #5: Cancel/restore round-off formula corrected - #6: Discount endpoint wrapped in withTxn (race condition) - #7: Infinity passes validation (NaN/isFinite check) - #8: Missing amount defaults to remaining balance - #9: Amount capped at remaining balance - #11: Removing discount restores original tax - #12: Add-items preserves order-level discount - #13: Cancel/restore preserves order-level discount - #14: Item-level discount checks max settings - #15: Item-level discount syncs to bill - #17: Cancel/restore wrapped in withTxn - #20: Cashback calculated on discounted subtotal - #23: Quantity/price validation on order creation Shared test helper (tests/helpers/test-setup.ts): - Extracts 40 lines of boilerplate per test file - Provides: initTestDb, createApp, startServer, seed helpers, assert utilities Co-Authored-By: Claude <noreply@anthropic.com>
khaira777
pushed a commit
that referenced
this pull request
Jul 6, 2026
## feat: Per-item loyalty cashback, unified checkout UI, settings cleanup
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.
Changes
Loyalty System
cb_percentof each order item's subtotal to the customer's loyalty walletcb_percentfield)GET /customers/:id/loyalty-ledger— returns balance, next expiry, full transaction historyCheckout UI Consistency
Customers Page
Settings