Retail network · Core domain · EventStorming board
delivery-promise
Quotes delivery windows per speed tier, promises one to each shipment group, holds capacity for it, re-promises when the route breaks, then judges kept or broken.
- events published
- 13
- commands
- 16
- policies
- 20
- read models
- 13
- hot spots
- 5
The story in 6 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventPromise
Made - Pivotal eventPromise
Confirmed - Pivotal eventPromise
At Risk - Pivotal eventPromise
Revised - Pivotal eventPromise
Kept - Pivotal eventPromise
Broken
Listens to (8): contexts whose events this one reacts to
Tells (3): contexts that react to its events
The board, row by row
17 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
-
Quote delivery options for a destination
A shopper sees what each shipment group can get, per speed tier, with a delivery window. A tier with no feasible route gets no offer, only the reason. The quote calls no other service.
ActorShopperRead modelNode, lane, departure and wave copiesRead modelStock per listing, net of promisesRead modelNode grades and tier eligibilityRead modelCurrent promise policyCommandQuoteDelivery POST /delivery-quotesOffers AggregateOfferEventDeliveryOffer analytics stream onlyQuoted Source: application/usecases/quote.go · domain/offer/offer.go · domain/search/search.go
-
Count each delivery question answered
After a quote or a listing-page estimate is answered, one small fact is noted: region, item count and the shortest promised days. It never slows the reply, is off by default, and a lost fact is only counted.
ActorShopperPolicyWhenever a quote or estimate is answered, note one fact after the reply is sentCommandRecordQuote / Record started by the policyEstimate AggregateFactEventDeliveryRequest analytics stream onlyAnswered Source: 0032-request-level-promise-coverage-from-a-best-effort-fact.md · application/requestfacts/recorder.go · domain/requestfact/requestfact.go · adapters/inbound/http/request_facts.go
-
Promise a shipment group
At checkout a quoted offer becomes a provisional promise and holds one order of room on the node's pickup cutoff. The route is re-checked first; a route no longer feasible is refused as full.
ActorShopperRead modelQuoted offerRead modelCurrent promise policyCommandMakePromise POST /promisesAggregatePromiseEventPromiseMade analytics stream onlySource: application/usecases/make_promise.go · domain/promise/promise.go · domain/book/book.go
-
A pickup book fills up
When a hold uses the last room before a node's pickup cutoff, the book announces it is exhausted. Later quotes find no room there.
Event · earlierPromiseMade PolicyWhenever a hold fills a pickup book, announce that the book is exhaustedCommandHoldstarted by the policyAggregateBookEventPromiseBook Exhausted Systemorder-sourcing PolicyKeeps it as book pressure, a penalty when scoring pathsSource: application/usecases/make_promise.go · domain/book/book.go · domain/book/events.go
-
Confirm the promise when the order is placed
Checkout confirms each promise once the order is placed. The hold becomes a confirmed reservation. Confirming twice changes nothing.
ActorShopperCommandConfirmPromise POST /promises/{promiseId}/confirmationsAggregatePromiseEventPromiseConfirmed analytics stream onlySource: application/usecases/lifecycle.go · domain/promise/promise_transitions.go
-
Catch a confirmation that checkout missed
Normally checkout has confirmed already and nothing happens. A promise still provisional inside its hold is confirmed. If the hold has lapsed, it is only logged, never retried.
Systemcustomer-ordering EventCustomerOrder Placed PolicyWhenever an order is placed, confirm its promises that are still provisionalCommandConfirmPromise started by the policyAggregatePromiseEventPromiseConfirmed analytics stream onlySource: application/usecases/projections_fulfillment.go · adapters/inbound/kafka/dispatch.go · ddd/eventstorming.md
-
Cancel promises when an order is cancelled
The cancelled groups' confirmed and at-risk promises are cancelled and their room goes back to the book. The same rule runs when an operator cancels one promise by hand.
Systemcustomer-ordering EventCustomerOrder Cancelled PolicyWhenever an order is cancelled, cancel the promises of its cancelled groupsCommandCancelPromise started by the policyAggregatePromiseEventPromiseCancelled analytics stream onlySource: application/usecases/lifecycle.go · application/usecases/projections_fulfillment.go · domain/promise/promise_transitions.go
-
Release a hold nobody confirmed
A provisional promise that was not confirmed in time is released and its room returns to the book.
TimeSweeperPolicyEvery sweep, release provisional promises whose hold has lapsedCommandReleaseExpired started by the clockHolds AggregatePromiseEventPromiseReleased analytics stream onlySource: application/usecases/lifecycle_sweeps.go · cmd/api/workers.go · domain/promise/promise_transitions.go
-
Publish a new promise policy
An operator publishes the next version of the promise rules: offer and hold lifetimes, capacity share, order deadlines per tier. A published version never changes.
ActorOperatorCommandPublishPromise POST /promise-policiesPolicy AggregatePolicyEventPromisePolicy analytics stream onlyPublished Source: application/usecases/lifecycle.go · domain/policy/policy.go · domain/policy/events.go
-
Keep the node profile copy
Opening hours, handling time, pickup cutoffs and the throughput cap decide when a node can ship. Node status, lanes, service areas and regions are kept the same way, so quoting never calls out.
Systemnode-topology EventNodeOperational Profile Declared PolicyWhenever a node declares a profile revision, keep it if it is newer than the one heldCommandOnNode started by the policyProfile Declared Read model · kept up to dateNode profilesSource: application/usecases/projections.go · adapters/inbound/kafka/dispatch.go
-
Keep the stock copy
Quotes sell each owner's declared quantity minus units already promised that the figure may not include yet. Hidden listings and discontinued items ship nothing.
Systemoffer-availability EventListingAvailability Changed PolicyWhenever a listing's quantity changes, keep it unless it is older than the one heldCommandOnListing started by the policyAvailability Changed Read model · kept up to dateStock per listingSource: application/usecases/projections.go · application/usecases/availability.go · 0017-owner-aware-availability-and-promise-netting.md
-
Keep the timetable copy
A promise needs a pickup and legs with room. Departures are kept with their remaining room; delivery waves from last-mile-delivery are kept the same way.
Systemlinehaul-transportation EventDepartureScheduled PolicyWhenever a departure is scheduled, keep it with its remaining roomCommandOnDeparture started by the policyScheduled Read model · kept up to dateDepartures and their roomSource: application/usecases/projections_transport.go · adapters/inbound/kafka/dispatch.go
-
Learn how long lanes really take
A lane that runs late is quoted from what it really takes. The arrival also tells the late-risk check that the leg is done.
Systemlinehaul-transportation EventLoadArrived PolicyWhenever a load arrives, pair it with its departure to measure the transit timeCommandOnLoad started by the policyArrived Read model · kept up to dateMeasured transit timesRead model · kept up to dateDeparture arrivalsSource: application/usecases/projections_transport.go · 0014-measured-transit-basis.md
-
Flag promises on a cancelled departure
Every confirmed promise whose route uses the cancelled departure is flagged at risk. Cancelled waves, failed or moved bookings, package exceptions, deferred induction and unsourceable groups flag the same way.
Systemlinehaul-transportation EventDepartureCancelled PolicyWhenever a departure is cancelled, flag the confirmed promises that ride on itCommandFlagAt started by the policyRisk AggregatePromiseEventPromiseAt Risk Read model · kept up to dateDepartures and their roomSystemcustomer-ordering PolicyRecords the reason in the order's tracking viewSource: application/usecases/projections_transport.go · application/usecases/risk.go · domain/promise/promise_transitions.go
-
Spot routes that are running late
A sweep checks confirmed promises: if a departure on the route is past its expected arrival, the promise is flagged at risk before the customer is let down. The flag is never cleared if the load arrives later.
TimeSweeperPolicyEvery sweep, flag confirmed promises whose route has a departure running lateRead modelDeparture arrivalsRead modelMeasured transit timesCommandFlagPredicted started by the clockLate AggregatePromiseEventPromiseAt Risk Systemcustomer-ordering PolicyRecords the reason in the order's tracking viewSource: application/usecases/late_risk.go · 0021-a-sweep-flags-promises-whose-locked-path-is-running-late.md
-
Re-promise a later date, or give up
The promise searches again for the same group, at its tier or slower, and moves later only. When nothing works it says so once, and the sweep keeps retrying.
Event · earlierPromiseAt Risk PolicyWhenever a promise is at risk, search again and move it later if any route worksCommandReviseAt started by the policyRisk AggregatePromiseEventPromiseRevised EventPromiseUnkeepable Systemcustomer-ordering PolicyShows the new window, or cancels the group if unkeepableSystemorder-sourcing PolicyApplies the new window to the assignmentSource: application/usecases/risk.go · domain/promise/promise_transitions.go
-
Judge the promise: kept or broken
Once the lock, the shipped packages and the deliveries are all known, the group is judged. On time is kept. Late, or a package lost or returned, is broken.
Systemshipping-and- tracking EventPackageDelivered PolicyWhenever the last package is delivered, or one is lost or returned, judge the groupRead modelLocked assignmentRead modelShipped packagesCommandJudgestarted by the policyAggregatePromiseEventPromiseKept EventPromiseBroken Read model · kept up to datePackage outcomesSystemcustomer-ordering PolicyRecords the verdict and minutes late in the tracking viewSystemnode-performance PolicyRecords the outcome against the node's scoreSource: application/usecases/judge.go · application/usecases/projections_fulfillment.go · domain/promise/promise_transitions.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 stale departure or wave copy can still be quoted. It is only refused when the promise is made, as a full book.
Source: docs/ddd/eventstorming.md
- Hot spotAn order placed after its hold lapsed leaves a dead promise. The follow-up consumer only logs it and never retries.
Source: docs/ddd/eventstorming.md
- Hot spotA promise flagged as running late stays at risk even if the load arrives after all. Only the judgement closes it.
Source: adr/0021-a-sweep-flags-promises-whose-locked-path-is-running-late.md
- Hot spotA lock on a full book keeps the capacity charge on the wrong node and only logs a warning. A metric is a follow-up.
- Hot spotAn unkeepable promise stays at risk and is retried every sweep. It ends only when customer-ordering cancels the group.
Opportunities
- OpportunityMeasured-transit stretching could be widened to cover sort dwell and the last-mile wave. Deferred follow-up.
Source: adr/0020-promise-calibration-from-the-services-own-judgement.md
- OpportunityThe reservation lag, now a constant, could become a promise policy field if operators need to tune it.
- OpportunityThe consolidated-tier limits could become promise policy fields.
Source: adr/0024-an-opt-in-consolidated-tier-with-a-customer-chosen-delivery-day.md
This board is a reconstruction from the code and documentation of delivery-promise at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.