Repository navigation
feat(reports): dispatch cash close via whatsapp - #940
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (3)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 selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughAdds WhatsApp sharing for X- and Z-cash-close reports. The change adds report formatting and delivery, recipient validation, Z-report message support, dashboard controls, localized text, and tests. ChangesCash-close WhatsApp sharing
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~30 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CashCloseModal
participant SendWhatsAppReportModal
participant useCashClose
participant shareCashCloseViaWhatsApp
participant ReportsRoute
participant WhatsAppService
CashCloseModal->>SendWhatsAppReportModal: Open recipient dialog
SendWhatsAppReportModal->>useCashClose: Submit validated phone number
useCashClose->>shareCashCloseViaWhatsApp: Send Z-report payload
shareCashCloseViaWhatsApp->>ReportsRoute: POST report body and phone
ReportsRoute->>WhatsAppService: Send z_report message
WhatsAppService-->>ReportsRoute: Return send result
Merge Risk: ⚪ Minimal · up to The change adds WhatsApp sharing of cash-close reports and restricts Z-report history to users with report-view permission. No merge-blocking risk was found in the reviewed context. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Report dispatch requires both report-view and WhatsApp permissions, and report history is filtered on the server. No unauthorized report-disclosure path was established. External sharing adds a bounded disclosure surface, while report provenance and recovery after interrupted delivery remain limited or unverified. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description includes a useful summary, related issue context, and detailed verification results. It omits the required Scope, Compatibility & data safety, Screenshots, Cross-cutting surfaces, Developer documentation, and Contributor checklist sections. Resolution Add the missing template sections. Document out-of-scope items, database migration and user-visible impacts, network behavior, applicable cross-cutting surfaces and permission effects, documentation status, screenshots or an explicit not-applicable statement, and the contributor checklist selections. Full details: Docstring CoverageExplanation Docstring coverage is 27.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 12 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
Cash-close WhatsApp report sharing includes the localized Opening Float in X and Z. X Expected Cash adds the separately reported float to the API movement expectation, matching the cash-close UI; Z Expected Cash remains unchanged because its snapshot already includes float. Over-limit reports use the manual WhatsApp share path with the full message. The PR head is synced with merged #939 via normal merge commit Commit Local checks passed on All CI checks are green on exact head |
|
@greptile review |
|
|
@greptile review |
|
@greptile review |
|
@coderabbitai review |
|
@greptile review |
✅ Action performedReview finished.
|
|
@greptile review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
reports.viewandwhatsapp.use, and add thez_reportmessage kind with a data-preserving migration.Related to #830 (WhatsApp report sharing only; the epic remains open).
Verification
npm run i18n:check— passednpm run lint— passed with existing warnings and no errorsnpm run build— passednpm run build:frontend— passednpm run test:cash-closures— passed (320/320 plus WhatsApp tests)npm run test:whatsapp-schema— passednpm run test:upgrade-path— passednpm run test:script-coverage— passedSummary by CodeRabbit
New Features
Bug Fixes