Skip to main content

Warehouse Planning

Core Subdomain

Warehouse Planning is one of the fleet's sixteen domain bounded contexts and sits in the wes tier of the CloudEvents subdomain taxonomy. It answers one question: can this warehouse process the demand assigned to it, given its current labor, location, equipment, station, conveyor and buffer constraints? That is distinct from Inventory Management ("what do we have"): none of the other contexts computes a normalized, cross-process effective capacity or a forward-looking capacity shortage (ADR 0001).

It owns two sides of one question. The capacity side: process and process-path capacity (the minimum across a step's registered constraints, normalized to orders per hour), the rule by which a registered capacity window is resolved by coverage (ADR 0003), and the station capacity composition done at read time (ADR 0002). On top of those it keeps the CapacityPlan aggregate: assigned demand versus path capacity over a planning window, with the resulting shortage and the bottleneck step. The requirement side (ADRs 0022 to 0025, accepted 2026-11-18): the workload forecast per site and path, the labour plan per site, shift and path with its drift against what workforce-management committed (both moved here from wes-work-planning, ADR 0023), the labour requirement a plan states per step from labor-performance's standards (ADR 0022), and plans that take their demand from the forecast, scenarios, a comparison read and supersession (ADR 0024).

What is live, what is opt-in, and what is planned

Per this context's own Context Map and Domain Events:

Live, consumed (every consumer group is required, none is optional): workforce-management's ShiftPlanCommitted (a LABOR constraint, and the committed heads the drift compares), facility-layout's LocationSlotRegistered and LocationSlotDecommissioned, order-management's OrderAllocated and OrderPartiallyAllocated (expected demand, at the event's own site_id, else DEMAND_SITE_ID, ADR 0021), dock-scheduling's dock appointment events (inbound labour demand, ADR 0020, which replaced the inbound-receiving events of ADR 0017), fulfillment-execution's TaskCompleted (observed capacity), and labor-performance's LaborStandardDefined and LaborStandardRevised from its integration topic (a local copy of the standards, ADR 0022).

Live, published: ten CloudEvents types on warehouse.warehouse-planning.events through a transactional outbox: five capacityplan types (CapacityPlanCreated, CapacityPlanPublished, CapacityShortageDetected, BottleneckDetected and CapacityPlanSuperseded, raised when publishing a plan replaces the plan published before it for the same site, location, path and window), two processcapacity types (ProcessCapacityRegistered and ProcessCapacityChanged, no consumer) and three requirement-side types: WorkloadForecastReceived, LabourPlanCommitted and LabourPlanDriftDetected. The capacity-plan and requirement-side events also have an analytics copy on warehouse.warehouse-planning.analytics for its own projector and reports (ADR 0005). It serves REST (Kong route /api/warehouse-planning) and MCP; warehouse-ops-agent reads get_process_path_capacity for its daily-brief capacity outlook, and the console hosts this context's own capacity_mfe remote.

Live, consumed by siblings: order-management reads the capacity-plan events into a local read model, including CapacityPlanSuperseded (its ADRs 0031 and 0052; opt-in on its side with PLANNED_CAPACITY_CONSUMER_GROUP) and matches a plan by site_id, else by location (its ADR 0053). workforce-management keeps LabourPlanCommitted as the heads a shift requires and proposes from it (its ADR 0043).

New REST surface: PUT/GET /workload-forecasts/{site_id}/{path_id}, PUT/GET /labour-plans/{site_id}/{shift_id}/{path_id}, GET /labour-plans and GET /capacity-plans/comparisons. POST /capacity-plans takes an optional demand_source (request, orders or forecast) and an optional scenario label. wes-work-planning's POST /paths/{pathId}/charge and /plan are removed (ADR-0049 stage E, 2026-11-21) after one release of 410 naming these routes.

Built by ADR 0017: observed-capacity feedback from fulfillment-execution's TaskCompleted, compared with the plan by GET /capacity-plans/{id}/variance, and inbound labour demand composed at read time from an operator-declared InboundLabourStandard (PUT /inbound-labour-standards/{location}/{path_id}, GET /inbound-demand).

Built (stage 1): ProcessFlow (ADR 0025). process-path-management publishes an ordered sequence of process-path stages (ProcessFlowDefined/Revised/Retired, full state with a version), this context keeps a version-guarded process_flows copy as the path capacity's steps, and POST /process-paths retired through the strangler: stages 2-3 are built and deployed (v2.0.4) — the route answers 410 process-path-moved, migration 0019 dropped the local table, and every path read carries source: flow.

Planned, not implemented: observed capacity from wes-work-planning and demand from network-fulfillment, as drawn in ADR 0001's context map.

Consumed since ADR 0025

process-path-management's topic warehouse.process-path-management.events is consumed (always on, PROCESS_FLOW_CONSUMER_GROUP): the three processflow.* types keep the process_flows copy; every other type on the topic (ProcessPath*, CPTScheduleChanged) is ignored. The ADR 0001 Addendum's Separate Ways is now a customer/supplier edge with an anti-corruption layer — still no live call.

This context's pages​

Every page above except the Business Context and the Async API narrative is synced from the warehouse-planning repository.

Elsewhere​