Skip to content

PRD: Shift reports (X/Z)

ModuleReportsPRD IDPRD-SHF-001
StatusReady to devFEATSHF · BANA-1440
EpicPlaneBANA-1556
Date2026-04-22Versionv0.1
Packages@nx/saleURDSHF
SurfaceSale · POSClient · Owner/Mgr
OwnerPhát Nguyễn

TL;DR

Reconcile the cash drawer at the counter: an X report for a repeatable mid-shift snapshot, a Z report for the locked close-shift figures. Each pairs cash reconciliation (opening float, cash sales, pay-in/out, expected vs. actual, discrepancy) with a sales summary - so every shift closes on a number you can verify, not a guess.

1. Context & Problem

POS cashiers work in shifts: a shift opens, one or more cashiers work it, then it closes. Today a shift tracks cash movements but produces no report - so there is no way to read shift totals or reconcile the drawer at the counter. A cashier can't see expected vs. actual cash, can't pull an interim mid-shift summary, and has no locked snapshot to hand off at close. Handovers fall back on manual counting, and the owner gets no auditable record of what each shift took in - a blocker for the cash-honest operations BANA targets at HKD/SME scale.

This increment delivers the two reports a cashier expects against a shift - an interim X report and a closing Z report - backed by a locked closing snapshot, built on the existing shift lifecycle and cash-movement tracking.

2. Goals & Non-Goals

Goals

  • An X report (interim): a live in-shift snapshot taken from the current open shift, repeatable any number of times.
  • A Z report (closing): the final close-shift report, read once per shift and backed by a locked closing snapshot.
  • Cash reconciliation: opening float, cash sales, pay-in / pay-out, expected vs. actual counted cash, and discrepancy, with a counted-cash recount captured at close.
  • A sales summary on the report: gross, discount, tax, net, and order count.
  • Merchant + sale-channel scoping and shift listing with pagination.

Non-Goals

  • Daily / product / category sales reports - owned by the SLS feature (URD-SLS).
  • Profit & loss, inventory valuation, customer analytics, export, and scheduled reports - ADV, Planned (URD-ADV).
  • Payment-method and category breakdowns on the shift report (Should-level URD-SHF-005..006).
  • PIN step-up on report access.

3. Success Metrics

MetricTarget / signal
Reconciliation coverage100% of closed shifts produce exactly one Z report
Cash accuracyDiscrepancy = counted cash − (opening float + cash sales − pay-outs); surfaced on every close
Interim usabilityX report is repeatable mid-shift and leaves the shift unchanged
Scoping correctnessZero cross-merchant figures returned on any report

4. Personas & Use Cases

PersonaGoal in this feature
CashierPull an X report mid-shift; close the shift to produce the Z report with a counted-cash reconciliation
ManagerReview any shift's Z report for their merchant
OwnerSee shift reconciliation across their merchants

Core scenarios: open a shift → other cashiers may join while it runs → pull an X report mid-shift (repeatable) → at close, count actual cash → the system computes expected vs. actual and locks a Z report snapshot, one per shift.

5. User Stories

  • As a cashier, I want to pull an X report from my open shift, so I can check interim cash and sales totals without closing the shift.
  • As a cashier, I want the X report to be repeatable, so I can re-check totals as the shift progresses.
  • As a cashier, I want to close my shift with a counted-cash recount, so the Z report shows expected vs. actual and the discrepancy.
  • As a manager, I want exactly one locked Z report per shift, so closed-shift figures can't drift.
  • As an owner, I want shift reports scoped to my merchant, so no other merchant's figures leak in.

6. Functional Requirements

#RequirementURD ref
FR-1X report (interim): request a live snapshot of the current open shift; repeatable, leaves the shift unchangedURD-SHF-001
FR-2Z report (closing): the aggregated close-shift report, read once per shift, backed by a locked closing snapshotURD-SHF-002
FR-3Cash reconciliation: opening float, cash sales, pay-in / pay-out, expected vs. actual counted cash, discrepancy, plus a counted-cash recount captured at closeURD-SHF-003
FR-4Sales summary on the report: gross, discount, tax, net, order countURD-SHF-004
FR-5Reports scoped per merchant and sale channel; shift listing with pagination and filtersURD-SHF-001..002
FR-6Only authorized users (read permission on shift reports) can open the two reportsURD-SHF-001..002

Full requirement text and acceptance criteria live in the Reports URD. This PRD references them rather than restating them. Payment-method and category breakdowns (URD-SHF-005..006, Should) are out of this increment - SHF remains In-progress.

7. Non-Functional Requirements

AreaRequirement
Data integrityThe Z report is a one-per-shift terminal snapshot; once locked at close it does not change
Read-onlyReports aggregate over cash movements and completed orders; the X report never changes the shift
Tenancy & authzAll operations are confined to the user's own merchant and sale channel; the two reports are opened only by users with read permission on shift reports
PrecisionCash and monetary amounts are tracked to 4-decimal precision
Performance / scaleShift listing is paginated; report aggregation runs over a single shift's movements
i18nUser-facing labels/statuses are bilingual (English / Vietnamese)

8. UX & Flows

Key screens: the shift view, the X-report action, the close-shift recount, and the Z-report view.

9. Data & Domain

ConceptRole
The shiftA working session a cashier opens and closes, joinable by one or more cashiers while it runs - lifecycle (open/close), cash-movement tracking, counted-cash recount at close
The locked closing snapshotThe final close-shift (Z) figures captured at close - cash reconciliation + sales summary, one per shift
The cash movementsPay-in / pay-out and cash sales aggregated by the report to feed the reconciliation

Conceptual only - full detail and invariants in the shift domain model.

10. Dependencies & Assumptions

Depends on

  • Shift lifecycle & cash-movement tracking - the X/Z reports aggregate an open or just-closed shift.
  • Completed orders (Orders) - the sales summary aggregates completed orders in the shift.
  • Cash / payment movements - pay-in/out and cash sales feed the reconciliation.
  • Shift data store - holds the shift and its locked closing snapshot.

Assumptions

  • A cashier opens a shift with an opening float before transacting.
  • Each shift closes exactly once, producing exactly one Z report.

11. Risks & Open Questions

Risk / questionMitigation / status
Cash reconciliation diverging from the finance ledgerThe report aggregates cash movements directly and owns the shift's reconciled view, so the closing report - not the ledger - is the source of truth for the shift
Double Z report per shiftZ report is read once per shift against a locked snapshot; terminal by design
Payment-method / category breakdowns expected by some merchantsOut of this increment (URD-SHF-005..006); SHF stays In-progress until delivered
PIN step-up on report accessOut of scope here; tracked separately

12. Release Plan & Launch Criteria

AspectPlan
PhaseP2 - see URD feature catalog
RolloutAll merchants; no feature flag
MigrationNew capability with no merchant-facing data migration; the closing report owns the shift's reconciled view
Launch criteriaX report repeatable on an open shift; exactly one Z report per closed shift; cash reconciliation and sales summary verified against counted cash
MonitoringZ reports per closed shift (expect 1:1), reconciliation discrepancy distribution, report request error rate

13. FAQ

What is the difference between an X report and a Z report? The X report is an interim, repeatable mid-shift snapshot pulled while the shift is open; the Z report is the final close-shift report, produced once per shift and locked.

Does pulling an X report change anything? No - it is read-only and repeatable; it does not change the shift or any cash records.

Can a shift have more than one Z report? No - exactly one Z report is produced per shift at close, backed by a locked snapshot.

How does the report stay consistent with the ledger? The report aggregates cash movements directly and owns the shift's reconciled view, so the closing report is the source of truth for the shift's cash position.

Do shift reports include payment-method or category breakdowns? Not in this increment - those are Should-level (URD-SHF-005..006) and remain open.

References

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.