Retail network · Supporting domain · EventStorming board
offer-availability
Keeps the catalogue of items, where each item is offered (listings) and how many units each node says it has, and hides listings that cannot be sold.
- events published
- 9
- commands
- 9
- policies
- 36
- read models
- 6
- hot spots
- 4
The story in 5 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventCatalog
Item Created - Pivotal eventListing
Created - Pivotal eventListing
Availability Changed - Pivotal eventListing
Suppressed - Pivotal eventListing
Restored
Listens to (3): contexts whose events this one reacts to
Tells (10): contexts that react to its events
The board, row by row
12 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
-
Add an item to the catalogue
Merchandising creates an item with its size, weight, handling flags and an optional barcode. A barcode already held by another item or pack level is refused.
ActorNetwork merchandisingRead modelBarcodes already in useCommandCreateCatalog POST /catalog-itemsItem AggregateItemEventCatalogItem Created Systemdelivery-promise PolicyKeeps a copy of the item as activeSystemshipping-and- tracking PolicyKeeps the item's size, weight and handling flagsSystemshopping-cart PolicyMarks the item as catalogued, so it can be added to a cartSystempricingPolicyKnows the item exists, so it can be pricedSystemproduct-content PolicyRecords the item as activeSource: application/usecases/catalog.go · domain/catalog/catalog.go
-
Declare how an item is packed
Merchandising declares a pack level (each, inner, case or pallet) with its barcode and units. A new barcode at a level replaces the old one, which is retired in the same step.
ActorNetwork merchandisingCommandDeclarePack PUT /catalog-items/{catalogItemId}/packaging/{level}Level AggregateItemEventCatalogItem Packaging Declared EventCatalogItem Pack Level Retired Systemseller-inbound PolicyKeeps the pack level to check shipment contentsSystemvendor-connectivity PolicyKeeps the pack level in its packaging viewSource: application/usecases/catalog.go · domain/catalog/packaging.go · 0006-catalog-gtin-packaging-and-listing-owner.md
-
Retire a pack level
Merchandising retires the active pack level. The level stays on the item, so a document that names its barcode still resolves.
ActorNetwork merchandisingCommandRetirePack POST /catalog-items/{catalogItemId}/packaging/{level}/retirementsLevel AggregateItemEventCatalogItem Pack Level Retired Systemseller-inbound PolicyMarks the pack level retired in its copySystemvendor-connectivity PolicyMarks the pack level retired in its copySource: application/usecases/catalog.go · domain/catalog/packaging.go
-
Offer an item from a node
Merchandising offers an item from one node. The listing starts live only if the node is active, the item is not discontinued and the seller, if any, is not suspended. Otherwise it starts hidden.
ActorNetwork merchandisingRead modelNode status copyRead modelSeller status copyCommandCreateListing POST /listingsAggregateListingEventListingCreated EventListingSuppressed Systemdelivery-promise PolicyKeeps a copy of the listingSystemorder-sourcing PolicyKeeps a copy of the listingSystemvendor-connectivity PolicyKeeps a copy of the listing, so it can check feed linesSource: application/usecases/listings.go · domain/listing/listing.go
-
Apply a stock feed for a node
A vendor reports quantities for one node. Each line sets a listing's quantity; a full feed zeroes the listings it leaves out. A feed older than the last applied one is set aside and changes nothing.
ActorVendorRead modelLast applied feed time of the nodeCommandApplyInventory POST /inventory-feedsFeed AggregateInventoryFeed EventListingAvailability Changed EventInventoryFeed Applied Systemdelivery-promise PolicyKeeps the quantity unless it is older than the one it holdsSystemorder-sourcing PolicyKeeps the quantity of the listingSystemnode-performance PolicyRecords that the node sent a feedSource: application/usecases/feeds.go · domain/feed/feed.go · domain/feed/feed_apply.go
-
Discontinue an item
Merchandising withdraws an item for good. Every listing of the item is hidden in the same step, and a listing hidden for this reason is never put back.
ActorNetwork merchandisingCommandDiscontinueItem POST /catalog-items/{catalogItemId}/discontinuationsAggregateItemEventCatalogItem Discontinued EventListingSuppressed Systemshopping-cart PolicyStops new additions to carts; lines already in carts staySystempricingPolicyWithdraws the item's price if it has an active oneSystemproduct-content PolicyRetires the item's contentSystemdelivery-promise PolicyMarks the item discontinued in its copySystemorder-sourcing PolicyMarks the item discontinued in its copySource: application/usecases/catalog.go · domain/catalog/catalog.go · domain/listing/listing.go
-
Keep a copy of node status
node-topology announces each new node. Here it is noted as Proposed, so listings created for it start hidden until it goes live.
Systemnode-topology EventNodeRegistered PolicyWhenever a node is registered, note it as Proposed unless it is already knownCommandApplyNode started by the policyEvent Read model · kept up to dateNode status copySource: application/usecases/node_events.go · adapters/inbound/kafka/node_consumer.go · domain/nodestatus/nodestatus.go
-
Show listings again when a node goes live
When a node is activated, its hidden listings come back. One stays hidden if its item is discontinued or its seller is suspended, and it then shows that reason.
Systemnode-topology EventNodeActivated PolicyWhenever a node is activated, restore the listings hidden because the node was unavailableRead modelSeller status copyCommandApplyNode started by the policyEvent AggregateListingEventListingRestored EventListingSuppressed Read model · kept up to dateNode status copySystemdelivery-promise PolicyMarks the listing sellable againSystemorder-sourcing PolicyMarks the listing sellable againSource: application/usecases/node_events.go · adapters/inbound/kafka/node_consumer.go · domain/listing/listing.go
-
Hide listings when a node leaves service
When a node is suspended, or retired for good, every live listing on it is hidden. Retired is final.
Systemnode-topology EventNodeSuspended PolicyWhenever a node is suspended or retired, hide all its live listingsCommandApplyNode started by the policyEvent AggregateListingEventListingSuppressed Read model · kept up to dateNode status copySystemdelivery-promise PolicyMarks the listing suppressedSystemorder-sourcing PolicyMarks the listing suppressedSource: application/usecases/node_events.go · adapters/inbound/kafka/node_consumer.go · domain/nodestatus/nodestatus.go
-
Hide a suspended seller's listings
When a seller is suspended, every live listing the seller owns is hidden. A listing already hidden for a stronger reason keeps that reason.
Systemseller-inbound EventSellerSuspended PolicyWhenever a seller is suspended, hide every live listing the seller ownsCommandApplySeller started by the policyEvent AggregateListingEventListingSuppressed Read model · kept up to dateSeller status copySystemdelivery-promise PolicyMarks the listing suppressedSystemorder-sourcing PolicyMarks the listing suppressedSource: application/usecases/seller_events.go · adapters/inbound/kafka/seller_consumer.go · 0013-seller-status-and-received-stock-drive-owner-listings.md
-
Show a reinstated seller's listings again
When a seller is reinstated, the listings hidden for that seller come back, unless the node is still unavailable or the item is discontinued. Then they stay hidden for that reason.
Systemseller-inbound EventSellerReinstated PolicyWhenever a seller is reinstated, restore its listings unless another reason still holdsRead modelNode status copyCommandApplySeller started by the policyEvent AggregateListingEventListingRestored EventListingSuppressed Read model · kept up to dateSeller status copySystemdelivery-promise PolicyMarks the listing sellable againSystemorder-sourcing PolicyMarks the listing sellable againSource: application/usecases/seller_events.go · adapters/inbound/kafka/seller_consumer.go · domain/listing/listing.go
-
Create listings from received seller stock
When a seller's shipment is received at a node, each item without a listing for that seller there gets one, at zero quantity. Items that cannot be matched are skipped and counted, never an error.
Systemseller-inbound EventInboundShipment Received PolicyWhenever a seller's shipment is received, create the seller's missing listings on that nodeRead modelCatalogue items by barcodeRead modelNode and seller status copiesCommandApplyReceived started by the policyStock AggregateListingEventListingCreated EventListingSuppressed Systemdelivery-promise PolicyKeeps a copy of each new listingSystemorder-sourcing PolicyKeeps a copy of each new listingSource: application/usecases/received_stock.go · adapters/inbound/kafka/received_consumer.go · 0014-received-stock-creates-owner-listings.md
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 full feed rewrites every listing of a node in one transaction. No throughput or lock-time figure has been measured.
- Hot spotWhile the node-status consumer lags, listings keep their last state and the service still reports ready.
Source: docs/ddd/eventstorming.md
- Hot spotNo contract test checks the downstream readers of these events. The reader list comes from the network map, not from this repo.
- Hot spotShipments received before seller-inbound added item lines never become listings. They need a manual listing or a later shipment.
Opportunities
- OpportunityMeasure feed apply time, the share of stale lines and how long hiding takes after a node leaves service. Proposed, not built.
This board is a reconstruction from the code and documentation of offer-availability at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.