Skip to main content

Offer & Availability

offer-availability (code OA, CloudEvents tier commerce) is a bounded context of the retail network (the Network area of the warehouse-systems fleet). It knows what the network can sell and from which node. The network sells items it does not store: every node is run by a vendor. Before anything downstream can show a product, promise a delivery date or choose a node for an order, someone has to hold two facts, and this service holds them:

  1. What can be sold. The network's own entry for a product, the CatalogItem: title, dimensions in millimetres, weight in grams, hazmat and fragile flags, an optional GS1 GTIN and an optional packaging hierarchy (EACH, INNER, CASE, PALLET).
  2. From where, and how much. One Listing per catalogue item, node and optional owner, with the quantity the node claims it can ship and the basis the vendor gave for that number.

Its subdomain class is Supporting (revenue enabler, evolution Product): the decisions that win customers are made in delivery-promise and order-sourcing, which this context only feeds with facts. See Subdomain classification.

What it does​

CapabilityHow
Keep the item masterPOST /catalog-items, POST /catalog-items/{catalogItemId}/discontinuations, GET /catalog, GET /catalog/{catalogItemId}; GTIN and pack levels through PUT /catalog-items/{catalogItemId}/packaging/{level} and POST .../packaging/{level}/retirements
List an item on a nodePOST /listings (GET /listings to read); the listing starts LIVE only if the node is ACTIVE in the local node status, otherwise SUPPRESSED with reason NODE_NOT_SELLABLE
Apply vendor inventory feedsPOST /inventory-feeds: full or partial, atomic per feed, ordered by asOf per node, recorded as APPLIED, SUPERSEDED or FAILED (GET /inventory-feeds/{feedId})
Follow node lifecycleConsumes NodeRegistered, NodeActivated, NodeSuspended and NodeRetired from retailnetwork.node-topology.events into a local node_status_view; suspending or retiring a node suppresses its LIVE listings and activating it restores the ones suppressed for that reason
Publish factsNine CloudEvents types on retailnetwork.offer-availability.events through a transactional outbox (Event catalogue)
Serve agentsRead-only MCP (cmd/mcp, four tools) and read-only A2A (cmd/a2a, two skills) over the same read use cases as REST
ConsoleA read-only Module Federation remote (web/, ADR 0008) over the REST reads

Everything is unauthenticated: REST, MCP and A2A carry no credentials, by a fleet-wide decision. Access control is the in-cluster boundary.

The basis of a quantity​

A vendor can give a number for two different reasons, and the listing keeps the reason next to the number and never re-derives it:

BasisMeaning
PHYSICALThe number is the stock the node can use
THROUGHPUT_CONSTRAINEDThe node has more stock but can only move this many before its next cutoff
UNKNOWNThe vendor did not say (also the state of a listing that never received a feed)

Decisions this context makes​

  • A listing is sellable only while its node is ACTIVE; node events suppress and restore listings.
  • A feed older than the last applied feed of that node is SUPERSEDED and changes nothing; within a feed, a line older than the availability the listing already holds is skipped and counted as stale.
  • A full feed is the complete truth for its node: every listing of the node it omits is set to zero.
  • One listing per catalogue item, node and owner; a GTIN identifies one item or pack level forever; a discontinued item suppresses all its listings, for good.

What it does NOT own​

Not hereWhere it lives
Whether a delivery date is feasible, and promise capacitydelivery-promise, which builds its own AvailabilityView from this context's events
Choosing a node for an orderorder-sourcing (same event-fed view); this context never chooses
The vendor protocol: vendor authentication, asynchronous transactions, rate limits, the 202 answervendor-connectivity, which calls POST /inventory-feeds in-organization
Which node exists and whether it is activenode-topology; this context holds a copy (node_status_view) and conforms to it
Pricing, competing offers between sellers, inventory placementNot modelled anywhere in this context (a listing carries only an optional ownerRef)
Measured feed freshnessnode-performance, computed from InventoryFeedApplied
Stock inside a warehouseThe WMS and WES contexts of the fleet; their numbers reach this context only as a vendor feed

This service calls no other service: there is no outbound REST, MCP or A2A client, and the fitness test TestNoOutboundA2AClient keeps it that way. Everything it learns arrives as a Kafka event or as a REST call into it.

Where to go next​

You want toRead
Run it and make the first callsQuickstart
Understand the layout and the binariesArchitecture, Runtime
Set it up and operate itConfiguration, Runbook, Observability, Troubleshooting, Before the first release
Test and change itTesting
Learn the domainUbiquitous language, Use cases, DDD artifacts
Integrate with itAPI overview, Event catalogue, MCP tools, Integration
See why it is built this wayArchitecture decision records
Disclaimer

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.