EventStorming
Built on develop (merged 2026-11-08) in IQVO/dock-scheduling, released at v0.1.3 (first release v0.1.0 on 2026-11-09; applied to the k3s cluster on 2026-11-10 at v0.1.2 in a reduced footprint, and the image pinned to the v0.1.3 commit a1a029c in warehouse-infra since 2026-11-16, checked 2026-12-02): dock-scheduling runs its API only (it relays inline); yard-management runs its API and relay. The MCP server (18 tools on develop 096db0a, 14 in v0.1.3) is registered in warehouse-infra but switched off until the cluster has room; the A2A agent (two skills) is built on develop (2026-12-02), not released and not deployed (the chart carries it off by default and warehouse-infra has no a2a block); the analytics projectors, report services and sweeps are registered but switched off, so the KPI reports of yard-management ADR 0011 are released, not yet served. The page still derives from yard/model/model.yaml; where the as-built service differs, the model and this page say so (see the as-built notes).
Process-level EventStorming in the ddd-crew
EventStorming glossary & cheat sheet
notation. Every sticky comes from model.yaml. Hotspots were the genuine open
questions or risks in the model when this pack was written; the source of each is in the
hotspot table, whose last column says how the built service settled it. The boards
keep the hotspot stickies as they were drawn.
Legend
| Colour | Sticky | Hex |
|---|---|---|
| Blue | Command | #a5d8ff |
| Yellow | Aggregate | #ffec99 |
| Orange | Domain Event | #ffc078 |
| Lilac | Policy | #d0bfff |
| Green | Read Model | #b2f2bb |
| Pink | External System (a sibling context or an actor) | #fcc2d7 |
| Red | Hotspot | #ff8787 |
1. Booking, rescheduling and cancelling
Derived from: model.yaml → contexts[dock-scheduling].aggregates[DockAppointment],
.read_models, .inbound, .publishes[*].consumers.
Omitted: the refusals (ErrInvalidDoorCode, ErrInvalidCarrier,
ErrInvalidWindow, ErrWindowInPast, ErrUnknownDoor,
ErrDoorFlowMismatch, ErrDoorDoubleBooked, ErrDoorUnavailable,
ErrUnknownAsn, ErrMissingOutboundRef). DockAppointmentCancelled also
reaches inbound-receiving; DockAppointmentRescheduled does not.
2. Arrival at the gate and a different door
Derived from: model.yaml → contexts[dock-scheduling].policies[ArrivalFromGate, ActualDoorWins],
.aggregates[DockAppointment], .publishes.
Omitted: DockAppointmentCheckedIn and AtRisk are analytics only; no context reacts to them.
DoorReassigned is also on the integration topic since service ADR 0010 (inbound-receiving
reads it). E5 is raised for the
overlapped appointment, with cause DOOR_REASSIGNED_OVERLAP.
3. Door release and out-of-order yard facts
Derived from: model.yaml → contexts[dock-scheduling].policies[CompleteOnDoorRelease, OutOfOrderYardFacts],
.aggregates[DockAppointment], .publishes[DockAppointmentCompleted].
Omitted: DockAppointmentCompleted is analytics only.
OutOfOrderYardFacts is drawn into RecordDoorRelease because it defines
the BOOKED to COMPLETED path; it also says a late VisitCheckedIn for a
COMPLETED appointment is ignored and that any yard fact for a CANCELLED
or NO_SHOW appointment is ignored and counted.
4. ETA risk and no-show
Derived from: model.yaml → contexts[dock-scheduling].policies[EtaRisk, NoShowSweep],
.aggregates[DockAppointment], .publishes[*].consumers.
Omitted: DockAppointmentNoShow also triggers NoShowFreesHolding in
yard-management, drawn in
Domain Message Flow.
5. ASN cancellation
Derived from: model.yaml → contexts[dock-scheduling].policies[CancelWhenAllAsnsCancelled],
.read_models[AsnView], .reasons[CancellationReason], .publishes[DockAppointmentCancelled].
Omitted: only an INBOUND BOOKED appointment whose ASNs are all
cancelled is cancelled by the policy; the reason is ASN_CANCELLED.
6. The door calendar
Derived from: model.yaml → contexts[dock-scheduling].aggregates[DockCalendar],
.read_models[DoorView], .publishes, .consumes.
Omitted: ErrInvalidOperatingHours, ErrOverlappingClosure and
ErrClosureConflictsWithAppointments refusals. DeclareCalendarSettings
raises no event; DoorOperatingHoursDeclared is analytics only.
7. Phase-2 pickups
Derived from: model.yaml → contexts[dock-scheduling].policies[PickupFromCutoffs],
.consumes, .read_models[CutoffView].
Omitted: the dotted arrow from PickupFromCutoffs is the policy keeping one
OUTBOUND appointment per cutoff and operating day; the model names no
command for it, and as built it does not exist: the schedule is stored and no appointment is
created from it. The strangler import that this board once showed (policy LegacyImport, hotspot H11) was removed in dock-scheduling ADR 0011.
Hotspots
| # | Hotspot | Where it comes from in the model | Gap | As built (2026-11-09) |
|---|---|---|---|---|
| H1 | CancellationReason has SITE_REQUEST, but the only inbound row for cancel is the carrier scheduler. | aggregates[DockAppointment], reasons[CancellationReason], inbound[0] | DS-G10 | Settled (D-5): the dock planner cancels with CARRIER_REQUEST or SITE_REQUEST through the same route. |
| H2 | DockAppointmentRescheduled carries door_code but no previous door; the model does not say a reschedule may change the door. | publishes[DockAppointmentRescheduled].data | DS-G06 | Settled (D-4, X1): a reschedule may change the door; the event carries previous_door_code. |
| H3 | An appointment is one carrier visit, but VisitCheckedIn carries trailers, and the first TrailerUndocked completes the appointment. | policies[CompleteOnDoorRelease], contexts[yard-management].publishes[VisitCheckedIn] | DS-G03 | Settled (X3): one appointment covers exactly one trailer. |
| H4 | The arrival tolerance is a DockCalendar setting; yard-management's DirectOnCheckIn needs it and no event carries it. | aggregates[DockCalendar].value_objects, contexts[yard-management].policies[DirectOnCheckIn] | DS-G01 | Settled (X1): Booked and Rescheduled carry arrival_tolerance_minutes. |
| H5 | The out-of-order rules cover four cases; a second VisitCheckedIn, a TrailerDocked after completion and an implicit arrival in the adherence report are not covered. | policies[OutOfOrderYardFacts, ArrivalFromGate] | DS-G19 | Settled: the state machine decides; an already applied or terminal fact is ignored and counted, an implicit arrival is counted as ON_TIME (X6). |
| H6 | DockAppointmentAtRisk is analytics only and no read model or route exposes it, yet the console and the ops agent are meant to show at-risk appointments. | publishes[DockAppointmentAtRisk], fleet_changes | DS-G11 | Settled (D-6): the REST appointment exposes atRisk and atRiskCause, GET /appointments filters on atRisk and the MCP tool list_at_risk_appointments lists them. |
| H7 | NO_SHOW has no outgoing transition; a carrier that arrives after the sweep is ignored by this context. | aggregates[DockAppointment].transitions, policies[OutOfOrderYardFacts] | DS-G16 | Settled (D-9): terminal, a late carrier books anew. |
| H8 | TURNED_AWAY has no producer, and VisitRejected is not consumed here. | reasons[CancellationReason], consumes, contexts[yard-management].publishes[VisitRejected] | DS-G02 | Settled (X2): VisitRejected is consumed (policy CancelOnVisitRejected), TURNED_AWAY is its cancellation reason. |
| H9 | A closure is refused if it covers an active appointment; a change of operating hours and a decommissioned door are not. | aggregates[DockCalendar].invariants, consumes[facility-layout] | DS-G12, DS-G13 | Settled: new hours that strand an appointment are refused (D-8); a decommissioned door blocks new bookings only (D-7). |
| H10 | DeclareCalendarSettings raises no event, and no default is given for the arrival tolerance or the no-show grace. | aggregates[DockCalendar], publishes | DS-G07, DS-G01 | Settled (D-1): defaults 240, 15, 15 and 60 minutes, created lazily; the tolerance travels on the booking events. |
| H11 | ImportLegacyAppointment lists no invariants, and the effect of the legacy check-in, cancel and complete events is not stated. | policies[LegacyImport], consumes[inbound-receiving] | DS-G08 | Settled (D-2): no invariant is enforced; later legacy events move only legacy-import appointments. Moot since dock-scheduling ADR 0011: the importer was removed. |
| H12 | PickupFromCutoffs names PickupDoorRule and pickup_lead, defined nowhere, and creates an appointment with no carrier. | policies[PickupFromCutoffs], aggregates[DockAppointment].invariants | DS-G04 | Open by decision (D-3): phase 2. The schedule is consumed and stored; no appointment is created. |