Orders
Orders in EmberX are created by staff on behalf of guests — typically from within a conversation. Guests do not place orders directly; instead, they make a request via chat and staff add the items from the product catalog.
How Orders Are Created
Orders originate from conversations:
- A guest scans a QR code and starts a conversation (e.g., “Can I get a bottle of wine and some fruit?”)
- Staff open the product catalog within the conversation
- Staff select the relevant products and quantities
- The order is created and linked to both the Conversation and the Guest
This means every order has full context: which room the guest is in, which Service Center handled it, and the full chat history.
Order Status Lifecycle
EmberX uses a simple 4-state lifecycle with enforced transition rules:
pending ──→ wip ──→ completed (final) └──→ cancelled cancelled (final) (from wip too)| Status | Meaning |
|---|---|
pending | Order created, waiting for staff to begin processing |
wip | Work In Progress — staff have acknowledged and are fulfilling |
completed | Order delivered/fulfilled successfully |
cancelled | Order was cancelled (by staff or guest request) |
Transition Rules
| From | Can move to |
|---|---|
pending | wip or cancelled |
wip | completed or cancelled |
completed | (final — no further changes) |
cancelled | (final — no further changes) |
There is no intermediate “ready” or “confirmed” state — the transition from wip to completed represents full fulfillment. Once an order reaches completed or cancelled, its status is locked.
Orders Dashboard
Navigate to Orders in the main sidebar to view all orders. The dashboard provides:
Status Filter Chips
At the top of the page, quick-filter chips show live counts for each status:
pending (3) wip (1) completed (12) cancelled (2)Click any chip to filter the table to that status. Click again to clear the filter.
Updating Order Status
From the Orders table:
- Find the order.
- Click the ⋯ (Actions) button in the row.
- Select the target status from the dropdown (e.g., Mark as wip, Mark as completed, Mark as cancelled).
- The change saves immediately and a toast notification confirms.
Only valid next states are shown — completed and cancelled orders display no action menu.
You can also update status from within the linked conversation.
Order Structure
Each order stores:
| Field | Description |
|---|---|
items | JSON array: [{ productId, name, price, quantity }] |
totalPrice | Calculated total (sum of items × quantity) |
notes | Optional guest note attached to the order |
status | Current status (pending / wip / completed / cancelled) |
guestId | The guest who requested the order |
conversationId | The conversation where the order was created |
Products & Pricing
Products are managed separately in the Products module. Each product can have:
- A base price
- A discount (percentage or fixed amount)
- Multiple images
- Tags for categorization
When an order is created, the product’s current name and price are snapshot into the items JSON — so historical orders always reflect the price at time of purchase, even if the product price changes later.
Filtering Orders
The Orders table supports filtering by status using the chip buttons at the top. All other sorting and searching is handled in the data table columns.
Orders Analytics Dashboard
The Orders Analytics section appears on the main Dashboard (Overview) page — giving managers and admins a real-time view of order performance without leaving the home screen.
Period Selector
Switch between three time windows using the pill buttons at the top of the analytics section:
| Period | Coverage |
|---|---|
| 7d | Last 7 days |
| 30d | Last 30 days (default) |
| 90d | Last 90 days |
KPI Cards
Four summary cards show all-time totals at a glance:
| Card | Metric |
|---|---|
| Total Orders | All orders ever created; sub-label shows pending count |
| Total Revenue | Sum of totalPrice for all orders; sub-label shows average order value |
| In Progress | Orders currently in wip status |
| Completed | All completed orders; sub-label shows cancelled count |
Charts
| Chart | Type | Description |
|---|---|---|
| Orders per Day | Vertical bar chart | Daily order count for the selected period. X-axis tick density adjusts automatically (every day for 7d, every 5 days for 30d, every 10 days for 90d) |
| Orders by Status | Donut / pie chart | Distribution of all-time orders across the 4 statuses |
| Top Selling Products | Horizontal bar chart | Products ranked by total quantity sold in the selected period |