Skip to main content

EventStorming

Process-level boards (flowchart LR, or TB where LR would be too wide) in the ddd-crew EventStorming glossary & cheat sheet notation. Every sticky is a command, aggregate, event, policy, read model or neighbour that exists in the code on develop. The hotspots are the gaps the design left open: most are now settled by the code and the table at the end says how, the rest are still risks. The domain-wide board is the aggregator's EventStorming Big Picture.

Legend​

StickyColourMeaning
Commandblue #a5d8ffAn intention, named as the use case or aggregate method
Aggregateyellow #ffec99The aggregate root that decides
Domain Eventorange #ffc078A fact this context publishes (or a consumed one)
Policylilac #d0bfff"Whenever X, then Y"
Read Modelgreen #b2f2bbA local, event-fed view
External Systempink #fcc2d7A neighbouring context or the fleet
Hotspotred #ff8787A remaining risk or an open question
Actorpale orange #fff4e6A person (used only for humans)

1. Catalogue and listing set-up​

Source: internal/application/usecases/catalog.go, internal/application/usecases/listings.go, internal/domain/catalog/events.go, internal/domain/listing/events.go.

Omitted: the refusals (invalid-item-dimensions, invalid-gtin, gtin-already-assigned, duplicate-listing; see Use cases) and the read queries, which change nothing. CreateListing also raises ListingSuppressed when the node is not ACTIVE, the item is discontinued or the owner is suspended.

2. Inventory feed application​

Source: internal/application/usecases/feeds.go, internal/domain/feed/feed.go, internal/domain/listing/listing.go, internal/adapters/outbound/postgres/feed_repository.go (node_feed_marks).

Omitted: the FAILED outcome (listing-not-on-node, negative-availability) and the SUPERSEDED outcome, which raise no event but increment the feed counter; the stale-line skip, which raises no ListingAvailabilityChanged; the vendor's own Vendor API submission upstream of vendor-connectivity.

3. Node-driven and owner-driven suppression​

Source: internal/application/usecases/node_events.go, internal/application/usecases/seller_events.go, internal/application/usecases/received_stock.go, internal/domain/nodestatus/nodestatus.go, internal/domain/sellerstatus, internal/adapters/inbound/kafka/node_consumer.go, internal/adapters/inbound/kafka/seller_consumer.go, internal/adapters/inbound/kafka/received_consumer.go.

Omitted: NodeRegistered only inserts the node into the view as PROPOSED (a no-op for a known node) and triggers no command. The restore steps run through Listing.Reconcile, which reads the node, the item and the owner from the local views and moves the listing to the highest remaining cause; Listing.Restore itself is refused with ErrNodeNotSellable on a node that is not ACTIVE, and a DISCONTINUED listing is never restored. A listing shows one reason, the highest active cause (DISCONTINUED > NODE_NOT_SELLABLE > OWNER_SUSPENDED, ADR 0013), so NodeActivated on a node whose owner is suspended moves the listing to OWNER_SUSPENDED instead of restoring it, and SellerReinstated hands a listing to NODE_NOT_SELLABLE when the node is still not ACTIVE. An InboundShipmentReceived without a received list, or a line whose item cannot be resolved, creates nothing and is counted (ADR 0014); a received line whose listing exists changes nothing.

Hotspots​

H1 to H6 were open questions of the design that the code has since settled; H2, H7 and H8 remain. The other inputs of board 3 (SellerSuspended, SellerReinstated, InboundShipmentReceived) were added by ADR 0013 and ADR 0014 and are not hotspots.

HotspotQuestionStatus in the code
H1A feed older than the node's last applied feed has no rule or stateSettled: state SUPERSEDED, feed.Superseded, the node_feed_marks table
H2A full feed writes every listing of a busy node in one atomic apply (up to 10000 lines)Open. One transaction under the node's lock; no measured limit on transaction size or lock time
H3Starting state and availability of a new listingSettled: LIVE only when the node is ACTIVE and the item is not discontinued, else SUPPRESSED; quantity 0, basis UNKNOWN
H4Effect of discontinuing on the item's listingsSettled: every listing is suppressed with reason DISCONTINUED, finally
H5What a zeroed listing carriesSettled: quantity 0, the basis kept, the feed's asOf and id stamped
H6Vocabulary of the suppression reasonSettled: NODE_NOT_SELLABLE, DISCONTINUED and, since ADR 0013, OWNER_SUSPENDED, one reason shown at a time by precedence (listing.Reason, listing.Sellability.Cause)
H7No contract test here pins the downstream consumers; their list was recomputed on 2026-11-13 from each sibling's inbound Kafka handlersOpen. Integration
H8While the node-topology or seller-inbound consumer lags, listings keep their last state and /readyz stays greenOpen. Readiness checks Postgres and a broker, not consumer lag (Troubleshooting)