Skip to main content

Expected demand of a site over a window (order-management read model)

GET 

/demand

The orders order-management has promised at a site for a window, read from the LOCAL read model this service builds from order-management's published OrderAllocated / OrderPartiallyAllocated CloudEvents (docs/adr/0004; never a live call). orders counts the distinct orders whose promise cutoff (the event's promise_date) falls in the half-open window [window_start, window_end): a cutoff exactly at window_start counts, one exactly at window_end belongs to the next window. An order is counted once, at the promise of its latest event (last writer wins on the CloudEvents time). released_lines sums the lines their latest allocation pass released; it is NOT units -- order-management's events carry no quantities. An order is attributed to the fulfillment site its event carries (site_id, order-management ADR 0050), or to the fallback site configured on this service (DEMAND_SITE_ID) when it carries none (docs/adr/0021). Cancellations are not published on the integration topic and are not netted, and an OrderRepromised event carries no new cutoff, so it is ignored. 200 with orders 0 and as_of null when nothing is known -- an empty answer that POST /capacity-plans never turns into a zero-demand plan.

Request​

Responses​

The expected demand (possibly empty).