Skip to content

Test Cases: Orders

ModuleCORE-07URDOrders URD

Cases are aligned to URD v0.3 functional areas and verified against the Sale Service developer docs. QE findings note behavior confirmed in the codebase that the URD does not spell out.

1. Coverage Summary

AreaURD reqsTest casesCovered
Sale Order (ORD)1618
Check Splitting (CHK)54
Kitchen Tickets (KIT)98
Kitchen Stations (STA)33
POS Sessions (POS)86
Reservations (RSV)54
Loyalty Points (PNT)33

2. Test Cases

TC-<AREA>-NNN lines up with URD-<AREA>-NNN. Priority = P1 (critical) / P2 (major) / P3 (minor).

2.1 Sale Order

TC IDURD refScenarioStepsExpectedP
TC-ORD-001URD-ORD-001Create draft order1. Cashier authenticated for a merchant 2. Create orderOrder created with status DRAFT, scoped to merchant and deviceP1
TC-ORD-002URD-ORD-002Add product to draft1. DRAFT order 2. Add a productLine item added; price captured at add-time; quantity defaults to 1P1
TC-ORD-003URD-ORD-002Edit blocked outside DRAFT1. PROCESSING order 2. Try to add an itemRejected — items editable only in DRAFTP1
TC-ORD-004URD-ORD-003Same product merges quantity1. DRAFT order with Product A (qty 1) 2. Add Product A againExisting line quantity increases (no duplicate line)P2
TC-ORD-005URD-ORD-004Quantity zero removes line1. DRAFT order with item (qty 1) 2. Update quantity to 0Line is removed (soft-deleted); total recalculatesP2
TC-ORD-006URD-ORD-005Combo fans out1. DRAFT order 2. Add a combo productOne lead line + zero-priced child lines created in one transactionP1
TC-ORD-007URD-ORD-005Combo re-add rejected1. Combo already in order 2. Add the same comboRejected — use edit to change quantityP2
TC-ORD-008URD-ORD-006Checkout locks price1. Product added at 50,000 2. Catalog price changes to 60,000 3. CheckoutTotal uses locked 50,000, not the new catalog priceP1
TC-ORD-009URD-ORD-006Checkout transition1. DRAFT order with ≥1 item 2. CheckoutStatus DRAFT → PROCESSING; totals calculatedP1
TC-ORD-010URD-ORD-007Empty cart rejected1. DRAFT order with no items 2. CheckoutRejected — at least one item requiredP1
TC-ORD-011URD-ORD-007Negative quantity rejected1. DRAFT order 2. Set an item quantity to -1 on addRejected — quantity must be ≥ 1P1
TC-ORD-012URD-ORD-008Revert to cart1. PROCESSING order 2. RevertStatus PROCESSING → DRAFT; items editable againP1
TC-ORD-013URD-ORD-009Cancel non-terminal1. Order in DRAFT / PROCESSING / PARTIAL 2. CancelStatus → CANCELLED; reason recorded when givenP1
TC-ORD-014URD-ORD-009Cancel terminal rejected1. COMPLETED or CANCELLED order 2. CancelRejected — terminal statusP1
TC-ORD-015URD-ORD-010Partial payment1. PROCESSING order 2. Payment success for less than totalStatus → PARTIALP1
TC-ORD-016URD-ORD-011Full payment completes1. PROCESSING order 2. Payment success ≥ totalStatus → COMPLETEDP1
TC-ORD-017URD-ORD-014Attach customer1. Order 2. Attach a customerCustomer linked; visible on order detailP2
TC-ORD-018URD-ORD-016Max items boundary1. DRAFT order with 100 items 2. Add the 101stRejected — max-items limit reachedP2

QE finding — quantity-zero delete

Source sale-order-item.service.ts: updating a line to quantity ≤ 0 soft-deletes it rather than raising a validation error. TC-ORD-005 validates this convention; the URD does not spell it out.

QE finding — checkout has no item lock

Source checkout.service.ts: checkout reads items then calls pricing with no pessimistic lock across the two steps, so a concurrent item edit during checkout is a potential race. TC-ORD-008 / TC-ORD-009 assume no concurrent edit.

QE finding — max items = 100

Source sale.service.ts: addSaleOrderItem enforces MAX_NUMBER_OF_ITEMS_IN_ORDER = 100 with pessimistic locking. TC-ORD-018 validates the boundary.

2.2 Check Splitting

TC IDURD refScenarioStepsExpectedP
TC-CHK-001URD-CHK-001Split into checks1. Order 2. Split into multiple checksMultiple sale checks created under the orderP2
TC-CHK-002URD-CHK-002Allocate items to check1. Split order 2. Assign items / quantities to a checkEach check holds its allocated items and totalP2
TC-CHK-003URD-CHK-004Order completes via checks1. All checks on an order completedOrder status → COMPLETEDP2
TC-CHK-004URD-CHK-005Roll back split1. Split order, no check paid 2. Roll backChecks removed; order returns to a single billP3

2.3 Kitchen Tickets

TC IDURD refScenarioStepsExpectedP
TC-KIT-001URD-KIT-001Send to kitchen1. Order with items 2. Send to kitchenTicket + ticket items createdP1
TC-KIT-002URD-KIT-002Idempotent send1. Send with an idempotency key 2. Retry with same keyNo duplicate ticket createdP1
TC-KIT-003URD-KIT-003Ticket lifecycle1. New ticket 2. Progress itemsTicket moves PENDING → PROCESSING → READY → COMPLETEDP1
TC-KIT-004URD-KIT-004Item lifecycle1. Ticket item 2. Start cooking → ready → servedItem moves PENDING → COOKING → READY → SERVEDP1
TC-KIT-005URD-KIT-005Auto-progression1. Mark all items READYTicket auto-progresses to READY without manual ticket updateP1
TC-KIT-006URD-KIT-006Void and resend1. Sent ticket item 2. Need a quantity changeIn-place edit not allowed; void old + send newP2
TC-KIT-007URD-KIT-008Real-time update1. KDS connected 2. Item status changesKDS and dashboard receive the live updateP1
TC-KIT-008URD-KIT-009Served triggers consume1. Kitchen item marked servedStock consumption is triggered for that itemP2

QE finding — real-time events are fire-and-forget

Source checkout.service.ts, payment-webhook.service.ts: WebSocket broadcasts are not awaited. A broadcast failure is logged but does not roll back the order operation. TC-KIT-007 covers delivery, not delivery guarantee.

2.4 Kitchen Stations

TC IDURD refScenarioStepsExpectedP
TC-STA-001URD-STA-001Create station1. Manager 2. Create a named station (i18n)Station created and scoped to merchantP2
TC-STA-002URD-STA-002Category routing1. Map a product category to a station 2. Send those itemsTheir tickets route to the mapped stationP2
TC-STA-003URD-STA-003Station printer config1. Configure a station printer with auto-printNew tickets at that station auto-printP3

2.5 POS Sessions

TC IDURD refScenarioStepsExpectedP
TC-POS-001URD-POS-001Open session1. No open session on device 2. Open with floatSession created OPEN with opening floatP1
TC-POS-002URD-POS-002One session per device1. Open session on device 2. Open another on same deviceRejected — one open session per deviceP1
TC-POS-003URD-POS-003Close & reconcile1. Open session 2. Close with counted cashDiscrepancy = actual − expected recordedP1
TC-POS-004URD-POS-004Z report once1. Close sessionExactly one Z report (PosSessionReport) generatedP1
TC-POS-005URD-POS-006Order attaches to session1. Open session 2. Create an order on the deviceOrder linked to the open sessionP2
TC-POS-006URD-POS-008Recount on close1. Close, then re-close with a corrected countRecount tracked; final figures updatedP3

2.6 Reservations

TC IDURD refScenarioStepsExpectedP
TC-RSV-001URD-RSV-001Create reservation1. Host 2. Create with guest name, phone, party size, timeReservation PENDING; table held (allocation active)P2
TC-RSV-002URD-RSV-002Confirm then check in1. Confirm reservation 2. Check inPENDING → CONFIRMED → CHECKED_INP2
TC-RSV-003URD-RSV-005Check-in spawns order1. Confirmed reservation 2. Check inSale order spawned and linked; allocation re-targetedP2
TC-RSV-004URD-RSV-002Cancel reservation1. PENDING or CONFIRMED reservation 2. CancelStatus → CANCELLED; held tables releasedP2

2.7 Loyalty Points

TC IDURD refScenarioStepsExpectedP
TC-PNT-001URD-PNT-001Earn on completion1. Order with a linked customer 2. Payment succeedsPoints awarded for the completed orderP2
TC-PNT-002URD-PNT-002Idempotent award1. Duplicate payment-success event for same orderPoints awarded once onlyP2
TC-PNT-003URD-PNT-003Balance per merchant1. Customer earns across ordersBalance accumulates per customer per merchantP3

3. Traceability

Every Must requirement maps to ≥1 test case. Gaps are flagged.

URD requirementTest case(s)Status
URD-ORD-001TC-ORD-001✅ Covered
URD-ORD-002TC-ORD-002, TC-ORD-003✅ Covered
URD-ORD-003TC-ORD-004✅ Covered
URD-ORD-004TC-ORD-005✅ Covered
URD-ORD-005TC-ORD-006, TC-ORD-007✅ Covered
URD-ORD-006TC-ORD-008, TC-ORD-009✅ Covered
URD-ORD-007TC-ORD-010, TC-ORD-011✅ Covered
URD-ORD-008TC-ORD-012✅ Covered
URD-ORD-009TC-ORD-013, TC-ORD-014✅ Covered
URD-ORD-010TC-ORD-015✅ Covered
URD-ORD-011TC-ORD-016✅ Covered
URD-ORD-012⚠️ Uncovered (Should — order split)
URD-ORD-013⚠️ Uncovered (Should — order merge)
URD-ORD-014TC-ORD-017✅ Covered
URD-ORD-015⚠️ Uncovered (Should — multi-currency)
URD-ORD-016TC-ORD-018✅ Covered
URD-CHK-001TC-CHK-001✅ Covered
URD-CHK-002TC-CHK-002✅ Covered
URD-CHK-003⚠️ Uncovered (Should — per-check customer)
URD-CHK-004TC-CHK-003✅ Covered
URD-CHK-005TC-CHK-004✅ Covered
URD-KIT-001TC-KIT-001✅ Covered
URD-KIT-002TC-KIT-002✅ Covered
URD-KIT-003TC-KIT-003✅ Covered
URD-KIT-004TC-KIT-004✅ Covered
URD-KIT-005TC-KIT-005✅ Covered
URD-KIT-006TC-KIT-006✅ Covered
URD-KIT-007⚠️ Uncovered (Should — rush / sequence)
URD-KIT-008TC-KIT-007✅ Covered
URD-KIT-009TC-KIT-008✅ Covered
URD-STA-001TC-STA-001✅ Covered
URD-STA-002TC-STA-002✅ Covered
URD-STA-003TC-STA-003✅ Covered
URD-POS-001TC-POS-001✅ Covered
URD-POS-002TC-POS-002✅ Covered
URD-POS-003TC-POS-003✅ Covered
URD-POS-004TC-POS-004✅ Covered
URD-POS-005⚠️ Uncovered (Should — X report)
URD-POS-006TC-POS-005✅ Covered
URD-POS-007⚠️ Uncovered (Should — non-cash expected vs actual)
URD-POS-008TC-POS-006✅ Covered
URD-RSV-001TC-RSV-001✅ Covered
URD-RSV-002TC-RSV-002, TC-RSV-004✅ Covered
URD-RSV-003⚠️ Uncovered (Should — source tracking)
URD-RSV-004⚠️ Uncovered (Should — occasion tagging)
URD-RSV-005TC-RSV-003✅ Covered
URD-PNT-001TC-PNT-001✅ Covered
URD-PNT-002TC-PNT-002✅ Covered
URD-PNT-003TC-PNT-003✅ Covered

All Must requirements are covered. Uncovered items are Should-priority enhancements pending test authoring.

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