Skip to main content

Bounded Context Canvas

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.

Following the ddd-crew Bounded Context Canvas v5. Every message row comes from model.yaml (this context's inbound, rest, publishes, consumes and sync_calls, and the neighbours' entries for the other side of each edge).

Canvas at a glance​

Two pictures of the sections below: first the inbound collaborators and what the context does with them (purpose, domain roles, business decisions), then the outbound collaborators it notifies. Arrows follow the message type: solid blue commands (cmd), dotted green queries (qry), thick orange events (evt); each arrow names its channel and messages. Box shapes mark the collaborator kind: rounded = people or UI; blue = sibling bounded context. Channel names are abbreviated; the tables carry the exact route, topic and CloudEvents type.

Inbound​

Outbound​

Derived from: model.yaml → contexts[offer-availability].inbound, .publishes, .consumes, .sync_calls (empty), .purpose, .roles, .business_decisions. The diagrams omit the relationship pattern per message (see the tables), assumptions, metrics and open questions, and the replies to the synchronous calls. The context makes no synchronous call, so the Outbound picture has events only. The ext, self and none classes are declared for consistency with the other canvases and unused here.

Name​

Offer & Availability (offer-availability, code OA, CloudEvents tier commerce).

Purpose​

To know what the network can sell and from which node:

  • the catalogue item, the network's own entry for a product;
  • one listing per (catalogue item, node);
  • the quantity each node currently claims it can ship for each listing, with the basis the vendor gave for that number (physical stock or throughput-constrained).

It makes the facts available to the contexts that decide (promise and sourcing) as events, so their hot paths make no synchronous call here.

Strategic Classification​

AxisVerdict
DomainSupporting. See the Core Domain Chart.
Business ModelRevenue enabler (what can be sold, from where).
EvolutionProduct.

Domain Roles​

RoleApplies?Evidence in the model
SpecificationYes, primaryIt defines what is sellable: CatalogItem, Listing, the LIVE / SUPPRESSED rule tied to node status (ErrNodeNotSellable).
Analysis (availability)YesIt turns vendor feeds into per-listing availability: monotonic asOf (ErrStaleAvailability), FullFeedZeroing. It does not re-derive the vendor's basis.
Execution / Enforcer / GatewayNoIt enforces no deadline and no capacity, and it is not the vendor's entry point (vendor-connectivity is).

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
vendor-connectivityApplyInventoryFeedCommandREST POST /inventory-feeds (in-org; a vendor-connectivity sync_calls entry)Customer/Supplier (vendor-connectivity is the Customer)
Network merchandising (human)CreateCatalogItemCommandREST POST /catalog-itemsUI
Network merchandising (human)DiscontinueItemCommandREST POST /catalog-items/{catalogItemId}/discontinuationsUI
Network merchandising (human)CreateListingCommandREST POST /listingsUI
Shopper / storefrontBrowseCatalogQueryREST GET /catalog, GET /catalog/{catalogItemId}Open Host Service
node-topologyNodeRegisteredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRegisteredConformist
node-topologyNodeActivatedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeActivatedConformist
node-topologyNodeSuspendedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeSuspendedConformist
node-topologyNodeRetiredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRetiredConformist

Two routes in rest have no collaborator in inbound: GET /listings?nodeId=&catalogItemId= and GET /inventory-feeds/{feedId}. They are in the REST contract but not on the canvas, because the model does not say who calls them (see Open Questions).

Outbound Communication​

CollaboratorMessageTypeChannelRelationship
delivery-promise, shipping-and-trackingCatalogItemCreatedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemCreatedConformist (downstream)
delivery-promise, order-sourcingCatalogItemDiscontinuedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemDiscontinuedConformist (downstream)
delivery-promise, order-sourcing, vendor-connectivityListingCreatedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingCreatedConformist (downstream)
delivery-promise, order-sourcingListingAvailabilityChangedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingAvailabilityChangedConformist (downstream)
delivery-promise, order-sourcingListingSuppressedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingSuppressedConformist (downstream)
delivery-promise, order-sourcingListingRestoredEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingRestoredConformist (downstream)
node-performanceInventoryFeedAppliedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.inventoryfeed.InventoryFeedAppliedConformist (downstream)
(none)—Sync callsync_calls is empty: this context calls no one—

Full message details: Domain Events. Relationship evidence: Context Map.

Ubiquitous Language​

Full glossary: Ubiquitous Language. Top terms: Catalog Item, Listing (≠ Catalog Item), Available Quantity, Availability Basis PHYSICAL / THROUGHPUT_CONSTRAINED / UNKNOWN (≠ Promise Basis), Inventory Feed (≠ Submission), Full Feed, asOf.

Business Decisions​

  1. A listing is sellable only while its node is ACTIVE. Enforced by ErrNodeNotSellable and the SuppressOnNodeUnavailable policy.
  2. A feed older than the last applied feed for that node is not applied: it ends SUPERSEDED (nothing applied, no event, ADR 0002 A11). Per listing, an update with asOf not after the current asOf is ignored (ErrStaleAvailability).
  3. A full feed zeroes every listing of that node it omits (FullFeedZeroing).
  4. The basis the vendor declares is kept with the number, never re-derived.
  5. One listing per (catalogItemId, nodeId) (ErrDuplicateListing).
  6. A feed is applied at most once, atomically (ErrFeedAlreadyApplied), and every line names a listing of the feed's node (ErrListingNotOnNode).

Assumptions​

  • node-topology publishes every node status change, keyed by nodeId, so the local NodeStatusView sees them in order per node.
  • vendor-connectivity checks that a vendor acts only on its own nodes (ErrNodeNotOwnedByVendor) before it calls POST /inventory-feeds; this context does not know vendors.
  • vendor-connectivity owns the asynchronous transaction, rate limits and the 202 answer to the vendor; this context answers its in-org call inside that processing.
  • Consumers of availability (delivery-promise, order-sourcing) keep their own AvailabilityView from events; none calls this context on a hot path.
  • Feeds are retained 30 days (InventoryFeed size estimate).

Verification Metrics​

All proposed; nothing is measured yet.

  • Feed apply latency: POST /inventory-feeds p95, request to commit.
  • Share of feeds ending FAILED, split by ErrListingNotOnNode, ErrNegativeAvailability.
  • Share of feed lines ignored as stale (ErrStaleAvailability).
  • Listings zeroed by FullFeedZeroing per full feed.
  • Suppression lag: NodeSuspended / NodeRetired event time to the last ListingSuppressed of that node.
  • Outbox lag: commit to publish on retailnetwork.offer-availability.events.
  • Feed freshness per node, as measured by node-performance (feedFreshnessP95Minutes, from InventoryFeedApplied).

Open Questions​

  • Node-level staleness (resolved). A feed older than the last applied feed for that node ends SUPERSEDED (ADR 0002 A11); the per-listing ErrStaleAvailability skips a stale line.
  • What a zeroed listing carries. FullFeedZeroing sets availableQty=0, but the model does not say which basis and asOf the zeroed Availability gets.
  • A new listing's starting state. The model does not say whether a listing created on a non-ACTIVE node starts SUPPRESSED, nor what its Availability is before the first feed.
  • Discontinued items. Nothing says whether DiscontinueItem suppresses the item's listings or refuses new listings and feed lines for it.
  • Who reads GET /listings and GET /inventory-feeds/{feedId}. No inbound row names a caller.
  • Feed and transaction correlation. The model does not say whether feedId is vendor-connectivity's transactionId, nor the shape of a feed line.
  • Atomic application at volume. A full feed touches every listing of a node in one atomic apply, with "high, bursty" throughput.