Repository navigation
feat(orders): show WhatsApp receipt status - #784
Conversation
… by missing Electron
…bility; Electron test unavailable
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe orders API now projects WhatsApp bill receipt status. The Orders page displays localized status badges for paid orders and refreshes after Flo sends a bill. API documentation and regression tests cover the new behavior. ChangesWhatsApp receipt status
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant OrdersPage
participant WhatsAppSend
participant WhatsAppMessages
participant OrdersAPI
OrdersPage->>WhatsAppSend: send bill with kind bill_receipt
WhatsAppSend->>WhatsAppMessages: record outbound receipt status
OrdersPage->>OrdersAPI: refresh orders
OrdersAPI-->>OrdersPage: return whatsapp_receipt_status
OrdersPage-->>OrdersPage: render localized receipt badge
Merge Risk: ⚪ Minimal · up to No concrete current-head risk remains; the claimed missing receipt badge cannot occur through the Orders API response path. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 5 files. (9 skipped: 9 unsupported.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
…command in package.json. npm run test:script-coverage, the focused theme test, and git diff --check pass; only package.json changed
|
SummaryCoverage spans receipt-status business rules for orders and split bills, including sent, failed, partial, pending, and no-recorded-send states, plus handling of unrelated messages and retry ordering. It also covers user-facing order badges, localization and accessibility labels, native and fallback sharing behavior, refresh stability, and concurrency-related safeguards. Safe to merge — the exercised application behaviors passed without any PR-attributable regressions or new failures. A few native-send and concurrency scenarios were blocked by missing test data, but they are environment limitations rather than merge blockers. Tests run by Ito
Tip Reply with @itoqa to send us feedback on this test run. |

Intent
Implement FloCafe issue #718 as a separate pull request. On the Orders page, show a compact receipt-status indicator derived from the existing bill-linked WhatsApp message ledger so staff can see whether a native receipt send is pending, successful, or failed without opening WhatsApp. Use sent, delivered, or read as positive; queued or typing as pending; failed as failed; and no matching row as no recorded send. Do not treat the wa.me fallback as sent because opening a prefilled URL does not prove that the employee pressed Send. Leave the fallback behavior unchanged. Do not touch Google Drive, local backups, migrations, or unrelated features. Use no-mistakes to open a PR and stop before merge for captain testing.
What Changed
whatsapp_receipt_statusto hydrated order responses, summarizing bill-linked outbound receipt ledger rows while excludingwa.mefallback shares.Risk Assessment
✅ Low: The reviewed change is bounded and its order-level receipt-status projection, split-bill aggregation, UI gating, and native-send classification align with the stated intent.
Testing
The built product displayed No recorded send, Sent, Failed, and Pending badges. Backend regression coverage passed all requested mappings, fallback exclusion, retries, split bills, and no-phone behavior.
Evidence: Orders status assertion
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 3 issues found → auto-fixed (2) ✅
main/routes/orders.ts:318- Split-check orders can show the wrong status: the API projects onlyorder.bill(first unpaid bill or first bill), and the UI renders the badge only when that bill is paid. A receipt sent for another paid split bill can therefore be reported as "No recorded send" or hidden. Choose and implement explicit multi-bill semantics (aggregate or per-bill indicator).AGENTS.md:90- The added instruction-maintenance section is unrelated to issue 718 and is not required for the receipt-status feature. Remove this unrequired change from the feature PR.CLAUDE.md:1- This PR unnecessarily convertsCLAUDE.mdfrom the repository's symlink toAGENTS.mdinto a regular file. Restore the symlink; the feature does not require changing repository instruction-file semantics.🔧 Fix applied.
2 warnings still open:
main/routes/orders.ts:341- A real native receipt send can be recorded asmanual_replywhen the paid bill has no customer ID, so this newkind = 'bill_receipt'query misses it and the UI remains "No recorded send". Preserve receipt classification at the shared send boundary.frontend/src/app/(dashboard)/orders/page.tsx:1106- The backend summarizes paid split bills, but the UI only renders the badge whenorder.billis paid. With one paid bill and one unpaid sibling,order.billis the unpaid bill, so the valid order-level summary is hidden. Gate the badge on any paid bill while keeping the send-button guard unchanged.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
npm run test:issue-718-whatsapp-order-statusnpm run buildnpm run build:frontendLive API setup and Playwright Orders-page drivegit diff --check✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Summary by CodeRabbit
New Features
Documentation
Bug Fixes