Order Management API
The missing upstream Open Host Service for the warehouse-systems platform: it owns Order and OrderLine as first-class, validated aggregates. Before this bounded context existed, "an order" was just an unowned, unvalidated string — OrderRef / DemandRef / Reference — independently reinvented by three different services. Here the OrderId is a real identity, and it is the value sent downstream as inventory-storage's demandRef.
The lifecycle is intake -> allocation -> release, with cancellation legal up to the release boundary — but as of this redesign, a caller only ever expresses ONE intent: place an order (POST /orders). Allocation and release are internal saga steps this service performs automatically, right after intake, and again on POST /orders/{id}/allocation-retries — they are no longer public REST verbs a caller drives by hand. Allocation reserves stock per line through inventory-storage's published POST /reservations; a 409 from that service is the business fact "no usable stock", which backorders that one line, while any other failure fails the whole allocation pass rather than silently recording a backorder. Release is no longer a synchronous call to any Supplier — it is announced as a fact on the enriched OrderAllocated / OrderPartiallyAllocated Kafka integration events (topic warehouse.order-management.events), which wes-work-planning consumes to enqueue its own work asynchronously. This service holds no reservation or work-unit state of its own, only the references it needs to revoke.
The order-level status is always DERIVED from the line statuses and is never stored, so it cannot drift out of sync with the lines it summarises.
Out of this service's boundary: it does not hold inventory, pick, pack, ship, or plan work (those are inventory-storage, wes-work-planning and fulfillment-execution), and it does not model a local Reservation or WorkUnit aggregate. Error responses across this API use RFC 7807 (application/problem+json) Problem Details.
This API follows the fleet REST API guideline (ADR 0048): URLs name things (commands are noun sub-resources such as POST /orders/{id}/releases and POST /orders/{id}/allocation-retries), EVERY POST is behind the Idempotency-Key middleware (a retry replays the stored answer, when the first answer is final for the request, with the response header Idempotency-Replayed: true; a refusal that depends on state that can change is not stored, see the Idempotency-Key parameter and ADR 0054; the same key with a different method, path or body is 409 idempotency-key-reused; a missing key is 400 idempotency-key-required, a malformed one 400 idempotency-key-invalid), and DELETE /orders/{id} is idempotent by method. GET /planned-capacity is a bounded read model exempt from paging (x-pagination-exempt: report).
Contact Order Management (Generic/Supporting Bounded Context):