Warehouse execution (WES) · Core domain · EventStorming board
network-inventory-planning
Plans moving stock between warehouses: advises, then runs an approved transfer from stock reservation through pick, dispatch and arrival.
- events published
- 7
- commands
- 16
- policies
- 16
- read models
- 4
- hot spots
- 5
The story in 4 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventTransfer
Plan Approved - Pivotal eventTransfer
Allocation Requested - Pivotal eventWork
Demand Released - Pivotal eventTransfer
Allocation Release Requested
Listens to (6): contexts whose events this one reacts to
Tells (2): contexts that react to its events
The board, row by row
16 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
-
Keep the site capability copy
facility-layout says which sites may send or receive transfers. Here a local copy follows it, and a newer revision replaces the older one, so planning never has to ask.
Systemfacility-layout EventSiteCapability Changed PolicyWhenever a site's capability changes, replace its row if the revision is newerCommandApplySite started by the policyCapability Changed Read model · kept up to dateSite capabilitiesSource: adapters/inbound/kafka/consumers.go · domain/planning/capability.go
-
Keep the demand copy
order-management reports the units each order line needs from a site. A local copy keeps the newest fact per line. A removed line counts for nothing.
Systemorder-management EventSiteSku Demand Changed PolicyWhenever an order line's demand changes, keep its newest version; a removed line counts for noneCommandApplySite started by the policySku Demand Changed Read model · kept up to dateSite demand per SKUSource: adapters/inbound/kafka/consumers.go · domain/planning/demand.go · adr/0014-site-sku-demand-ordering-guard.md
-
Keep the capacity plan copy
warehouse-planning publishes capacity plans. A local copy keeps the newest plan for each plan id. A plan with no site is left out.
Systemwarehouse-planning EventCapacityPlan Published PolicyWhenever a plan for a site is published, keep the newest version of itCommandApplyCapacity started by the policyPlan Published Read model · kept up to datePublished capacity plansSource: adapters/inbound/kafka/consumers_capacity_plan.go · domain/planning/capacity_plan.go
-
Set the rebalance rules
An operator writes the policies that say which SKUs may move, and the lanes between sites. The scheduled rebalance plans only from these catalogues. Lanes are set the same way.
ActorOperatorCommandPutRebalance PUT /v1/rebalance-policiesPolicy AggregateRebalancePolicy Source: application/usecases/catalogue.go · domain/transfer/catalogue.go · adr/0015-rebalance-policy-and-lane-catalogue.md
-
Try out transfers without committing
An operator submits positions, policies and lanes and gets advisory proposals back. A simulation can instead use the local copies. Nothing is reserved or published.
ActorOperatorCommandGenerateTransfer POST /v1/transfer-proposal-runsProposals Source: application/usecases/generate_transfer_proposals.go · application/usecases/simulate_transfer_options.go
-
Approve a transfer and ask for stock
An operator approves a proposal. It is checked against the local copies, and refused if a fact is missing or stale. SKUs sold in cases move in whole cases. inventory-storage is then asked for the origin stock.
ActorOperatorRead modelSite capabilitiesRead modelSite demand per SKURead modelPublished capacity plansRead modelPack levelsCommandApproveTransfer POST /v1/transfer-approvalsAggregateInterWarehouse Transfer EventTransferPlan Approved EventTransferAllocation Requested EventTransferState analytics stream onlyAdvanced Systeminventory-storage PolicyReserves the origin stock and answers allocated or rejectedSource: application/usecases/approve_transfer.go · domain/transfer/saga.go · domain/transfer/approval.go · adr/0003-transfer-saga.md
-
Release the pick once stock is held
inventory-storage reports the stock reserved. The transfer becomes allocated and the pick work is released in the same step, so an allocated transfer never lacks its pick work.
Systeminventory-storage EventTransferStock Allocated PolicyWhenever origin stock is reserved, mark the transfer allocated and release its pick workCommandApplyTransfer started by the policyAllocation AggregateInterWarehouse Transfer EventWorkDemand Released EventTransferState analytics stream onlyAdvanced Systemwes-work- planning PolicyCreates the transfer pick as a work unit referring to the transferSource: application/usecases/transfer_facts.go · adapters/inbound/kafka/transfer_reply_consumer.go · adr/0005-work-demand-release-and-fact-transitions.md
-
Give up when stock cannot be held
inventory-storage refuses the reservation, with a reason from a fixed list. The transfer is marked unfulfillable and ends there.
Systeminventory-storage EventTransferStock Allocation Rejected PolicyWhenever origin stock cannot be reserved, mark the transfer unfulfillable with the reasonCommandApplyTransfer started by the policyRejection AggregateInterWarehouse Transfer EventTransferState analytics stream onlyAdvanced Source: application/usecases/approve_transfer.go · adapters/inbound/kafka/transfer_reply_consumer.go
-
Cancel a transfer
An operator cancels with a reason. Before any stock is held the transfer is cancelled at once. If stock is already reserved, a release is requested first. From picking onwards the cancel is refused.
ActorOperatorCommandCancelTransfer POST /v1/transfers/{transferId}/cancellationAggregateInterWarehouse Transfer EventTransferAllocation Release Requested EventTransferState analytics stream onlyAdvanced Systeminventory-storage PolicyLets go of the origin reservation and reports backSource: application/usecases/cancel_transfer.go · domain/transfer/saga.go · adr/0022-cancel-after-allocation-compensation.md
-
Finish a cancel once the hold is gone
inventory-storage confirms the origin reservation is released, or was already gone. Either way the hold no longer exists, so the transfer is cancelled for good.
Systeminventory-storage EventTransferStock Allocation Released PolicyWhenever the origin reservation is released, mark the cancelling transfer cancelledCommandApplyTransfer started by the policyAllocation Released AggregateInterWarehouse Transfer EventTransferState analytics stream onlyAdvanced Source: application/usecases/apply_transfer_released.go · adapters/inbound/kafka/transfer_reply_released.go · adr/0022-cancel-after-allocation-compensation.md
-
Release the dispatch once picked
fulfillment-execution reports the pick, possibly short. The picked quantity is recorded and dispatch work is released for exactly that quantity.
Systemfulfillment-execution EventTransferPicked PolicyWhenever the pick completes, record the picked quantity and release the dispatch workCommandApplyTransfer started by the policyPick AggregateInterWarehouse Transfer EventWorkDemand Released EventTransferState analytics stream onlyAdvanced Systemwes-work- planning PolicyCreates the dispatch as a work unit referring to the transferSource: application/usecases/transfer_facts.go · adapters/inbound/kafka/transfer_fact_consumer.go · adr/0005-work-demand-release-and-fact-transitions.md
-
Mark the transfer in transit
fulfillment-execution reports that the goods left the origin. The transfer moves to in transit. No work is released for this step.
Systemfulfillment-execution EventTransferDispatched PolicyWhenever dispatch completes, mark the transfer in transitCommandApplyTransfer started by the policyDispatched AggregateInterWarehouse Transfer EventTransferState analytics stream onlyAdvanced Source: application/usecases/transfer_facts.go · adapters/inbound/kafka/transfer_fact_consumer.go
-
Mark the transfer arrived
inventory-storage reports the receipt staged at the destination. A work-driven arrival fact from fulfillment-execution may also exist. Whichever comes first moves the transfer to arrived; the other is skipped.
Systeminventory-storage EventTransferReceipt Staged PolicyWhenever the first arrival signal comes, mark the transfer arrivedCommandApplyTransfer started by the policyReceipt Staged AggregateInterWarehouse Transfer EventTransferState analytics stream onlyAdvanced Source: application/usecases/transfer_facts.go · adapters/inbound/kafka/transfer_fact_consumer.go · adr/0005-work-demand-release-and-fact-transitions.md
-
Close the transfer once stowed
inventory-storage reports the goods stowed at the destination, with where they went. The transfer is received and its journey ends.
Systeminventory-storage EventTransferStock Stowed PolicyWhenever the stow is confirmed, mark the transfer received and keep where the stock wentCommandApplyTransfer started by the policyStow AggregateInterWarehouse Transfer EventTransferState analytics stream onlyAdvanced Source: application/usecases/transfer_facts.go · adapters/inbound/kafka/transfer_fact_consumer.go
-
Flag transfers that are stuck
A periodic check compares each open transfer with a time limit for its state and reports the ones past it. It only reports: it never cancels or changes a transfer.
TimeHealth checkPolicyEvery check, report each open transfer that has stayed too long in its stateCommandCheckStuck started by the clockTransfers AggregateStuckCheck EventTransferStuck analytics stream onlyDetected Source: application/usecases/saga_health.go · domain/transfer/stuck.go · adr/0007-phase4-observability-and-scheduled-runs.md
-
Run a scheduled rebalance
On a schedule, the planner works from the local copies and the operator's catalogues, and records how many proposals it made and how many it rejected. It never approves anything.
TimeRebalance schedulePolicyEvery run, plan proposals from the local copies and record the outcome, without approving anyRead modelSite capabilitiesRead modelSite demand per SKURead modelPublished capacity plansCommandRunScheduled started by the clockRebalance AggregatePlannerEventRebalanceRun analytics stream onlyCompleted Source: application/usecases/scheduled_rebalance.go · domain/transfer/planner.go · adr/0015-rebalance-policy-and-lane-catalogue.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 spotA transfer can no longer be cancelled once picking has started. The stock is moving, and there is no damage or short-pick flow yet.
Source: docs/adr/0022-cancel-after-allocation-compensation.md
- Hot spotIf the dispatch path is not configured, the dispatch work is withheld and nothing releases it later. The transfer waits in picked.
Source: docs/ddd/eventstorming.md
- Hot spotThe scheduled rebalance cannot see stock positions, so it plans only from site capability, demand and catalogues.
Source: docs/adr/0015-rebalance-policy-and-lane-catalogue.md
- Hot spotThe stuck-transfer check only reports. Nothing retries or recovers a stuck transfer on its own.
Source: docs/adr/0007-phase4-observability-and-scheduled-runs.md
- Hot spotThe dwell report shows a transfer's age at each step, not the time spent in a state. A true dwell time needs a new field.
Opportunities
- OpportunityIf a sibling context ever publishes stock positions, they could be kept locally and the scheduled pass could plan from real stock.
Source: docs/adr/0015-rebalance-policy-and-lane-catalogue.md
- OpportunityAdding a dwell-seconds field to the state-change event would give a true time-in-state report.
This board is a reconstruction from the code and documentation of network-inventory-planning at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.