Warehouse management (WMS) · Supporting domain · EventStorming board
yard-management
The physical yard outside the walls: who passed the gate, where each trailer is, who moves it, and what is done at the door.
- events published
- 23
- commands
- 16
- policies
- 17
- read models
- 7
- hot spots
- 4
The story in 5 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventVisit
Checked In - Pivotal eventTrailer
Docked - Pivotal eventDoor
Work Completed - Pivotal eventTrailer
Undocked - Pivotal eventTrailer
Departed
Listens to (3): contexts whose events this one reacts to
Tells (4): 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
-
Check a truck in at the gate
The gate clerk records a visit and its trailers. The seal is compared with the booking, and each trailer gets a move: to its door if on time and the door is free, otherwise to a spot. Site policy can turn a seal mismatch or a suspended carrier away.
ActorGate clerkRead modelAppointments (copy from dock-scheduling)Read modelYard spots and doors (copy from facility-layout)Read modelCarrier registry (copy from dock-scheduling)Read modelYard policyCommandCheckIn POST /visitsVisit AggregateVisitEventVisitChecked In EventSealException Raised EventYardMove analytics stream onlyRequested Systemdock-scheduling PolicyMarks the appointment as arrived: early, on time or lateSysteminbound-receiving PolicyStores the gate arrival, the start of the dock-to-stock clockSystemexception-management PolicyOpens a case when the seal does not matchSource: application/usecases/gate_checkin.go · application/usecases/targeting.go · domain/yardvisit/visit.go
-
Turn a truck away at the gate
The gate clerk refuses a visit and records the reason. The refused visit is recorded as rejected and gets no trailer.
ActorGate clerkCommandRejectAt POST /visit-rejectionsGate AggregateVisitEventVisitRejected Systemdock-scheduling PolicyCancels the booked appointment with the reason 'turned away'Systemexception-management PolicyOpens a case for the rejected visitSource: application/usecases/gate_checkin.go · domain/yardvisit/visit.go
-
Ask for a trailer to be moved
A yard supervisor asks for a trailer to go to a spot or a door. The destination is checked and reserved. The yard also asks by itself: it calls the next trailer in when a door frees up and clears a dropped trailer after door work.
ActorYard supervisorRead modelYard spots and doors (copy from facility-layout)Read modelDoor closures (copy from dock-scheduling)CommandRequestMove POST /movesAggregateMoveEventYardMove analytics stream onlyRequested Source: application/usecases/moves.go · application/usecases/doors.go · domain/yardmove/yardmove.go
-
Hand the next move to a yard-truck driver
A hostler (yard-truck driver) asks for work. The yard picks the most urgent waiting move and lends it for a limited time. The trailer leaves its place at once; leaving a door frees that door.
ActorHostlerCommandClaimNext POST /moves/claimsMove AggregateMoveEventYardMove analytics stream onlyClaimed EventTrailerUndocked Systemdock-scheduling PolicyCompletes the appointment when its trailer leaves the doorSource: application/usecases/moves.go · domain/yardmove/yardmove.go · domain/trailer/movement.go
-
Park or dock the trailer
The hostler reports where the trailer was left. The move ends and the trailer is parked on a spot or docked at a door, in one step. An occupied place is refused and the move stays open.
ActorHostlerRead modelYard spots and doors (copy from facility-layout)CommandCompleteMove POST /moves/{moveId}/completionsAggregateMoveEventYardMove analytics stream onlyCompleted EventTrailerParked analytics stream onlyEventTrailerDocked Systemdock-scheduling PolicyMoves the booking to the door the trailer really took, if differentSystemoutbound-shipping PolicyAttaches the trailer to the load at that door and starts loadingSource: application/usecases/moves.go · domain/trailer/trailer.go · domain/trailer/placement.go
-
Start work at the door
A dock operator starts unloading or loading a docked trailer. If the site asks for it, an unsecured trailer is refused, and so is loading before a required inspection has passed.
ActorDock operatorCommandStartDoor POST /trailers/{trailerId}/door-work-startsWork AggregateTrailerEventDoorWork analytics stream onlyStarted Source: application/usecases/doors.go · domain/trailer/work.go
-
Secure a docked trailer
A dock operator records that the trailer is held to the dock by a vehicle restraint or wheel chocks. It must be docked and have no open move.
ActorDock operatorCommandSecureTrailer POST /trailers/{trailerId}/securingsAggregateTrailerEventTrailerSecured Source: application/usecases/doors.go · domain/trailer/securing.go · 0013-dock-safety-interlock.md
-
Finish unloading when the receipt closes
inbound-receiving closes a receipt. When every ASN on a docked trailer has a closed receipt, its door work is completed and the trailer counts as empty. Staff can also complete door work by hand.
Systeminbound-receiving EventReceiptClosed PolicyWhenever the last receipt of a docked trailer closes, complete its door workCommandCompleteDoor POST /trailers/{trailerId}/door-work-completionsWork AggregateTrailerEventDoorWork Completed Read model · kept up to dateReceipts at the doorSystemoutbound-shipping PolicyKeeps the door-work completion for its load adherence viewSource: application/usecases/consumers.go · adapters/inbound/kafka/inbound_receiving_consumer.go · domain/trailer/work.go
-
Release the securing before the trailer leaves
A dock operator frees the trailer from restraint or chocks. This is needed before it can leave its door, and is refused while door work is in progress.
ActorDock operatorCommandReleaseTrailer POST /trailers/{trailerId}/securing-releasesSecuring AggregateTrailerEventTrailerSecuring Released Source: application/usecases/doors.go · domain/trailer/securing.go · 0013-dock-safety-interlock.md
-
Inspect a trailer
An inspector works through a checklist and completes it. If a required item fails, the inspection fails and the trailer is put on hold in the same step.
ActorInspectorRead modelInspection checklist templatesCommandCompleteInspection POST /inspections/{inspectionId}/completionsAggregateInspectionEventInspectionCompleted EventInspectionFailed EventTrailerHeld analytics stream onlySource: application/usecases/inspections.go · domain/inspection/inspection.go · 0015-compliance-inspections.md
-
Release a hold on a trailer
A yard supervisor lifts the hold on a trailer, whether it was placed by hand, by a broken seal or by a failed inspection.
ActorYard supervisorCommandReleaseHold POST /trailers/{trailerId}/hold-releasesAggregateTrailerEventTrailerHold analytics stream onlyReleased Source: application/usecases/doors.go · domain/trailer/trailer.go
-
Check a truck out of the yard
The gate clerk lets the visit leave with the trailers it takes. Each must be on site and released, and an inspection before departure may be required. A trailer left behind is a drop and stays.
ActorGate clerkCommandCheckOut POST /visits/{visitId}/check-outsVisit AggregateVisitEventVisitChecked analytics stream onlyOut EventTrailerDeparted EventTrailerUndocked Systemoutbound-shipping PolicyConfirms the shipment and issues the bill of lading when the load is closedSystemdock-scheduling PolicyCompletes the appointment when its trailer leaves the doorSource: application/usecases/gate_checkout.go · domain/yardvisit/visit.go · domain/trailer/trailer.go
-
Free the yard when a booking falls through
dock-scheduling reports a booking cancelled, missed or moved to another door. The yard cancels the open moves that were bringing a trailer to that door. A trailer already on site stays where it is.
Systemdock-scheduling EventDockAppointment No Show PolicyWhenever a booking is cancelled, missed or moved, cancel its open hostler moves to the doorCommandCancelMove POST /moves/{moveId}/cancellationsAggregateMoveEventYardMove analytics stream onlyCancelled Read model · kept up to dateAppointments (copy from dock-scheduling)Source: application/usecases/consumers.go · adapters/inbound/kafka/dock_scheduling_consumer.go · domain/yardmove/yardmove.go
-
Take back moves whose lease ran out
A sweep looks for claimed moves whose time ran out. Each goes back to the waiting list and its trailer back to where it was, unless that place was taken meanwhile.
TimeScheduler cronPolicyEvery sweep, put each claimed move whose lease has expired back on the waiting listCommandSweepMove POST /move-lease-sweepsLeases AggregateMoveEventYardMove analytics stream onlyLease Expired Source: application/usecases/moves.go · domain/yardmove/yardmove.go
-
Chase trailers that stay too long
A sweep finds trailers on site whose time reached the limit for their kind and raises one alert for each.
TimeScheduler cronPolicyEvery sweep, raise a dwell alert once for each trailer past its limitRead modelYard policyCommandSweepDwell POST /dwell-sweepsAggregateTrailerEventTrailerDwell Exceeded Systemexception-management PolicyOpens a case for the overdue trailerSource: application/usecases/checks_policy.go · domain/trailer/trailer.go
-
Audit the yard against the records
A supervisor walks the yard, notes what is at each place, then closes the check. It reports every difference from what the yard believes. A place not seen is missing if a trailer should be there.
ActorYard supervisorCommandCloseYard POST /yard-checks/{yardCheckId}/closuresCheck AggregateCheckEventYardCheck Closed Systemexception-management PolicyOpens one case per difference; a clean check opens noneSource: application/usecases/checks_policy.go · domain/yardcheck/yardcheck.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 spotA door closure or a retired slot under a trailer already there is not handled. Closures only guard arrival. Handling the case is left to a later phase.
Source: docs/ddd/eventstorming.md
- Hot spotHazmat and reefer rules trust the declared load. The yard cannot check what a trailer holds, and one classified after parking stays where it is.
- Hot spotSecuring, release and inspection results are published but nobody reads them yet.
- Hot spotThe event contract does not yet declare who made a change when an agent writes through the tool interface. The data is on the wire.
Source: adr/0007-mcp-server.md
Opportunities
- Opportunityexception-management is the planned reader of failed inspections, so that a failure becomes an exception case to work.
- OpportunityA hazmat segregation rule, so classes may not stand on adjacent spots, needs spot neighbours that facility-layout does not publish yet. A later ADR is planned.
This board is a reconstruction from the code and documentation of yard-management at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.