Warehouse management (WMS) · Supporting domain · EventStorming board
dock-scheduling
Owns door time: who may use which dock door and when. It books, moves and cancels appointments, and follows the truck's real arrival and door from the yard.
- events published
- 14
- commands
- 14
- policies
- 31
- read models
- 4
- hot spots
- 4
The story in 5 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventDock
Appointment Booked - Pivotal eventDock
Appointment Checked In - Pivotal eventDock
Appointment Door Reassigned - Pivotal eventDock
Appointment Completed - Pivotal eventDock
Appointment No Show
Listens to (4): contexts whose events this one reacts to
Tells (5): 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
-
Book a time window at a dock door
A carrier books a window at a door. It is refused if the door is closed or out of hours, the ASNs are unknown or already booked, the carrier is suspended, or another booking overlaps.
ActorCarrier schedulerRead modelDoors kept from facility-layoutRead modelASN copyRead modelCut-off scheduleRead modelDoor calendar and carrier registryCommandBookAppointment POST /appointmentsAggregateDockAppointment EventDockAppointment Booked Systemyard-management PolicyKeeps a copy of the booking so the gate can match the arriving truckSystemwarehouse-planning PolicyAdds the booking to its view of expected inbound demandSysteminbound-receiving PolicyKeeps a copy of inbound bookingsSystemoutbound-shipping PolicyFor an outbound booking with a cut-off, assigns the door to that loadSource: application/usecases/book.go · domain/dockappointment/appointment.go · domain/dockappointment/schedule.go
-
Move a booking to another window or door
A carrier moves a booked appointment to a new window, or to another door. The same checks as a new booking apply. The event keeps the previous window and door.
ActorCarrier schedulerRead modelDoors kept from facility-layoutRead modelDoor calendar and carrier registryCommandRescheduleAppointment POST /appointments/{appointmentId}/reschedulesAggregateDockAppointment EventDockAppointment Rescheduled Systemyard-management PolicyUpdates its copy; frees held yard moves if the door changedSystemwarehouse-planning PolicyMoves the booking in its expected inbound demandSysteminbound-receiving PolicyUpdates the window and door in its copySource: application/usecases/book.go · domain/dockappointment/appointment.go · domain/dockappointment/events.go
-
Cancel a booking
The carrier or the dock planner cancels a booked or checked-in appointment with a reason. The door window is freed.
ActorCarrier or dock plannerCommandCancelAppointment POST /appointments/{appointmentId}/cancellationsAggregateDockAppointment EventDockAppointment Cancelled Systemyard-management PolicyMarks it cancelled in its copy and frees held yard movesSystemwarehouse-planning PolicyRecords the cancellation in its expected inbound demandSysteminbound-receiving PolicyMarks it cancelled in its copySource: application/usecases/change.go · domain/dockappointment/appointment.go
-
Report that a truck will be late
A carrier reports when the truck will arrive. If that is later than the window plus the site's tolerance, the booking is flagged at risk. An ETA inside the tolerance clears an earlier flag.
ActorCarrier schedulerCommandReportEta POST /appointments/{appointmentId}/eta-reportsAggregateDockAppointment EventDockAppointment analytics stream onlyAt Risk Source: application/usecases/change.go · domain/dockappointment/appointment.go · domain/dockappointment/types.go
-
Cancel when every ASN of a booking is cancelled
inbound-receiving announces that an ASN was cancelled. The ASN is marked cancelled in the local copy, and a booked inbound appointment whose ASNs are all cancelled is cancelled too.
Systeminbound-receiving EventASNCancelledPolicyWhenever the last ASN of a booked inbound appointment is cancelled, cancel the appointmentCommandCancelAppointment started by the policyAggregateDockAppointment EventDockAppointment Cancelled Read model · kept up to dateASN copySystemyard-management PolicyMarks it cancelled in its copy and frees held yard movesSystemwarehouse-planning PolicyRecords the cancellation in its expected inbound demandSysteminbound-receiving PolicyMarks it cancelled in its copySource: application/usecases/facts.go · adapters/inbound/kafka/asn_consumer.go · application/usecases/change.go
-
Cancel when the gate turns a truck away
The yard refuses a visit at the gate. If its appointment is still booked, it is cancelled with the reason 'turned away'. Any other state is ignored and counted.
Systemyard-management EventVisitRejected PolicyWhenever the gate turns a visit away, cancel its booked appointmentCommandCancelAppointment started by the policyAggregateDockAppointment EventDockAppointment Cancelled Systemyard-management PolicyMarks it cancelled in its copy and frees held yard movesSystemwarehouse-planning PolicyRecords the cancellation in its expected inbound demandSysteminbound-receiving PolicyMarks it cancelled in its copySource: application/usecases/facts.go · adapters/inbound/kafka/yard_consumer.go · ddd/eventstorming.md
-
Note that the truck is at the gate
The yard checks a truck in against a booking. The appointment becomes checked in and records whether the truck was early, on time or late.
Systemyard-management EventVisitChecked In PolicyWhenever a visit checks in against a booked appointment, record the arrival as early, on time or lateCommandRecordArrival started by the policyAggregateDockAppointment EventDockAppointment analytics stream onlyChecked In Source: application/usecases/facts.go · adapters/inbound/kafka/yard_consumer.go · domain/dockappointment/commands.go
-
Follow the truck to the door it really used
If a trailer docks at a different door than the booked one, the real door wins and the booking moves there, even over another booking. Bookings it now overlaps are flagged at risk.
Systemyard-management EventTrailerDocked PolicyWhenever a trailer docks at another door than booked, the actual door winsCommandReassignDoor started by the policyAggregateDockAppointment EventDockAppointment Door Reassigned EventDockAppointment analytics stream onlyAt Risk Systeminbound-receiving PolicyUpdates the appointment's door in its copy, so a receipt records the right doorSource: application/usecases/yard.go · domain/dockappointment/appointment.go · 0010-door-reassigned-is-an-integration-event.md
-
Close the booking when the trailer leaves the door
When the yard reports the trailer undocked, the appointment is completed. If this news arrives before the gate check-in, the arrival is recorded as implicit.
Systemyard-management EventTrailerUndocked PolicyWhenever a trailer leaves its door, complete the appointment it came forCommandRecordDoor started by the policyRelease AggregateDockAppointment EventDockAppointment analytics stream onlyCompleted Source: application/usecases/facts.go · adapters/inbound/kafka/yard_consumer.go · domain/dockappointment/appointment.go
-
Sweep for carriers that never came
A scheduler calls the sweep. Every booked appointment whose window plus the site's grace period has passed becomes a no-show. A no-show is final: a late carrier has to book again.
TimeScheduler cronPolicyEvery sweep, mark each booked appointment whose window and grace have passed as a no-showCommandRunNo POST /no-show-sweepsShow Sweep AggregateDockAppointment EventDockAppointment No Show Systemyard-management PolicyMarks it a no-show in its copy and frees held yard movesSystemwarehouse-planning PolicyRecords the no-show in its expected inbound demandSystemexception-management PolicyOpens an exception case for the no-show, or updates the open oneSource: application/usecases/change.go · domain/dockappointment/appointment.go · ddd/eventstorming.md
-
Declare when a site's doors operate
A dock planner sets the operating hours of a site's doors. New hours that would strand an active appointment are refused.
ActorDock plannerCommandDeclareOperating PUT /sites/{siteId}/dock-calendar/operating-hoursHours AggregateDockCalendar EventDoorOperating analytics stream onlyHours Declared Source: application/usecases/calendar.go · domain/dockcalendar/calendar.go · domain/dockcalendar/hours.go
-
Close a door for a while
A dock planner closes a door for a period, for example for repairs. It is refused if it overlaps another closure or covers an active appointment.
ActorDock plannerCommandScheduleDoor POST /sites/{siteId}/dock-calendar/closuresClosure AggregateDockCalendar EventDoorClosure Scheduled Systemyard-management PolicyKeeps the closure in its copySource: application/usecases/calendar.go · domain/dockcalendar/calendar.go
-
Reopen a closed door
A dock planner lifts a scheduled closure early, and the door can be booked again.
ActorDock plannerCommandLiftDoor POST /sites/{siteId}/dock-calendar/closures/{closureId}/liftsClosure AggregateDockCalendar EventDoorClosure Lifted Systemyard-management PolicyRemoves the closure from its copySource: application/usecases/calendar.go · domain/dockcalendar/calendar.go
-
Add a carrier to the registry
A planner records a carrier under its SCAC code. The registry is optional: a carrier that is not in it can still book. Changing its details later raises the same event again.
ActorDock plannerCommandRegisterCarrier PUT /carriers/{scac}AggregateCarrierEventCarrierRegistered Systemyard-management PolicyKeeps a copy of the carrier registrySource: application/usecases/carriers.go · domain/carrier/carrier.go · 0012-carrier-registry.md
-
Suspend a carrier
A planner suspends a carrier. Bookings and moves that name it are refused until it is reinstated. Appointments it already has stay as they are.
ActorDock plannerCommandSuspendCarrier POST /carriers/{scac}/suspensionsAggregateCarrierEventCarrierSuspended Systemyard-management PolicyKeeps the carrier's suspended status in its copySource: application/usecases/carriers.go · domain/carrier/carrier.go · 0012-carrier-registry.md
-
Reinstate a suspended carrier
A planner lets a suspended carrier book again.
ActorDock plannerCommandReinstateCarrier POST /carriers/{scac}/reinstatementsAggregateCarrierEventCarrierReinstated Systemyard-management PolicyKeeps the carrier's active status in its copySource: application/usecases/carriers.go · domain/carrier/carrier.go · 0012-carrier-registry.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 spotPickups from cut-offs are not built. The cut-off schedule is stored, but no outbound appointment is created, and the door rule and lead time are undefined.
- Hot spotA retired door blocks new bookings only. Appointments already on it are left untouched.
- Hot spotAppointment facts do not yet say whether an agent made the change. Only carrier facts carry that attribution so far.
Source: adr/0012-carrier-registry.md
- Hot spotThe carrier registry is opt-in: a carrier that was never registered can still book. Only a suspended one is refused.
Source: adr/0012-carrier-registry.md
Opportunities
- OpportunityA strict mode, where a named carrier must be registered to book, is a future per-site setting. It needs the registry populated first.
Source: adr/0012-carrier-registry.md
- OpportunityA carrier-connectivity context could translate these facts into partner formats. The ADR leaves that decision pending with the owner.
This board is a reconstruction from the code and documentation of dock-scheduling at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.