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.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
9
commands
9
policies
36
read models
6
hot spots
4

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
  1. 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 merchandising
    Read modelBarcodes already in use
    CommandCreateCatalogItemPOST /catalog-items
    AggregateItem
    EventCatalogItemCreated
    Systemdelivery-promise
    PolicyKeeps a copy of the item as active
    Systemshipping-and-tracking
    PolicyKeeps the item's size, weight and handling flags
    Systemshopping-cart
    PolicyMarks the item as catalogued, so it can be added to a cart
    Systempricing
    PolicyKnows the item exists, so it can be priced
    Systemproduct-content
    PolicyRecords the item as active

    Source: application/usecases/catalog.go · domain/catalog/catalog.go

  2. 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 merchandising
    CommandDeclarePackLevelPUT /catalog-items/{catalogItemId}/packaging/{level}
    AggregateItem
    EventCatalogItemPackagingDeclared
    EventCatalogItemPackLevelRetired
    Systemseller-inbound
    PolicyKeeps the pack level to check shipment contents
    Systemvendor-connectivity
    PolicyKeeps the pack level in its packaging view

    Source: application/usecases/catalog.go · domain/catalog/packaging.go · 0006-catalog-gtin-packaging-and-listing-owner.md

  3. 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 merchandising
    CommandRetirePackLevelPOST /catalog-items/{catalogItemId}/packaging/{level}/retirements
    AggregateItem
    EventCatalogItemPackLevelRetired
    Systemseller-inbound
    PolicyMarks the pack level retired in its copy
    Systemvendor-connectivity
    PolicyMarks the pack level retired in its copy

    Source: application/usecases/catalog.go · domain/catalog/packaging.go

  4. 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 merchandising
    Read modelNode status copy
    Read modelSeller status copy
    CommandCreateListingPOST /listings
    AggregateListing
    EventListingCreated
    EventListingSuppressed
    Systemdelivery-promise
    PolicyKeeps a copy of the listing
    Systemorder-sourcing
    PolicyKeeps a copy of the listing
    Systemvendor-connectivity
    PolicyKeeps a copy of the listing, so it can check feed lines

    Source: application/usecases/listings.go · domain/listing/listing.go

  5. 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.

    ActorVendor
    Read modelLast applied feed time of the node
    CommandApplyInventoryFeedPOST /inventory-feeds
    AggregateInventoryFeed
    EventListingAvailabilityChanged
    EventInventoryFeedApplied
    Systemdelivery-promise
    PolicyKeeps the quantity unless it is older than the one it holds
    Systemorder-sourcing
    PolicyKeeps the quantity of the listing
    Systemnode-performance
    PolicyRecords that the node sent a feed

    Source: application/usecases/feeds.go · domain/feed/feed.go · domain/feed/feed_apply.go

  6. 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 merchandising
    CommandDiscontinueItemPOST /catalog-items/{catalogItemId}/discontinuations
    AggregateItem
    EventCatalogItemDiscontinued
    EventListingSuppressed
    Systemshopping-cart
    PolicyStops new additions to carts; lines already in carts stay
    Systempricing
    PolicyWithdraws the item's price if it has an active one
    Systemproduct-content
    PolicyRetires the item's content
    Systemdelivery-promise
    PolicyMarks the item discontinued in its copy
    Systemorder-sourcing
    PolicyMarks the item discontinued in its copy

    Source: application/usecases/catalog.go · domain/catalog/catalog.go · domain/listing/listing.go

  7. 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 known
    CommandApplyNodeEventstarted by the policy
    Read model · kept up to dateNode status copy

    Source: application/usecases/node_events.go · adapters/inbound/kafka/node_consumer.go · domain/nodestatus/nodestatus.go

  8. 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 unavailable
    Read modelSeller status copy
    CommandApplyNodeEventstarted by the policy
    AggregateListing
    EventListingRestored
    EventListingSuppressed
    Read model · kept up to dateNode status copy
    Systemdelivery-promise
    PolicyMarks the listing sellable again
    Systemorder-sourcing
    PolicyMarks the listing sellable again

    Source: application/usecases/node_events.go · adapters/inbound/kafka/node_consumer.go · domain/listing/listing.go

  9. 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 listings
    CommandApplyNodeEventstarted by the policy
    AggregateListing
    EventListingSuppressed
    Read model · kept up to dateNode status copy
    Systemdelivery-promise
    PolicyMarks the listing suppressed
    Systemorder-sourcing
    PolicyMarks the listing suppressed

    Source: application/usecases/node_events.go · adapters/inbound/kafka/node_consumer.go · domain/nodestatus/nodestatus.go

  10. 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 owns
    CommandApplySellerEventstarted by the policy
    AggregateListing
    EventListingSuppressed
    Read model · kept up to dateSeller status copy
    Systemdelivery-promise
    PolicyMarks the listing suppressed
    Systemorder-sourcing
    PolicyMarks the listing suppressed

    Source: application/usecases/seller_events.go · adapters/inbound/kafka/seller_consumer.go · 0013-seller-status-and-received-stock-drive-owner-listings.md

  11. 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 holds
    Read modelNode status copy
    CommandApplySellerEventstarted by the policy
    AggregateListing
    EventListingRestored
    EventListingSuppressed
    Read model · kept up to dateSeller status copy
    Systemdelivery-promise
    PolicyMarks the listing sellable again
    Systemorder-sourcing
    PolicyMarks the listing sellable again

    Source: application/usecases/seller_events.go · adapters/inbound/kafka/seller_consumer.go · domain/listing/listing.go

  12. 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
    EventInboundShipmentReceived
    PolicyWhenever a seller's shipment is received, create the seller's missing listings on that node
    Read modelCatalogue items by barcode
    Read modelNode and seller status copies
    CommandApplyReceivedStockstarted by the policy
    AggregateListing
    EventListingCreated
    EventListingSuppressed
    Systemdelivery-promise
    PolicyKeeps a copy of each new listing
    Systemorder-sourcing
    PolicyKeeps a copy of each new listing

    Source: 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.

Opportunities

  • OpportunityMeasure feed apply time, the share of stale lines and how long hiding takes after a node leaves service. Proposed, not built.

    Source: docs/ddd/bounded-context-canvas.md

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.