Skip to main content

EventStorming

As built

Derived from network/model/model.yaml. This context's service is built; the model carries its as-built contracts, and identifiers (Err... names, routes, CloudEvents types) are the names the service uses.

Process-level boards in the ddd-crew EventStorming glossary & cheat sheet notation. Every sticky comes from model.yaml. Events published by a neighbour are drawn as orange stickies prefixed with the producer. Every hotspot is a gap or a risk the model itself shows, and its source is given in the hotspot table. The big-picture board for the whole network is EventStorming big picture. Boards 1 and 3 are drawn top to bottom and board 2 is split in two, because left to right they would not fit the page width.

Legend​

ColourStickyMeaning here
Pale yellow #fff59dActorThe shopper (via the storefront, the e2e-tests or the console remote)
Blue #a5d8ffCommandA command from aggregates[*].commands or a sync call from sync_calls
Yellow #ffec99AggregateCustomerOrder or Shopper
Orange #ffc078Domain EventOurs (publishes) or a neighbour's (consumes, prefixed with the producer)
Lilac #d0bfffPolicypolicies, or the reaction a command takes to an event
Green #b2f2bbRead ModelOrderTrackingView, or the restricted ship-to read
Pink #fcc2d7External SystemA sibling context
Red #ff8787HotspotA gap or risk in the model (see the table at the end)

1. Checkout and shopper registration​

Derived from: model.yaml → contexts[customer-ordering].aggregates[*].commands, .sync_calls, .policies[CheckoutPromising], .publishes[CustomerOrderPlaced]; contexts[delivery-promise].aggregates[DeliveryOffer, Promise]; contexts[order-sourcing].aggregates[FulfillmentAssignment].commands.

Omitted: the invariant checks inside PlaceOrder (ErrLineWithoutPromise, ErrPromiseDestinationMismatch), the 409 answers from delivery-promise (ErrOfferNotQuotable, ErrPromiseCapacityExhausted, ErrBookClosed), and the outbox. Shopper raises no event, so it has no orange sticky.

2. Fulfilment progress and tracking​

The tracking side of the same events, and the one PII read:

Derived from: model.yaml → contexts[customer-ordering].consumes, .aggregates[CustomerOrder].commands, .invariants (ErrStatusRegression), .read_models[OrderTrackingView], .inbound (GetShipTo, GetTracking).

The prefixes OS, ST and DP name the producer (order-sourcing, shipping-and-tracking, delivery-promise). Omitted: the inbox, and the shopper's GetOrder. The pairing of each event with a command is this pack's reading. The model lists both sides but not the pairs.

3. Cancellation​

Derived from: model.yaml → contexts[customer-ordering].business_decisions, .aggregates[CustomerOrder].invariants (ErrCancelAfterLock), .transitions, .policies[CancelIsARequest], .policies[CancelOnUnfulfillable], .publishes[CustomerOrderCancelled]; contexts[order-sourcing].aggregates[FulfillmentAssignment].transitions; contexts[delivery-promise].publishes[PromiseUnkeepable].

Omitted: the 409 answer to a refused cancellation (cancel-after-lock), the re-promise branch (PromiseRevised → UpdateGroupPromise, board 2), the answers of order-sourcing to the request (FulfillmentCancelled, FulfillmentCancelRefused), and returns after the lock (future customer-returns).

Hotspots​

#HotspotWhere it comes from in the model
H1A DeliveryOffer is quoted for one catalogue item and quantity, but a Promise covers a multi-line shipment group and names one offerId. The model does not say how a group of several lines maps to one offer.contexts[delivery-promise].aggregates[DeliveryOffer].description vs .aggregates[Promise] and publishes[PromiseMade].data
H2delivery-promise confirms the promise only when it consumes CustomerOrderPlaced. If that happens after holdExpiresAt, ConfirmPromise fails (ErrPromiseHoldExpired) and the promise is RELEASED. PromiseReleased goes to analytics only, so this context never learns that a placed order has no promise.contexts[delivery-promise].aggregates[Promise].invariants, .transitions (ReleaseExpiredHolds), publishes[PromiseReleased].consumers
H3GET /orders/{orderId}/ship-to is "in-org, restricted", but the network has no authentication.contexts[customer-ordering].inbound; conventions.no_auth
H4Resolved: the order status is derived from the group states, so a delivery while the order is PARTIALLY_SHIPPED is recorded and gives PARTIALLY_DELIVERED; LOST and RETURNED exist as order and group states (ADR 0002 A1, A19, A23).contexts[customer-ordering].aggregates[CustomerOrder].states, .transitions, .policies[OrderStatusDerivedFromGroups]
H5Resolved: GroupPromise also stores the per-group status, tier, witnessNodeId, shipBy, the lock, shipment, delivery and cancellation facts (ADR 0002 A2). The model's value_objects list names only the promise fields.aggregates[CustomerOrder].value_objects, .invariants, publishes[CustomerOrderPlaced].data
H6Resolved (G10): delivery-promise publishes PromiseUnkeepable when a re-promise is not feasible, and that event, not FulfillmentUnsourceable, triggers CancelOnUnfulfillable (ADR 0002 A5).policies[CancelOnUnfulfillable]; contexts[delivery-promise].publishes[PromiseUnkeepable]
H7Resolved: a cancel is a request for the PROMISED groups; ADR 0002 says IN_FULFILLMENT → CANCELLED stays unreachable (a group can only be cancelled while unlocked), so PLACED → CANCELLED is the only reachable cancellation.business_decisions, aggregates[CustomerOrder].invariants, .policies[CancelIsARequest]
H8POST /shoppers (RegisterShopper) is in rest, but no inbound row names its caller.contexts[customer-ordering].rest vs .inbound
H9Resolved: order-sourcing cancels a FulfillmentAssignment from QUEUED, RELEASED and UNSOURCEABLE, the state of the group CancelOnUnfulfillable cancels.contexts[order-sourcing].aggregates[FulfillmentAssignment].transitions
H10Resolved (G12): this context learns of a lock only from FulfillmentLocked, so a cancel accepted between the vendor's acceptance and that event passes ErrCancelAfterLock here, which is advisory. order-sourcing decides and answers FulfillmentCancelRefused (CANCEL_AFTER_LOCK); the group returns to LOCKED and the shopper's path is a return. One race stays open in order-sourcing (AcceptanceAfterCancelOnlyLogged).contexts[customer-ordering].aggregates[CustomerOrder].invariants; contexts[order-sourcing].aggregates[FulfillmentAssignment].invariants, policies[LockOnCommit]