Orders Phase A In-progress
Orders is the transactional heart of the POS: a single order plays both the cart and the committed order role, moving from draft through checkout to payment. For F&B merchants it adds kitchen tickets, table reservations, bill splitting, and cashier shift sessions.
1. Identity
| Property | Value |
|---|---|
| Module ID | CORE-07 |
| Tier | Core |
| Status | In-progress |
| Phase | P1 (basic orders) · P2 (kitchen, sessions, reservations, splitting) |
| Priority | HIGH |
| Primary users | Cashier · Kitchen staff · Host · Manager · Owner |
2. Purpose & Scope
| Included | Excluded |
|---|---|
| Sale order lifecycle (DRAFT → PROCESSING → PARTIAL → COMPLETED / CANCELLED) | Stock mutation (owned by Inventory) |
| Order items — product (incl. combo fan-out) and custom lines | Payment provider integration (owned by Payment) |
| Checkout, revert, cancel, order merge / split | Tax calculation engine & e-invoice issuance (Tax & Invoice) |
| Bill splitting (sale checks) | Refund / return flow (Planned) |
| Kitchen tickets & stations (F&B, KDS) | Customer-facing menus |
| POS sessions / shifts with X/Z reports | Loyalty rewards engine (only point earning lives here) |
| Table reservations | Receipt printing (frontend concern) |
| Loyalty point earning on completed orders | |
| Real-time updates to kitchen & dashboards |
3. Capabilities
| Capability | What the user can do | Status |
|---|---|---|
| Draft orders (cart) | Create an order, add / update / remove items — editable only in DRAFT | Built |
| Combo items | Add a combo product; it fans out into priced child lines automatically | Built |
| Checkout | Lock prices and move DRAFT → PROCESSING ready for payment | Built |
| Revert to cart | Undo a checkout: PROCESSING → DRAFT | Built |
| Cancel order | Cancel from DRAFT, PROCESSING, or PARTIAL | Built |
| Partial & full payment | PARTIAL while underpaid, COMPLETED when fully paid | Built |
| Order split / merge | Split one draft into many, or merge several drafts (DRAFT only) | Built |
| Customer linking | Attach a customer to the order | Built |
| Multi-currency | Set currency + exchange rate per order (default VND) | Built |
| Check splitting | Divide a bill into independently-payable checks | Built |
| Kitchen tickets | Send items to the kitchen; track ticket & item status; live KDS updates | Built |
| Kitchen stations | Route categories to named stations with printer config | Built |
| POS sessions | Open / close a shift per device with cash reconciliation and X/Z reports | Built |
| Reservations | Book a table for a future time; check in to spawn an order | Built |
| Loyalty points | Earn points on completed orders | Built |
| Refund flow | Structured refund with stock return | Planned |
4. Module Dependencies
| Depends on | Why |
|---|---|
| Product | Order items reference product variants; combos expand via product bundles |
| Inventory | Stock is reserved on cart-add and consumed on payment / serve |
| Payment | Payment events drive PARTIAL / COMPLETED / CANCELLED transitions |
5. Backend Packages
Implementation detail lives in the developer docs — this section only maps the module to the services that power it.
| Package | Role | Developer docs |
|---|---|---|
@nx/sale | Owns the cart-and-order lifecycle, checkout, checks, kitchen, sessions, reservations, points | sale |
6. Key User Flows
Order lifecycle
Checkout
Kitchen ticket
POS session
7. Roles & Permissions
| Role | Can | Cannot |
|---|---|---|
| Cashier | Create / edit drafts, checkout, take payment, send to kitchen, open / close own session | Approve refunds (Planned) |
| Kitchen staff | View ticket queue, progress items cooking → ready → served, void | Take payment, edit prices |
| Host | Create and manage reservations, check in guests | Take payment |
| Manager / Owner | All cashier actions plus view X/Z reports and reconcile shifts | — |
8. Status & Roadmap
| Phase | Capabilities |
|---|---|
| P1 | Draft orders, item management, checkout / revert, cancel, partial & full payment |
| P2 | Combo fan-out, order split / merge, check splitting, kitchen tickets & stations, POS sessions, reservations, loyalty point earning, real-time updates |
| P3 | Refund / return flow, dedicated KDS app, table-layout management, delivery tracking, order templates |
9. Related Pages
- URD
- Test Cases
- PRDs
- Product · Inventory · Payment
- Developer docs: Sale Service