Skip to content

URD: Orders

ModuleCORE-07Versionv0.3
StatusIn-progressDate2026-04-16

1. Purpose

Define user-facing requirements for order management — the sale order lifecycle from cart to checkout to payment, plus the F&B extensions a full-service venue needs: check splitting, kitchen tickets, POS shift sessions, table reservations, and loyalty point earning.

2. Scope

IncludedExcluded
Sale order lifecycle (DRAFT → PROCESSING → PARTIAL → COMPLETED / CANCELLED)Refund / return flow (Planned)
Order items (product, combo fan-out, custom)Stock mutation (Inventory)
Checkout and revertPayment provider integration (Payment)
Order split and mergeTax engine & e-invoice issuance
Check splitting (split the bill)Delivery order tracking (Planned)
Kitchen tickets and stations (F&B)Table-layout / seating management (Planned)
POS sessions (shifts) with X/Z reportsDedicated kitchen display application (Planned)
ReservationsOrder templates (Planned)
Loyalty point earningTechnical API specifications (see developer docs)
Real-time updates to kitchen & dashboards

3. Definitions

TermDefinition
Sale OrderA transaction containing items being sold; one entity serves as both cart (DRAFT) and committed order.
Order ItemA line item — a product variant (PRODUCT mode) or a manual entry (CUSTOM mode).
ComboA product that fans out into priced child lines when added to the cart.
Sale CheckAn independently-payable group within an order, used to split the bill.
Kitchen TicketA ticket sent to the kitchen for F&B preparation; contains items from a sale order.
Kitchen StationA named preparation area (e.g., grill, bar) that receives tickets.
POS SessionA cashier's shift on a specific device; tracks opening / closing cash and generates reports.
X ReportInterim shift summary — can be generated multiple times.
Z ReportFinal closing report — only one per session.
ReservationA guest booking for a future date / time with a party size.

4. Conceptual Model

Conceptual only — full schema lives in the developer domain model.

5. Functional Requirements

One table per functional area. <AREA> codes match the test-case IDs. Priority = MoSCoW (Must / Should / Could / Won't).

5.1 Sale Order (ORD)

IDPRequirement
URD-ORD-001MCreate draft orders (cart) with items
URD-ORD-002MAdd, update, remove items only while in DRAFT
URD-ORD-003MAdding the same product merges quantity onto the existing line
URD-ORD-004MSetting an item quantity to zero removes the line
URD-ORD-005MAdd a combo item that fans out into priced child lines
URD-ORD-006MCheckout: DRAFT → PROCESSING (validates items, locks prices)
URD-ORD-007MCheckout validates: non-empty cart, prices ≥ 0, quantity ≥ 1
URD-ORD-008MRevert: PROCESSING → DRAFT
URD-ORD-009MCancel from DRAFT, PROCESSING, or PARTIAL (with optional reason)
URD-ORD-010MPartial payment → PARTIAL status
URD-ORD-011MFull payment → COMPLETED status
URD-ORD-012SSplit one order into multiple (DRAFT only)
URD-ORD-013SMerge multiple orders (DRAFT only)
URD-ORD-014SAttach a customer to the order
URD-ORD-015SMulti-currency with exchange rate (default VND)
URD-ORD-016CEnforce a maximum number of items per order

5.2 Check Splitting (CHK)

IDPRequirement
URD-CHK-001SSplit an order into multiple payment checks
URD-CHK-002SAllocate specific items and quantities to each check
URD-CHK-003SDifferent customer per check
URD-CHK-004SOrder completes when all its checks complete
URD-CHK-005CRoll back a split while no check is paid

5.3 Kitchen Tickets (KIT)

IDPRequirement
URD-KIT-001MSend order items to kitchen (creates ticket + items)
URD-KIT-002MIdempotent send — a duplicate send produces the same ticket
URD-KIT-003MTicket lifecycle: PENDING → PROCESSING → READY → COMPLETED / VOIDED
URD-KIT-004MItem lifecycle: PENDING → COOKING → READY → SERVED / VOIDED
URD-KIT-005MTicket status auto-progresses from its item statuses
URD-KIT-006MChanges use void-and-resend (sent items are not edited in place)
URD-KIT-007SRush flag and per-order sequence for ticket ordering
URD-KIT-008MReal-time updates to kitchen displays and dashboards
URD-KIT-009SMarking an item served triggers stock consumption

5.4 Kitchen Stations (STA)

IDPRequirement
URD-STA-001SCreate named stations per merchant (i18n)
URD-STA-002SRoute product categories to stations
URD-STA-003SPer-station printer config with auto-print

5.5 POS Sessions (POS)

IDPRequirement
URD-POS-001MOpen a session on a device with an opening cash float
URD-POS-002MOnly one open session per device
URD-POS-003MClose a session: count cash, record discrepancy
URD-POS-004MZ report (closing) — one per session
URD-POS-005SX report (interim) — repeatable
URD-POS-006SOrders created during a shift attach to the session
URD-POS-007STrack expected vs. actual for non-cash methods
URD-POS-008CRecount support on close

5.6 Reservations (RSV)

IDPRequirement
URD-RSV-001SCreate a reservation: guest name, phone, party size, date / time
URD-RSV-002SLifecycle: PENDING → CONFIRMED → CHECKED_IN / CANCELLED
URD-RSV-003SSource tracking: phone, walk-in, online, other
URD-RSV-004SOccasion tagging: birthday, anniversary, business, etc.
URD-RSV-005SOn check-in, spawn and link a sale order

5.7 Loyalty Points (PNT)

IDPRequirement
URD-PNT-001SEarn points on completed orders
URD-PNT-002SPoint award is idempotent per order
URD-PNT-003SPoint balance tracked per customer per merchant

6. Acceptance Criteria

AC-ORD-01: Order lifecycle
GivenWhenThen
DRAFT orderCheckoutPROCESSING (prices locked)
PROCESSINGFull paymentCOMPLETED
PROCESSINGPartial paymentPARTIAL
Any non-terminal statusCancelCANCELLED
Empty cartCheckoutRejected
AC-ORD-02: Combo fan-out
GivenWhenThen
A combo productAdd to cartOne lead line + zero-priced child lines created
The same combo already in orderAdd againRejected (already in order)
AC-KIT-01: Kitchen
GivenWhenThen
Order itemsSend to kitchenTicket created
Same idempotency keyDuplicate sendNo duplicate ticket
All items READY/SERVEDTicket auto-progresses
Item marked servedStock consumption triggered
AC-POS-01: Session
GivenWhenThen
No open session on deviceOpenSession created
Existing open session on deviceOpenRejected
Open sessionClose with cash countDiscrepancy computed, Z report generated
AC-RSV-01: Reservation
GivenWhenThen
Guest infoCreateStatus PENDING, table held
Confirmed reservationCheck inStatus CHECKED_IN, sale order spawned & linked

7. Constraints & Non-Goals

Constraints

IDConstraint
C-01Items are modifiable only while the order is in DRAFT
C-02Order split / merge only in DRAFT
C-03At most one open POS session per device
C-04Exactly one Z report per session
C-05Kitchen ticket send is idempotent via key
C-06All records use soft-delete
C-07All operations require authentication and are scoped to the merchant

Non-Goals

  • Refund / return flow
  • Delivery order tracking
  • Table-layout / seating management
  • Dedicated kitchen display application
  • Order templates

8. Version History

DateAuthorDescriptionVer
2026-02-26P. Do — Product OwnerInitial user storiesv0.1
2026-04-16P. Do — Product OwnerRestructured to functional-area requirement tables; added combo, check-splitting, station, reservation, points areasv0.3

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