Skip to main content

Domain message flow

ddd-crew Domain Message Flow Modelling for four business scenarios. Participants are people, bounded contexts and the broker; every arrow is a real message, prefixed cmd: (command), evt: (event) or qry: (query) and numbered.

Event types are written in full the first time and shortened to their last segment afterwards inside the same diagram.

Scenario 1 — An allocated order becomes released, picked and completed work​

Source: internal/application/usecases/apply_order_allocated.go, release_next_work.go, apply_task_completed.go, internal/adapters/outbound/kafka/publisher.go. Omits: the analytics copy of every event on warehouse.wes.analytics, and REST enqueue (POST /paths/{pathId}/work-units), which is an alternative to step 1.

Scenario 2 — Observing the labour plan (the planning moved out)​

Source: internal/application/usecases/observe_labor_plan.go, internal/adapters/inbound/http/router.go. The charge forecast, the shift plan and the plan-vs-labour drift check moved to warehouse-planning (ADR-0049): the planner sends PUT /workload-forecasts/{site_id}/{path_id} and PUT /labour-plans/{site_id}/{shift_id}/{path_id} there, and it publishes LabourPlanDriftDetected. This context's old planning POSTs answered 410 for one release (v2.0.3) and were removed in stage E: POST /paths/{pathId}/charge (removed) and POST /paths/{pathId}/plan (removed) are no longer routes, so a POST answers 404.

Scenario 3 — Publishing remaining path capacity for promising​

Source: internal/application/usecases/sample_backlog.go; order-management internal/adapters/outbound/kafkapathcapacity/consumer.go; network-fulfillment internal/adapters/outbound/pathcapacitycache/consumer.go (both on origin/develop). Omits: BacklogThresholdBreached is raised only when the backlog exceeds the alarm threshold.

Scenario 4 — Flow balancing driven by an agent​

Source: internal/adapters/inbound/mcp/tools.go, internal/application/usecases/rebalance_decision.go; warehouse-ops-agent internal/config/config.go allow-lists the two read tools. Omits: the balance_flow MCP prompt and the telemetry://{pathId}/backlog resource.