Orders (Admin)
Executive summary
Section titled “Executive summary”Orders provides list (tabs, search, filters, pagination) and detail with status updates and receipt flows. Access is gated by admin modules and zone like other dashboard areas.
Goals and non-goals
Section titled “Goals and non-goals”| Goals | Non-goals |
|---|---|
| Operate order pipeline from head office | Replicate POS lane timing or terminal UX |
| Link to technical order/payment docs where relevant | Document every legacy order state code |
Current platform behavior
Section titled “Current platform behavior”- Routes:
/dashboard/ordersand/dashboard/orders/:idper table below. - Backend enforces zone and permissions; empty lists may mean no data in zone.
Sequence: happy path
Section titled “Sequence: happy path”- Open Orders → filter tab → find order.
- Open detail → review lines, customer, payment state.
- Update status / actions per policy → confirm in list.
Security and operations
Section titled “Security and operations”- PII (customer contact) — follow data handling policy; restrict exports.
- Payment disputes: correlate with POS payments & webhooks and PSP tools.
Test scenarios (UAT / QA)
Section titled “Test scenarios (UAT / QA)”| ID | Scenario | Expected |
|---|---|---|
| O1 | List loads | Tabs and pagination work |
| O2 | Open detail | Matches backend truth |
| O3 | Status change | Persists; audit if available |
Routes
Section titled “Routes”| Path | Purpose |
|---|---|
/dashboard/orders | Order list with tabs, search, filters, pagination |
/dashboard/orders/:id | Order detail, status update, receipt |
List (/dashboard/orders)
Section titled “List (/dashboard/orders)”The list is grouped by tab (server-side semantics):
| Tab | Role |
|---|---|
| All | Every order in scope |
| Paid | Paid-related subset |
| Pending | Not yet completed / awaiting action |
| Cancelled | Cancelled orders |
| Returns | Return-related subset |
Types align with AdminOrdersTab in admin-orders.api.ts.
Search and filters
Section titled “Search and filters”- Search — debounced text search across orders (400ms debounce).
- Filters (popover) — vendor, store, date from / to, and sort (for example newest / oldest, amount, id). Choosing a store takes precedence for overview stats; vendor is used when no store filter is set.
- Pagination — fixed page size (10 rows per page); changing tab, search, or filters resets to page 1.
Overview stats
Section titled “Overview stats”Stat cards above the table reflect total orders, pending, completed, and refunded counts, scoped by the active store or vendor filter when set.
Columns include order id, customer, amounts, status labels, line counts, and actions (open detail). Column-level sort can sync back into list sort parameters.
Detail (/dashboard/orders/:id)
Section titled “Detail (/dashboard/orders/:id)”- Loads a single order via the admin orders API.
- Shows lines, customer, store snapshot, totals, payment and order status, refund summary when present.
- Edit order — modal to adjust allowed fields (including order status from the normalized option set used in the app).
- Receipt — opens a POS-style receipt dialog for printing or review (
PosOrderReceiptDialog), built from admin order data. Server HTML isGET /admin/orders/:id/receipt-html; optional querytip_signature=1matches the vendor receipt merchant-copy layout (tip suggestions + signature + Merchant Copy footer). The receipt preview modal includes a checkbox to load that variant.
Statuses in the UI map from raw API strings to translated labels (including aliases like canceled → cancelled).
Vendor-side refunds and finance flows may overlap conceptually with Finance; the admin app focuses on oversight and status management.