Repository navigation
feat(reports): add owner-only daily sales Excel/CSV export - #809
Conversation
Add GET /api/reports/daily-sales/export for one tenant business day: xlsx (Summary+Items workbook) and a two-file CSV pair. Accounting lives in buildDailySalesExportDataset; serializers only encode; shared toCsvRow provides CWE-1236 formula neutralization for CSV. Dashboard gains day-mode export buttons; contract documented in docs/daily-sales-export.md and API.md.
|
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: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (19)
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 |
- Type export handler catch as unknown and bills query as PaidBillTaxRow[] - Drop misleading payment_*_count Summary metrics - Emit stable snake_case payment keys via dailySalesPaymentMetricKey - Add export-level accounting edge-case tests (splits, refunds, voids, discounts, charges, custom methods, cutoff, timezone)
|
SummaryCoverage spans daily sales and refund calculations, timezone and business-day boundaries, split and refunded items, export formatting, privacy, authorization, data integrity, localization, and recovery from setup or download errors. It includes normal workflows, boundary conditions, adversarial spreadsheet-input cases, access-control checks, and user-facing export behavior, with no application defects identified. Safe to merge — the run found no PR-attributable regressions or unresolved failures across the exercised export, calculation, security, privacy, and localization behaviors. Environment setup issues prevented a few live flows from reaching their intended scenario, but those were unrelated test-environment findings rather than merge blockers. Tests run by Ito
Tip Reply with @itoqa to send us feedback on this test run. |
|
Diff SummaryCoverage spans backup uploads, cancellation, scheduled operation, retention-error handling, recovery, and rapid retry behavior, including normal flows and adversarial state-transition edge cases. The broader backup and retention separation logic is generally healthy, but one recovery path leaves inconsistent status information after a successful backup. Merge with caution — an attributable medium-severity failure leaves completed backups showing stale error and retry state, which can mislead users and trigger unnecessary recovery actions. A separate medium finding is not attributable to this PR and is a flag for later rather than a merge blocker. Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. 🟡 Retry creates a second backup result
Evidence PackageTip Reply with @itoqa to send us feedback on this test run. |


Related work
None (approved feature task from session: export daily sales as Excel/CSV).
Summary
Adds an owner-only daily sales export for one business day:
GET /api/reports/daily-sales/export?date=YYYY-MM-DD&format=xlsx|csv[&part=summary|items]Summary+Itemssheets (numeric money cells, no formulas).summary/items), formula-neutralized via sharedtoCsvRow(main/lib/csv.ts), ASCII.decimals.buildDailySalesExportDataset; serializers only encode; frontend only blob-downloads (two day-mode buttons on the dashboard).bills.paid_at, refunds onrefunds.created_at,net_collected = gross - refunds,Σ payment totals = net_collected,Σ net_item_sales = bills.subtotal.[email protected].docs/daily-sales-export.md+ API.md §Reports.Scope
Out of scope: multi-day ranges, tips, PII, staff/Transactions/Addons sheets, alternate refund-day attribution,
net_ex_tax.Verification
Commands run:
npm run test:daily-sales-export→ 34/34 passednpm run test:script-coverage→ OK (172 reachable)npm run i18n:check→ OKnpm run lint→ 0 errors (5 pre-existing warnings)npx tsc --noEmit -p tsconfig.json→ OKnpm run build→ OKnpm run build:frontend→ OKgit diff --check→ cleanResults: all green.
Compatibility & data safety
Screenshots
N/A (backend + download buttons; no new visual surfaces beyond existing day-mode buttons).
Cross-cutting surfaces
Contributor checklist