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.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
26
commands
19
policies
18
read models
7
hot spots
5

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
  1. 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
    EventReceiptLineReceived
    PolicyWhenever a Good line is received, book its units as staged stock, once per event
    CommandBookInboundReceiptLinestarted by the policy
    AggregateStockUnit
    EventStockReceivedanalytics stream only

    Source: application/usecases/book_inbound_receipt_line.go · application/usecases/receive_stock.go · adapters/inbound/kafka/inbound_receipt_consumer.go · domain/stock/stock_unit.go

  2. 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 control
    Read modelProduct classes
    Read modelFacility locations
    CommandStowStockPOST /stowages
    AggregateStockUnit
    EventItemStowed
    EventBinStockLevelChanged
    Systempick-face-replenishment
    PolicyRe-checks whether the SKU's pick face is running low

    Source: application/usecases/stow_stock.go · application/usecases/bin_level_emitter.go · domain/stock/stock_unit.go

  3. 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
    EventReceiptCartonReceived
    PolicyWhenever a sealed carton is received, link it to a container once its units are counted
    CommandLinkReceiptCartonstarted by the policy
    AggregateContainer
    EventContainerRegistered

    Source: application/usecases/link_receipt_carton.go · application/usecases/container_linker.go · domain/container/container.go

  4. 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 control
    CommandStowContainerPOST /containers/{lpn}/stowages
    AggregateContainer
    EventContainerStowed
    Systeminbound-receiving
    PolicyUses the stow to finish its dock-to-stock timing

    Source: application/usecases/stow_container.go · domain/container/container.go

  5. 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 control
    CommandBreakCasePOST /containers/{lpn}/case-breaks
    AggregateContainer
    EventCaseBroken
    EventContainerEmptied

    Source: application/usecases/break_case.go · domain/container/container.go

  6. 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 operator
    CommandRegisterTotePUT /totes/{lpn}
    AggregateTote
    EventToteRegistered

    Source: application/usecases/register_tote.go · domain/container/tote.go

  7. 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 operator
    Read modelWhere the tote is
    Read modelPlacement rules of the bin
    CommandFillTotePOST /totes/{lpn}/fills
    AggregateTote
    EventToteFilled
    EventBinStockLevelChanged

    Source: application/usecases/fill_tote.go · domain/container/tote.go

  8. 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 operator
    Read modelContents of the tote
    Read modelPlacement rules of the bin
    CommandStowTotePOST /totes/{lpn}/stowages
    AggregateTote
    EventToteStowed
    EventBinStockLevelChanged

    Source: application/usecases/stow_tote.go · domain/container/tote.go

  9. 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
    EventReceiptLineReceived
    PolicyWhenever a Damaged line is received, hold it out of usable stock
    CommandHoldStockstarted by the policy
    AggregateHeldUnit
    EventStockHeld

    Source: application/usecases/hold_stock.go · application/usecases/book_inbound_receipt_line.go · domain/stock/held_unit.go

  10. 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 control
    CommandDecideHeldDispositionPOST /held-stock/{id}/dispositions
    AggregateHeldUnit
    EventStockReleased
    EventStockDispositioned

    Source: application/usecases/decide_held_disposition.go · domain/stock/held_unit.go

  11. 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 system
    Read modelUsable inventory
    Read modelForward pick faces
    CommandReserveStockPOST /reservations
    AggregateReservation
    EventStockReserved
    Systemwes-work-planning
    PolicyLowers the usable stock it observes for the SKU

    Source: application/usecases/reserve_stock.go · domain/reservation/reservation.go · domain/allocation/order.go

  12. 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 agent
    CommandRevokeReservationDELETE /reservations/{id}
    AggregateReservation
    EventReservationRevoked
    EventReservationExpiredanalytics stream only
    Systemwes-work-planning
    PolicyRaises the usable stock it observes for the SKU

    Source: application/usecases/revoke_reservation.go · application/usecases/reservation_expiry.go · domain/reservation/reservation.go

  13. 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 line
    CommandConfirmPicksForOrderstarted by the policy
    AggregateReservation
    EventStockPickedanalytics stream only

    Source: application/usecases/confirm_picks_for_order.go · application/usecases/confirm_pick.go · adapters/inbound/kafka/task_completed_consumer.go

  14. 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 names
    CommandApplyRelocationTaskstarted by the policy
    AggregateRelocation
    EventStockRelocated
    EventBinStockLevelChanged
    Systemslotting-optimization
    PolicyTracks slot-plan progress from moves made for slotting
    Systempick-face-replenishment
    PolicyCloses the request when the move is a replenishment

    Source: application/usecases/apply_relocation_task.go · application/usecases/apply_replenish_task.go · application/usecases/relocate_stock.go · domain/relocation/relocation.go

  15. 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 control
    CommandRunCycleCountPOST /bins/{binId}/cycle-counts
    AggregateStockUnit
    EventCycleCountCompletedanalytics stream only
    EventDiscrepancyDetected
    EventItemUnlocated
    Systemexception-management
    PolicyOpens a case for a count mismatch and for each unlocated item

    Source: application/usecases/run_cycle_count.go · domain/stock/stock_unit.go

  16. 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
    EventTransferAllocationRequested
    PolicyWhenever planning requests a transfer allocation, hold the stock and record the outcome once
    Read modelUsable inventory
    CommandAllocateTransferStockstarted by the policy
    AggregateAllocation
    EventTransferStockAllocated
    EventTransferStockAllocationRejected
    Systemnetwork-inventory-planning
    PolicyMoves the transfer on, as allocated or rejected

    Source: application/usecases/allocate_transfer_stock.go · domain/transfer/allocation.go · adapters/inbound/kafka/transfer_consumer.go

  17. 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
    EventTransferAllocationReleaseRequested
    PolicyWhenever planning asks to release a transfer allocation, free the hold and record the outcome once
    CommandReleaseTransferAllocationstarted by the policy
    AggregateRelease
    EventTransferStockAllocationReleased
    Systemnetwork-inventory-planning
    PolicyMarks the transfer cancelled

    Source: application/usecases/release_transfer_allocation.go · domain/transfer/release.go · adapters/inbound/kafka/transfer_consumer.go

  18. 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 clerk
    CommandStageTransferReceiptPOST /transfers/{transferLineId}/receipt
    AggregateReceipt
    EventTransferReceiptStaged
    Systemnetwork-inventory-planning
    PolicyRecords the counted arrival and any difference

    Source: application/usecases/stage_transfer_receipt.go · domain/transfer/receipt.go · domain/transfer/exception.go

  19. 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 clerk
    CommandStowTransferStockPOST /transfers/{transferLineId}/stowages
    AggregateReceipt
    EventTransferStockStowed
    Systemnetwork-inventory-planning
    PolicyRecords the stow for the transfer

    Source: 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.

Opportunities

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.