Warehouse management (WMS) · Core domain · EventStorming board
inventory-storage
The stock ledger of a site: books received goods, stows them into bins, reserves and picks them, moves and counts them, and settles held stock and transfers.
- events published
- 26
- commands
- 19
- policies
- 18
- read models
- 7
- hot spots
- 5
The story in 5 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventItem
Stowed - Pivotal eventStock
Reserved - Pivotal eventStock
Picked - Pivotal eventStock
Relocated - Pivotal eventTransfer
Stock Stowed
Listens to (7): contexts whose events this one reacts to
Tells (6): contexts that react to its events
The board, row by row
19 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
-
Book a received line as staged stock
inbound-receiving reports a line counted as Good. Its units become staged stock: counted, but not usable until someone stows them. Return lines staged by returns-processing are booked the same way.
Systeminbound-receiving EventReceiptLine Received PolicyWhenever a Good line is received, book its units as staged stock, once per eventCommandBookInbound started by the policyReceipt Line AggregateStockUnit EventStockReceived analytics stream onlySource: application/usecases/book_inbound_receipt_line.go · application/usecases/receive_stock.go · adapters/inbound/kafka/inbound_receipt_consumer.go · domain/stock/stock_unit.go
-
Stow stock into a bin
Inventory control scans the item and then the bin. Hazmat and temperature-sensitive products must go to a fitting zone, and hazard classes that clash may not share a bin. Stowed stock becomes usable.
ActorInventory controlRead modelProduct classesRead modelFacility locationsCommandStowStock POST /stowagesAggregateStockUnit EventItemStowed EventBinStock Level Changed Systempick-face- replenishment PolicyRe-checks whether the SKU's pick face is running lowSource: application/usecases/stow_stock.go · application/usecases/bin_level_emitter.go · domain/stock/stock_unit.go
-
Turn a received carton into a container
inbound-receiving scans a sealed carton. It becomes a container with its own license plate, but only for units the ledger has already counted, whichever of the two messages arrives first.
Systeminbound-receiving EventReceiptCarton Received PolicyWhenever a sealed carton is received, link it to a container once its units are countedCommandLinkReceipt started by the policyCarton AggregateContainerEventContainerRegistered Source: application/usecases/link_receipt_carton.go · application/usecases/container_linker.go · domain/container/container.go
-
Stow a sealed case
Inventory control scans the case and then a case or pallet bin. The case's eaches become usable stock in that bin. Stowing again into another bin of the same site moves the case.
ActorInventory controlCommandStowContainer POST /containers/{lpn}/stowagesAggregateContainerEventContainerStowed Systeminbound-receiving PolicyUses the stow to finish its dock-to-stock timingSource: application/usecases/stow_container.go · domain/container/container.go
-
Break a sealed case into loose eaches
Inventory control opens a stowed case on purpose. Its eaches move to loose stock in a chosen bin, with the same total, and the container is left empty. It is never done implicitly by a pick.
ActorInventory controlCommandBreakCase POST /containers/{lpn}/case-breaksAggregateContainerEventCaseBroken EventContainerEmptied Source: application/usecases/break_case.go · domain/container/container.go
-
Register a reusable tote
A tote is labelled once and registered by the plate printed on it. Registering again changes nothing, and a plate already used by a sealed case is refused: one set of plates for every container.
ActorFloor operatorCommandRegisterTote PUT /totes/{lpn}AggregateToteEventToteRegistered Source: application/usecases/register_tote.go · domain/container/tote.go
-
Fill a tote with loose items
At a decant station the operator scans the item, then the tote. The items are stowed into the tote's current bin under the same placement and capacity rules as a plain stow, and the tote is marked as filled.
ActorFloor operatorRead modelWhere the tote isRead modelPlacement rules of the binCommandFillTote POST /totes/{lpn}/fillsAggregateToteEventToteFilled EventBinStock Level Changed Source: application/usecases/fill_tote.go · domain/container/tote.go
-
Stow a tote with everything in it
The operator scans the tote, then the bin. The tote and all its contents move to the new bin together, or not at all. A tote holding reserved stock cannot move.
ActorFloor operatorRead modelContents of the toteRead modelPlacement rules of the binCommandStowTote POST /totes/{lpn}/stowagesAggregateToteEventToteStowed EventBinStock Level Changed Source: application/usecases/stow_tote.go · domain/container/tote.go
-
Hold a damaged line out of stock
A line received as Damaged is never usable. It becomes a held unit that waits for a decision, and its units stay out of usable stock.
Systeminbound-receiving EventReceiptLine Received PolicyWhenever a Damaged line is received, hold it out of usable stockCommandHoldStock started by the policyAggregateHeldUnit EventStockHeld Source: application/usecases/hold_stock.go · application/usecases/book_inbound_receipt_line.go · domain/stock/held_unit.go
-
Decide what happens to held stock
Inventory control decides: release it back to the normal flow, return it to the vendor, scrap it, or keep it held for rework. A release books the units as staged stock again.
ActorInventory controlCommandDecideHeld POST /held-stock/{id}/dispositionsDisposition AggregateHeldUnit EventStockReleased EventStockDispositioned Source: application/usecases/decide_held_disposition.go · domain/stock/held_unit.go
-
Reserve stock for an order
An order system asks to bind a quantity of usable stock to a demand. Pick faces are drawn first, in a fixed order. A repeat of the same request is recognised, and an unused reservation times out.
ActorOrder systemRead modelUsable inventoryRead modelForward pick facesCommandReserveStock POST /reservationsAggregateReservationEventStockReserved Systemwes-work- planning PolicyLowers the usable stock it observes for the SKUSource: application/usecases/reserve_stock.go · domain/reservation/reservation.go · domain/allocation/order.go
-
Revoke a reservation
A reservation is cancelled and its quantity returns to usable. Timeouts are only noticed when a reservation is read: if it had already timed out, the timeout is recorded instead.
ActorOrder system or agentCommandRevokeReservation DELETE /reservations/{id}AggregateReservationEventReservationRevoked EventReservationExpired analytics stream onlySystemwes-work- planning PolicyRaises the usable stock it observes for the SKUSource: application/usecases/revoke_reservation.go · application/usecases/reservation_expiry.go · domain/reservation/reservation.go
-
Confirm the picks of a finished task
When a pick task completes, the reservation of that order line is used up and the stock leaves. Events without a line number are counted instead, and the order's last pick confirms everything.
Systemfulfillment-execution EventTaskCompleted PolicyWhenever a pick task completes, confirm the reservation of that order lineCommandConfirmPicks started by the policyFor Order AggregateReservationEventStockPicked analytics stream onlySource: application/usecases/confirm_picks_for_order.go · application/usecases/confirm_pick.go · adapters/inbound/kafka/task_completed_consumer.go
-
Move stock between bins
A finished relocation or replenishment task moves stock between two bins of one site, in one step. The move carries a reason and a reference, and can also be made by hand over the REST route.
Systemfulfillment-execution EventTaskCompleted PolicyWhenever a relocation or replenishment task completes, move the stock it namesCommandApplyRelocation started by the policyTask AggregateRelocationEventStockRelocated EventBinStock Level Changed Systemslotting-optimization PolicyTracks slot-plan progress from moves made for slottingSystempick-face- replenishment PolicyCloses the request when the move is a replenishmentSource: application/usecases/apply_relocation_task.go · application/usecases/apply_replenish_task.go · application/usecases/relocate_stock.go · domain/relocation/relocation.go
-
Count a bin
Inventory control counts what is in a bin. A shortfall marks whole units as unlocated, an overage is only reported, and every count is recorded.
ActorInventory controlCommandRunCycle POST /bins/{binId}/cycle-countsCount AggregateStockUnit EventCycleCount analytics stream onlyCompleted EventDiscrepancyDetected EventItemUnlocated Systemexception-management PolicyOpens a case for a count mismatch and for each unlocated itemSource: application/usecases/run_cycle_count.go · domain/stock/stock_unit.go
-
Hold origin stock for a transfer
Network planning asks this site to give up stock for a transfer line. The stock is held and the answer, allocated or rejected with a reason, is recorded exactly once per line.
Systemnetwork-inventory- planning EventTransferAllocation Requested PolicyWhenever planning requests a transfer allocation, hold the stock and record the outcome onceRead modelUsable inventoryCommandAllocateTransfer started by the policyStock AggregateAllocationEventTransferStock Allocated EventTransferStock Allocation Rejected Systemnetwork-inventory- planning PolicyMoves the transfer on, as allocated or rejectedSource: application/usecases/allocate_transfer_stock.go · domain/transfer/allocation.go · adapters/inbound/kafka/transfer_consumer.go
-
Release the hold of a cancelled transfer
If a transfer is cancelled after allocation, planning asks for the hold to be released. The stock returns to usable, or the hold is found already gone, and either way the transfer settles.
Systemnetwork-inventory- planning EventTransferAllocation Release Requested PolicyWhenever planning asks to release a transfer allocation, free the hold and record the outcome onceCommandReleaseTransfer started by the policyAllocation AggregateReleaseEventTransferStock Allocation Released Systemnetwork-inventory- planning PolicyMarks the transfer cancelledSource: application/usecases/release_transfer_allocation.go · domain/transfer/release.go · adapters/inbound/kafka/transfer_consumer.go
-
Count a transfer arrival
The destination site counts what arrived against a transfer line. Over and short counts are recorded as they are, not absorbed. An arrival nobody allocated is recorded as an exception.
ActorReceiving clerkCommandStageTransfer POST /transfers/{transferLineId}/receiptReceipt AggregateReceiptEventTransferReceipt Staged Systemnetwork-inventory- planning PolicyRecords the counted arrival and any differenceSource: application/usecases/stage_transfer_receipt.go · domain/transfer/receipt.go · domain/transfer/exception.go
-
Stow a transfer into destination bins
The counted arrival is stowed into bins of the destination site, and the quantities must add up exactly. Only now does the destination's usable stock rise, once per transfer line.
ActorReceiving clerkCommandStowTransfer POST /transfers/{transferLineId}/stowagesStock AggregateReceiptEventTransferStock Stowed Systemnetwork-inventory- planning PolicyRecords the stow for the transferSource: application/usecases/stow_transfer_stock.go · domain/transfer/receipt.go
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 spotThere is no sweeper for timed-out reservations. An unread one keeps its stock out of usable until someone reads it.
- Hot spotA stow into a bin facility-layout never announced is allowed. Fragile, oversized and high-value products have no placement rule.
Source: docs/ecosystem/context-map.md
- Hot spotShort picks are not modelled: a task carries no quantity, so a confirmed line is picked in full.
- Hot spotA cycle-count overage is reported but never reconciled. That needs a separate receiving or audit process.
Source: docs/ddd/eventstorming.md
- Hot spotThe check that stops two identical reservations is best effort. Two requests arriving at the same moment can both pass.
Source: docs/ddd/eventstorming.md
Opportunities
- OpportunityQuality inspection could place holds. Reasons for pending checks and suspect stock are already accepted for later producers.
- OpportunityLot and expiry are carried on containers, but first-expired-first-out picking is out of scope for now.
Source: docs/adr/0045-container-lpn-sealed-cases-breakcase-owner-segregated-stock.md
- OpportunityTransfer allocation still draws stock in storage order. Making that order deterministic is a recorded follow-up.
Source: docs/adr/0050-deterministic-forward-first-allocation.md
This board is a reconstruction from the code and documentation of inventory-storage at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.