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.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
14
commands
14
policies
31
read models
4
hot spots
4

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
  1. 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 scheduler
    Read modelDoors kept from facility-layout
    Read modelASN copy
    Read modelCut-off schedule
    Read modelDoor calendar and carrier registry
    CommandBookAppointmentPOST /appointments
    AggregateDockAppointment
    EventDockAppointmentBooked
    Systemyard-management
    PolicyKeeps a copy of the booking so the gate can match the arriving truck
    Systemwarehouse-planning
    PolicyAdds the booking to its view of expected inbound demand
    Systeminbound-receiving
    PolicyKeeps a copy of inbound bookings
    Systemoutbound-shipping
    PolicyFor an outbound booking with a cut-off, assigns the door to that load

    Source: application/usecases/book.go · domain/dockappointment/appointment.go · domain/dockappointment/schedule.go

  2. 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 scheduler
    Read modelDoors kept from facility-layout
    Read modelDoor calendar and carrier registry
    CommandRescheduleAppointmentPOST /appointments/{appointmentId}/reschedules
    AggregateDockAppointment
    EventDockAppointmentRescheduled
    Systemyard-management
    PolicyUpdates its copy; frees held yard moves if the door changed
    Systemwarehouse-planning
    PolicyMoves the booking in its expected inbound demand
    Systeminbound-receiving
    PolicyUpdates the window and door in its copy

    Source: application/usecases/book.go · domain/dockappointment/appointment.go · domain/dockappointment/events.go

  3. 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 planner
    CommandCancelAppointmentPOST /appointments/{appointmentId}/cancellations
    AggregateDockAppointment
    EventDockAppointmentCancelled
    Systemyard-management
    PolicyMarks it cancelled in its copy and frees held yard moves
    Systemwarehouse-planning
    PolicyRecords the cancellation in its expected inbound demand
    Systeminbound-receiving
    PolicyMarks it cancelled in its copy

    Source: application/usecases/change.go · domain/dockappointment/appointment.go

  4. 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 scheduler
    CommandReportEtaPOST /appointments/{appointmentId}/eta-reports
    AggregateDockAppointment
    EventDockAppointmentAtRiskanalytics stream only

    Source: application/usecases/change.go · domain/dockappointment/appointment.go · domain/dockappointment/types.go

  5. 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
    EventASNCancelled
    PolicyWhenever the last ASN of a booked inbound appointment is cancelled, cancel the appointment
    CommandCancelAppointmentstarted by the policy
    AggregateDockAppointment
    EventDockAppointmentCancelled
    Read model · kept up to dateASN copy
    Systemyard-management
    PolicyMarks it cancelled in its copy and frees held yard moves
    Systemwarehouse-planning
    PolicyRecords the cancellation in its expected inbound demand
    Systeminbound-receiving
    PolicyMarks it cancelled in its copy

    Source: application/usecases/facts.go · adapters/inbound/kafka/asn_consumer.go · application/usecases/change.go

  6. 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 appointment
    CommandCancelAppointmentstarted by the policy
    AggregateDockAppointment
    EventDockAppointmentCancelled
    Systemyard-management
    PolicyMarks it cancelled in its copy and frees held yard moves
    Systemwarehouse-planning
    PolicyRecords the cancellation in its expected inbound demand
    Systeminbound-receiving
    PolicyMarks it cancelled in its copy

    Source: application/usecases/facts.go · adapters/inbound/kafka/yard_consumer.go · ddd/eventstorming.md

  7. 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
    EventVisitCheckedIn
    PolicyWhenever a visit checks in against a booked appointment, record the arrival as early, on time or late
    CommandRecordArrivalstarted by the policy
    AggregateDockAppointment
    EventDockAppointmentCheckedInanalytics stream only

    Source: application/usecases/facts.go · adapters/inbound/kafka/yard_consumer.go · domain/dockappointment/commands.go

  8. 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 wins
    CommandReassignDoorstarted by the policy
    AggregateDockAppointment
    EventDockAppointmentDoorReassigned
    EventDockAppointmentAtRiskanalytics stream only
    Systeminbound-receiving
    PolicyUpdates the appointment's door in its copy, so a receipt records the right door

    Source: application/usecases/yard.go · domain/dockappointment/appointment.go · 0010-door-reassigned-is-an-integration-event.md

  9. 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 for
    CommandRecordDoorReleasestarted by the policy
    AggregateDockAppointment
    EventDockAppointmentCompletedanalytics stream only

    Source: application/usecases/facts.go · adapters/inbound/kafka/yard_consumer.go · domain/dockappointment/appointment.go

  10. 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 cron
    PolicyEvery sweep, mark each booked appointment whose window and grace have passed as a no-show
    CommandRunNoShowSweepPOST /no-show-sweeps
    AggregateDockAppointment
    EventDockAppointmentNoShow
    Systemyard-management
    PolicyMarks it a no-show in its copy and frees held yard moves
    Systemwarehouse-planning
    PolicyRecords the no-show in its expected inbound demand
    Systemexception-management
    PolicyOpens an exception case for the no-show, or updates the open one

    Source: application/usecases/change.go · domain/dockappointment/appointment.go · ddd/eventstorming.md

  11. 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 planner
    CommandDeclareOperatingHoursPUT /sites/{siteId}/dock-calendar/operating-hours
    AggregateDockCalendar
    EventDoorOperatingHoursDeclaredanalytics stream only

    Source: application/usecases/calendar.go · domain/dockcalendar/calendar.go · domain/dockcalendar/hours.go

  12. 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 planner
    CommandScheduleDoorClosurePOST /sites/{siteId}/dock-calendar/closures
    AggregateDockCalendar
    EventDoorClosureScheduled
    Systemyard-management
    PolicyKeeps the closure in its copy

    Source: application/usecases/calendar.go · domain/dockcalendar/calendar.go

  13. Reopen a closed door

    A dock planner lifts a scheduled closure early, and the door can be booked again.

    ActorDock planner
    CommandLiftDoorClosurePOST /sites/{siteId}/dock-calendar/closures/{closureId}/lifts
    AggregateDockCalendar
    EventDoorClosureLifted
    Systemyard-management
    PolicyRemoves the closure from its copy

    Source: application/usecases/calendar.go · domain/dockcalendar/calendar.go

  14. 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 planner
    CommandRegisterCarrierPUT /carriers/{scac}
    AggregateCarrier
    EventCarrierRegistered
    Systemyard-management
    PolicyKeeps a copy of the carrier registry

    Source: application/usecases/carriers.go · domain/carrier/carrier.go · 0012-carrier-registry.md

  15. 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 planner
    CommandSuspendCarrierPOST /carriers/{scac}/suspensions
    AggregateCarrier
    EventCarrierSuspended
    Systemyard-management
    PolicyKeeps the carrier's suspended status in its copy

    Source: application/usecases/carriers.go · domain/carrier/carrier.go · 0012-carrier-registry.md

  16. Reinstate a suspended carrier

    A planner lets a suspended carrier book again.

    ActorDock planner
    CommandReinstateCarrierPOST /carriers/{scac}/reinstatements
    AggregateCarrier
    EventCarrierReinstated
    Systemyard-management
    PolicyKeeps the carrier's active status in its copy

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

Opportunities

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.