Warehouse execution (WES) · Core domain · EventStorming board
wes-work-planning
Releases work to the floor continuously, earliest cut-off first, from orders, transfers, slot moves and top-ups. It watches backlog and flags where to rebalance.
- events published
- 8
- commands
- 13
- policies
- 15
- read models
- 6
- hot spots
- 3
The story in 4 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventWork
Unit Created - Pivotal eventWork
Released - Pivotal eventWork
Unit Completed - Pivotal eventBacklog
Threshold Breached
Listens to (9): contexts whose events this one reacts to
Tells (4): contexts that react to its events
The board, row by row
15 rows, in the order the business story happens: the main path first, then how this context reacts to the others, then the clock. Rows are small stories; read each one left to right.
- Event
- Command
- Actor
- Aggregate
- Policy
- Read model
- External system
- Hot spot
- Opportunity
-
Turn an allocated order into work
When an order is allocated, fully or in part, each released line becomes one work unit on its process path. A path the catalogue does not know is refused loudly instead of filling a pool nobody serves.
Systemorder-management EventOrderAllocated PolicyWhenever an order is allocated, enqueue one work unit per released lineCommandApplyOrder started by the policyAllocated AggregateWorkUnit EventWorkUnit Created Systemorder-management PolicyConfirms the order line was released to the floor planner, so it knows nothing was lostSource: application/usecases/apply_order_allocated.go · application/usecases/enqueue_work_unit.go · domain/workunit/work_unit.go
-
Turn a stock transfer into work
network-inventory-planning releases a transfer demand. It becomes one work unit named after the demand, so a repeat of the same demand never makes a second one. Only transfer legs are accepted, never relocation.
Systemnetwork-inventory- planning EventWorkDemand Released PolicyWhenever a transfer demand is released, enqueue one work unit for itCommandApplyWork started by the policyDemand Released AggregateWorkUnit EventWorkUnit Created Source: application/usecases/apply_work_demand_released.go · adr/0033-transfer-work-demand-choreography.md
-
Turn an approved slot plan into relocation work
slotting-optimization approves a plan of moves. Each move becomes a relocation unit, and a move waiting on another stays blocked until that one completes. A newer plan cancels the older plan's unreleased moves.
Systemslotting-optimization EventSlotPlan Approved PolicyWhenever a slot plan is approved, plan one relocation unit per move and cancel older unreleased movesCommandApplySlot started by the policyPlan Approved AggregateWorkUnit EventWorkUnit Created Source: application/usecases/apply_slot_plan_approved.go · domain/relocation/plan.go · adr/0040-slot-plan-relocation-work.md
-
Turn a pick-face top-up request into work
pick-face-replenishment asks for a top-up, and it becomes one work unit, urgent ones sorting ahead. A cancellation before release withdraws the unit. Work already released runs to completion.
Systempick-face- replenishment EventReplenishmentRequested PolicyWhenever a top-up is requested, plan one work unit for it, with a deadline set by its priorityCommandApplyReplenishment started by the policyRequested AggregateWorkUnit EventWorkUnit Created Source: application/usecases/apply_replenishment_requested.go · application/usecases/apply_replenishment_cancelled.go · adr/0042-pick-face-replenishment-work.md
-
Add work to a path by hand
A supervisor, or an agent, adds one work unit to a path's pool. A case pick is checked against the SKU's active case pack level and refused if it cannot be checked.
ActorSupervisorRead modelPack facts per SKUCommandEnqueueWork POST /paths/{pathId}/work-unitsUnit AggregateWorkUnit EventWorkUnit Created Source: application/usecases/enqueue_work_unit.go · domain/workunit/work_unit.go · adr/0045-pack-aware-work-units.md
-
Release the next work
A supervisor, or an agent, releases the pending work unit with the earliest cut-off. A path fed by release stops at its work-in-progress limit. The release carries hazard hints from the product's classification.
ActorSupervisorRead modelProduct hazard classesCommandReleaseNext POST /paths/{pathId}/work-releasesWork AggregateWorkPool EventWorkReleased Systemfulfillment-execution PolicyTurns the released work into a floor task needing the skills its path requiresSource: application/usecases/release_next_work.go · domain/release/work_pool.go · domain/release/release_policy.go
-
Finish a work unit when its task is done
When the floor completes the task, the work unit is completed and its slot in the pool is freed. A completed relocation admits the moves that were waiting behind it. Tasks this service never planned are ignored.
Systemfulfillment-execution EventTaskCompleted PolicyWhenever a floor task completes, complete its work unit and free its work-in-progress slotCommandApplyTask started by the policyCompleted AggregateWorkUnit EventWorkUnit Completed Source: application/usecases/apply_task_completed.go · application/usecases/record_completion.go · adr/0043-taskcompleted-already-completed-skip.md
-
Watch a path's backlog
A supervisor samples a path's backlog. Over its alarm threshold, an alarm goes out. If a cut-off time is given, the path's remaining room for new work before it is announced too.
ActorSupervisorCommandSampleBacklog GET /paths/{pathId}/telemetryAggregateWorkPool EventBacklogThreshold Breached EventPathCapacity Changed Systemexception-management PolicyOpens or updates an exception for the path on a backlog alarmSystemorder-management PolicyKeeps the remaining room per path and cut-off for its delivery promisesSystemnetwork-fulfillment PolicyKeeps the remaining room per path for its own capacity figuresSource: application/usecases/sample_backlog.go · domain/release/work_pool.go · adr/0018-path-capacity-changed.md
-
Decide how to rebalance a path
A supervisor asks what to do about a path. A flow-fed path over its alarm gets 'throttle upstream'. A release-fed path stuck at its limit with work waiting gets 'reassign labour'. Both are flags only. A rate deviation notice is declared but never raised.
ActorSupervisorRead modelLabour plan from workforceCommandRebalanceDecision POST /paths/{pathId}/rebalance-decisionsAggregateWorkPool EventPathThrottled EventLaborReassignment Flagged EventRateDeviation Detected Source: application/usecases/rebalance_decision.go · adr/0003-flow-balancing-as-domain-service.md · adr/0020-flowfed-path-observed-throughput-signal.md
-
Set how a path's pool is fed
A supervisor sets whether a path is fed by release or by flow, and its work-in-progress limit. Lowering the limit never evicts work: releases just pause until the count falls under it. Nothing is announced.
ActorSupervisorCommandConfigurePool PUT /paths/{pathId}/poolAggregateWorkPool Source: application/usecases/configure_pool.go · domain/release/work_pool.go · adr/0034-configure-pool-command.md
-
Keep the latest labour plan per path
workforce-management commits its headcount per path. This service keeps a read-only copy that supervisors can look up and that comes back with a rebalance answer. Since planning moved to warehouse-planning, nothing is compared here.
Systemworkforce-management EventShiftPlan Committed PolicyWhenever the labour plan for a path arrives, replace the local copy with itCommandObserveLabor started by the policyPlan Read model · kept up to dateLabour plan from workforceSource: application/usecases/observe_labor_plan.go · domain/laborview/labor_plan_observed.go · adr/0049-charge-forecast-and-shift-plan-move-to-warehouse-planning.md
-
Keep the process-path list
process-path-management announces every path defined, revised or retired. When the catalogue source is set to that feed, this service follows it live. By default it reads a file instead.
Systemprocess-path- management EventProcessPath Created PolicyWhenever a path is created, revised or retired, update the local process-path listRead model · kept up to dateProcess-path listSource: adapters/outbound/kafkacatalog/consumer.go · cmd/wes/catalogue.go · adr/0030-kafka-sourced-path-catalogue.md
-
Keep the product hazard and pack facts
product-master announces each product's classification, such as hazmat or fragile, and its pack levels. This service keeps its own copies and stamps the hints on released work. A newer version replaces an older one.
Systemproduct-master EventProductClassified PolicyWhenever a product is classified or its pack level changes, replace the local copy with the newer versionCommandObserveProduct started by the policyClassification Read model · kept up to dateProduct hazard classesRead model · kept up to datePack facts per SKUSource: application/usecases/observe_product_classification.go · application/usecases/observe_pack_level.go · adapters/inbound/kafka/product_classification_consumer.go · adr/0035-product-classification-local-copy.md · adr/0045-pack-aware-work-units.md
-
Keep the usable-stock view
inventory-storage announces stock reserved and reservations revoked. This service keeps a read-only count of usable stock per SKU that operators can look up. No release decision depends on it.
Systeminventory-storage EventStockReserved PolicyWhenever stock is reserved or a reservation is revoked, adjust the usable-stock count for that SKUCommandObserveInventory started by the policyChange Read model · kept up to dateUsable stock per SKUSource: application/usecases/observe_inventory_change.go · domain/inventoryview/usable_inventory_observed.go · adr/0006-labor-plan-view-not-shift-plan.md
-
Feed the throughput report
The service reads its own announcements and keeps hourly figures per path: work released and completed, backlog alarms and throttling. They feed the release throughput report.
Event · earlierWorkReleased PolicyWhenever work is released or completed, or an alarm is raised, add it to that path's hourly figuresRead model · kept up to dateRelease throughput reportSource: adapters/inbound/kafka/analytics_consumer.go · adr/0011-analytical-data-product.md
Hot spots and opportunities
Open questions and known gaps, each taken from a decision record or a document in the repository, never invented. Opportunities are improvements the documentation already names.
- Hot spotRateDeviationDetected is declared but no rule raises it. A test fails if code starts raising it before a decision defines when.
Source: docs/adr/0020-flowfed-path-observed-throughput-signal.md
- Hot spotThe old forecast and plan routes still answer with a 'moved' error for one release before they go, and their stored tables are kept until a separate approval.
Source: docs/adr/0049-charge-forecast-and-shift-plan-move-to-warehouse-planning.md
- Hot spotRemaining room for flow-fed paths is permanently unknown, and a consumer must match it to a cut-off by nearest time because there is no stronger key.
Opportunities
- OpportunityA real-time, sub-hour observed-throughput figure per flow-fed path is deferred until a consumer needs fresher data than the report.
Source: docs/adr/0020-flowfed-path-observed-throughput-signal.md
- OpportunityA cancellation event for unreleased work units can be added if a consumer needs one. Today a cancelled unit is visible only through the read API.
- OpportunityA work-in-progress limit worked out from planned heads would add a copy of warehouse-planning's labour plan, under its own decision.
Source: docs/adr/0049-charge-forecast-and-shift-plan-move-to-warehouse-planning.md
This board is a reconstruction from the code and documentation of wes-work-planning at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.