The Orders dashboard is the operational control tower for order fulfilment: the live backlog (what's waiting to be shipped or delivered), daily throughput, and action lists of orders that need attention.
Like the Claims dashboard it reads live through a server function (/api/orders) — credentials stay server-side, results cached 5 minutes. It replaces the old Google-Sheets ops control that broke at current order volume.
The grain is the order line item (one product on one order), not the order. Everything is bucketed to the UAE business day with a 09:00 cutoff (the morning check).
Live via /api/orders (Vercel function, Singapore region). 5-minute cache. A red banner shows if data is more than 8 hours old. Cold loads can take ~20s when the DB is busy; cached loads are instant.
Example values are a snapshot taken 10 July 2026 (v4) to make definitions concrete — the live dashboard always shows current numbers.
Status field: shipment_status_mapped (numbered 1-7). Backlog 'bands' are derived states used by the charts.
Live backlog snapshot + how it has moved over time. Headline numbers come from the reconstructed daily series (full 180-day population at the 09:00 cut); detail rows cover a shorter actionable window. Renderer: renderBacklogTab.
Internal backlog
What it isLine items created but not yet shipped.
How it's calculatedLatest day of the reconstructed series, summed across countries (internal_backlog band). Sub-line notes how many are recent (≤60d) and their GMV.
Example9,175 (as of 10 July 2026 (v4))
Where (code)renderBacklogTab → backlogSeries (internal band)
Total open
What it isEverything not yet delivered.
How it's calculatedinternal_backlog + in_transit on the latest series day.
Example~15,700
Where (code)renderBacklogTab → backlogSeries
In transit
What it isShipped, awaiting delivery.
How it's calculatedin_transit band on the latest series day.
Example6,512
Where (code)renderBacklogTab → backlogSeries
On hold
What it isLine items flagged is_on_hold.
How it's calculatedCount of detail rows with the on-hold flag.
Example~5
Where (code)renderBacklogTab → openOrders
⚠ This one is from detail rows (180-day on-hold window), a different basis from the series-driven cards.
To be confirmed / Awaiting QC / QC'd not shipped
What it isThe three sub-stages of internal backlog.
How it's calculatedunconfirmed / awaiting_qc / qc_not_shipped bands on the latest series day.
Examplevaries
Where (code)renderBacklogTab → backlogSeries
Aged backlog (>30d)
What it isOld open items still sitting in the pipeline.
How it's calculatedSum of the agedBacklog buckets (31-90 / 91-365 / >365 days).
Example~54,914
Where (code)renderBacklogTab → agedBacklog
⚠ These are mostly items whose status was never closed — data-cleanup candidates, not active work. Reviewed in Order Tables.
① Internal backlog evolution (chart)
What it isStacked daily backlog by stage at the 09:00 cut.
How it's calculatedThe reconstructed series over the selected range; stacks 'to-be-confirmed/created' and 'QC'd not shipped'.
Exampletrend chart
Where (code)renderBacklogTab → drawStacked
② Total open by country (chart)
What it isOne line per country of internal + in-transit.
How it's calculatedSeries summed per country per day.
Exampletrend chart
Where (code)renderBacklogTab → drawLines
③ Backlog aging (chart)
What it isCurrently-open orders bucketed by age since creation: 0-2d / 3-7d / 8-14d / 15-30d / 30d+ (bars shaded green→red).
How it's calculatedOver open detail rows (respects the country and to-be-confirmed filters); each bar is a count of open orders in that age band.
Examplee.g. 2,105 aged >30d of 8,581 open
Where (code)renderBacklogTab → drawBars
⚠ Replaced the old on-hold / COD / Request-Revibe flag-history chart, which depended on daily snapshots that had barely started collecting and so rendered near-empty.
Daily throughput and in-flight aging. Renderer: renderOpsTab.
Created / Shipped / Delivered today + Net flow
What it isToday's counts and whether the backlog grew.
How it's calculatedFrom dailyOps for today's UAE date. Net flow = created - shipped (positive = backlog growing).
Example~650 created/day
Where (code)renderOpsTab → dailyOps
Throughput charts (6)
What it isCreated, shipped, delivered, cancelled per day; net flow; confirmed & QC'd per day.
How it's calculatedDaily counts over the selected range with running averages (today excluded from averages).
Exampletrend charts
Where (code)renderOpsTab → dailyOps
④ In-flight orders by stage
What it isTable of open stages with volume and aging.
How it's calculatedOver open detail rows, stages 1-4: N, avg days since created, oldest (>14d flagged).
Examplevaries
Where (code)renderPipelineTable → openOrders
⚠ Counts here are the actionable window (≤60d created / ≤30d shipped), so lower than the headline series numbers.
⑤ Request Revibe (orders)
What it isBacklog and resolution of order-side Revibe requests.
How it's calculatedFrom revibe_resolutions entity_type='order': open count, 60d created, avg hours to resolve.
Example'no data yet' until requests flow
Where (code)renderRequestRevibe → requestRevibe
⑥ Fulfillment (30d)
What it isFulfilment share and delivery SLAs.
How it's calculateddelivery_method='Fulfillment' vs all: % of orders, % of GMV, shipped ≤24h, delivered ≤24h (AE) / ≤48h (ZA), cancelled.
Examplevaries
Where (code)renderFulfillment → fulfillment
⚠ SLA uses CALENDAR hours, not working days — to be confirmed with ops.
Case lists that replace checking each app view manually. Every list is a filter over the open-orders detail set. Renderer: renderCasesTab.
Late orders
What it isOpen items older than 2 working days, not shipped.
How it's calculatedstage 1-3 AND working-day age > 2 (Sat/Sun excluded).
Examplevaries
Where (code)renderCasesTab → CASES.late
⚠ Threshold (2 working days) is a default — confirm with ops.
To be confirmed
What it isItems still awaiting confirmation.
How it's calculatedstage 01 or confirmed_status = 'To be confirmed'.
Examplevaries
Where (code)renderCasesTab → CASES.tbc
To book shipping
What it isQC done but no shipping booked.
How it's calculatedstage 2-3 with a QC date and no shipping date.
Examplevaries
Where (code)renderCasesTab → CASES.book
On hold
What it isFlagged is_on_hold.
How it's calculatedis_on_hold = 1.
Examplevaries
Where (code)renderCasesTab → CASES.hold
COD to call
What it isCash-on-delivery orders needing a confirmation call.
How it's calculatedcod_to_collect > 0 AND cod_status not Confirmed/Cancelled.
Examplevaries
Where (code)renderCasesTab → CASES.cod
⚠ Exact predicate to confirm with ops.
In transit > 5d
What it isShipped but not delivered for over 5 days — courier follow-up.
How it's calculatedstage 04 AND days since shipping > 5.
Examplevaries
Where (code)renderCasesTab → CASES.transit
Availability issues
What it isSupplier flagged the item unavailable / alternative / high courier / rejected.
How it's calculatedstage 1-3 AND availablity_status not 'Confirmed'.
Examplevaries
Where (code)renderCasesTab → CASES.avail
Aged backlog summary
What it isCounts of stuck items by stage and country in 31-90 / 91-365 / >1yr buckets.
How it's calculatedFrom agedBacklog (no time window — all history).
Example~54,914 total
Where (code)renderCasesTab → agedBacklog
⚠ Data-cleanup candidates, as above.
backlogSeries — Event-delta backlog reconstruction
For each line item, emit +1 when it ENTERS a band and -1 when it LEAVES (per band: internal, unconfirmed, awaiting_qc, qc_not_shipped, in_transit). SNAP(col)=DATE(UAE-time + 15h) maps an event to the next 09:00 snapshot. Exit = LEAST(next stage dates, cancelled_date) with a '9999-01-01' sentinel for NULLs. GROUP BY day,country,band gives net deltas; JS then cumulative-sums over the calendar into absolute daily levels, clamped >=0. Population = items created in the last 180 days; emits the last 90 days. (Replaced an O(days x rows) cross-join that timed out.)
dailyOps — Daily throughput
One GROUP BY per event date column (created/confirmed/qc/shipped/delivered/cancelled) over 61 days, merged in JS by day+country. created carries gmv_created.
openOrders — Open detail rows
order_products + orders + LEFT countries/suppliers. WHERE NOT_DEAD AND (open stages created<=60d, OR shipped-undelivered shipped<=30d, OR on-hold non-terminal <=180d). Compacted: status->numeric 1-7, default fields dropped (short keys onum/c/s/m/st/cs/oh/cod/ctc/dm/av/g + cr/cf/qc/sh dates).
agedBacklog — Aged backlog counts
order_products + orders + countries. WHERE NOT_DEAD AND (open stages OR shipped-undelivered). Buckets by created_at: 31-90 / 91-365 / >365 days. No time window (all history).
requestRevibe — Request Revibe (orders)
revibe_resolutions entity_type='order': open list (status 'Not Replied'), daily created (60d), daily resolved + avg_hours (60d).
fulfillment — Fulfilment SLAs
delivery_method='Fulfillment' 30d aggregate: items, gmv, shipped<=24h, AE delivered<=24h, ZA delivered<=48h, cancelled; plus all-orders items+gmv for the share. SLAs in calendar hours.
lookups — Lookups
SELECT id,name FROM countries ORDER BY name.
Generated 10 July 2026 (v4) · single source regenerable via the docs generator.