← All tests

Cafe follow-ups bundle LOCAL

Two operator-feedback follow-ups bundled into one Gate cycle. (A) Skip-preview path on the success banner — post-sale Print now fires the print dialog directly without the preview modal. The /orders per-row Print still goes through the modal (operators may want to verify older orders before reprinting). (B) Daily report splitaggregateNativeDailyReport returns totalLineDiscount + totalOrderDiscount separately so operators can see how much was given as per-line comp/promo vs how much was knocked off the whole ticket.

11/11 + 10/10 = 21/21 local checks passed (this bundle + the receipt-preview test re-run after banner change).

All local checks (11)

A. Skip-preview on success banner
B. Daily report — split totalDiscount
Smoke regression

What's new — code surface

nix-cafe:
  app/(authed)/pos/starter-register-client.tsx              — banner skips modal: imports
                                                              KhmerReceipt + openPrintWindow,
                                                              hidden receipt mount, handlePrint
                                                              fires iframe print directly
  lib/db/orders.ts                                          — DailyReportPayload split,
                                                              aggregateNativeDailyReport returns
                                                              totalLineDiscount + totalOrderDiscount
                                                              + (combined) totalDiscount
  app/(authed)/reports/daily/starter-daily-client.tsx       — Avg Ticket card shows two lines

tests:
  test-cafe-followups-local.mjs                             — NEW (this bundle)
  test-receipt-preview-local.mjs                            — banner assertion flipped to
                                                              direct-print expectation

Gate 2 plan

1. Commit nix-cafe (single -m line) — only nix-cafe touched, no backend, no migrations.
2. Push → CF Pages auto-redeploys cafe Worker.
3. Update test-receipt-preview-prod.mjs to expect direct-print on banner (modal flow on /orders only).
4. Run new test-cafe-followups-prod.mjs against get-coffee:
   - Ring 1 product, pay → success banner shows Print
   - Click Print → openPrintWindow iframe spawned, NO preview modal opens
   - On /orders, click Print → preview modal still opens (regression)
   - Seed an order with both line + order discount, visit /reports/daily, assert
     metric-discount-line + metric-discount-order render with the right values
5. Regression sweep: receipt-preview + round 3 + round 2 + round 1 + R2.4b + 70.2 + phase1.
6. Publish prod gallery + ask for final approval.