EventStorming
A design-level storm following the EventStorming glossary: orange events, blue commands, lilac policies, yellow aggregates, pink external systems, red hotspots. Chronology runs left to right; the diagram is read as "command, aggregate, event, policy, next command".
Source: internal/domain/departure/events.go, internal/domain/load/events.go, internal/domain/volume/events.go, internal/application/usecases/*.go (policy names in the comments of generate.go, consumers.go).
Timeline in words
- Network is shaped (external): node-topology registers nodes, declares profiles with cutoffs, activates vendor fulfillment centres and opens lanes.
- Policy
PickupFromCutoffs: every cutoff of a pickup-eligible node gets a PICKUP departure for the horizon, and stale unbooked ones are cancelled when the profile changes. - Planner defines a lane schedule; policy
HorizonRollturns its slots into LINEHAUL or AIR departures everyGENERATE_INTERVAL.DepartureScheduledis the first event other contexts see. - Order-sourcing locks an assignment; policy
BookOnLockbooks one package, or moves the booking, or fails it. - A departure may be cancelled by the planner or by a node leaving service: its bookings are rebooked.
- Operators build the load: open, add packages, close (the departure closes with it), dispatch (departure leaves), receive (departure arrives).
Hotspots
| Hotspot | State |
|---|---|
BookingFailed leaves the assignment FAILED in this context (ADR 0002 A14). order-sourcing records it as processed and changes no state (its handler: the departure's own cancellation or capacity events drive re-optimisation); delivery-promise flags the assignment's promise AT_RISK and skips that departure when re-promising (RepromiseOnRisk) | open for the booking itself; the promise side is handled |
FulfillmentCancelled only updates the expected volume (ADR 0002 A16): it never releases the package booked on a departure | accepted assumption |
A LabelVoided removes the tracking number but keeps the booking (A18) | accepted assumption |
| Outbox backlog, consumer lag and dead letters are not metered | open, see Observability |
A row past OUTBOX_MAX_ATTEMPTS lets later events of the same aggregate overtake it | accepted, see Runbook |