Repository navigation
fix: batch of 5 low-hanging bug fixes - #723
Conversation
…tion calculateCashback() only excluded 'cancelled' order items, so voiding an item after checkout still credited loyalty points on it. Match the exclusion set used elsewhere for order totals (cancelled, voided, void_adjustment, refunded). Fixes #720 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Both discount routes were gated to owner/manager roles only, so a cashier got a flat 403 before ever reaching the discount_requires_approval PIN-escalation logic that already exists for exactly this case. Widen the role gate to owner/manager/cashier; the existing approval check still requires a valid manager PIN for any discount when the setting is on. Fixes #716 Co-Authored-By: Claude Sonnet 5 <[email protected]>
The "Send Pulse to Cash Drawer" method checklist was a hardcoded [cash, card, upi] array, so UPI always appeared even when unconfigured and any custom payment method (e.g. a "coupon" method) never appeared. Fetch the tenant's active payment methods and list cash/card plus whatever custom methods actually exist. Fixes #714 Co-Authored-By: Claude Sonnet 5 <[email protected]>
getWhatsAppMessage() needs bill.order (date, items) to build a complete receipt, but every caller passed a bare bills-table row with no order relation, so the sent message silently dropped the date and item list. POST /bills/generate now embeds order+items like the other bill routes already do, and the two frontend call sites that reused an already-fetched order's bill now attach that order to it. Fixes #711 Co-Authored-By: Claude Sonnet 5 <[email protected]>
The Orders page's "Add Item" flow added products straight to the cart without ever checking for add-on groups, so add-on items couldn't be configured on an existing order (they could already be configured from the POS page's own add-item flow, which already used AddonModal). Wire AddonModal into the same flow and carry selected add-ons through to POST /orders/:id/items, which already accepts them. Also fixes the picker row's illegible hover state in dark mode, reported in the same issue. Fixes #721 Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
Warning Review limit reachedNext included review available in 6 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR applies five focused POS fixes:
Confidence Score: 5/5The PR appears safe to merge; the only previous finding was resolved, and the follow-up error handling introduces no new actionable issue. The payment-method request now distinguishes expected cancellation from genuine failures and displays an existing localized error message for the latter. The previous thread was manually resolved after this correction, and no blocking failure remains.
|
| Filename | Overview |
|---|---|
| frontend/src/app/(dashboard)/orders/page.tsx | Adds distinct add-on-bearing item selections, sends add-ons through order amendments, enriches WhatsApp bills with order data, and fixes dark-mode hover contrast. |
| frontend/src/app/(dashboard)/settings/page.tsx | Loads active custom payment methods for cash-drawer pulse configuration and surfaces non-cancellation failures. |
| frontend/src/components/pos/TableCheckoutModal.tsx | Ensures existing bills retain their order relation when entering payment or split-check flows. |
| main/routes/bills.ts | Returns generated bills with order items and excludes non-eligible item statuses from cashback calculations. |
| main/routes/orders.ts | Allows cashiers to enter the existing manager-approved order and item discount workflows. |
Reviews (2): Last reviewed commit: "fix(settings): surface pulse payment-met..." | Re-trigger Greptile
Address Greptile review feedback on PR #723: the fetch backing the cash-drawer pulse checklist swallowed all errors, so a genuine failure (not just the effect's own cleanup abort) silently left the checklist showing only cash/card with no indication anything was wrong. Now distinguishes cancellation from real failures and toasts on the latter, matching this file's existing isRequestCancelled() convention. Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
SummaryCoverage spans core ordering and checkout flows, including product and add-on selection, duplicate-line handling, bills, split checks, payments, discounts, loyalty credits, and receipt sharing. It also exercises edge and failure paths such as invalid selections, authorization limits, retries after temporary errors, voided items, stale data, inactive payment methods, and dark-theme readability. Safe to merge — the run found no regressions, new failures, or previously reported failures attributable to this PR, and all exercised behaviors passed across business logic, error handling, and user interface flows. Tests run by Ito
Tip Reply with @itoqa to send us feedback on this test run. |

Summary
Five independent low-hanging-fruit bug fixes, picked from the open
type:Bugissues:calculateCashback()only excludedcancelledorder items from the cashback base, so voiding an item after checkout still credited loyalty points on it. Now excludes the same status set (cancelled,voided,void_adjustment,refunded) used elsewhere for order totals.[cash, card, upi]array. Now reflects the tenant's actual active payment methods.POST /bills/generatenow embeds order+items like the other bill routes, and two frontend call sites that reused an already-fetched order's bill now attach it.Each fix is its own commit for reviewability; see commit messages for per-fix detail.
Fixes #720, #716, #714, #711, #721
Test plan
npm run lint— 0 errors (pre-existing warnings only)npm run build(backend) — cleannpm run build:frontend— clean🤖 Generated with Claude Code