Skip to main content

Context map

Following ddd-crew Context Mapping. This is product-discovery's slice of the storefront-wide context map: every relationship the context has, with the upstream (U) and downstream (D) side, the pattern and the channel.

Source: cmd/api/workers.go (the three consumers), internal/adapters/inbound/http/server.go (routes), internal/adapters/inbound/a2a/server.go (skills), internal/adapters/outbound/sources/ and docs/network-ohs-allowlist.yaml (rebuild reads).

Thick arrows are Kafka event relationships, solid arrows synchronous reads. The dotted arrows are this context's own calls, the downstream customer reading its upstream supplier; they exist only on the ops-run rebuild, never on a shopper request. REST path parameters are written without braces inside the diagram.

Relationships​

NeighbourDirectionPatternChannelMessagesWhy this pattern
storefront-bff (experience layer)PD upstream, shopper downstreamOpen Host ServiceREST GET /products, GET /products/{catalogItemId}, GET /categoriesSearchProducts, GetProduct, ListCategoriesThe whole catalogue surface of the storefront edge is these three reads; the BFF needs no knowledge of the feeds. No authentication
delegating agentsPD upstreamOpen Host ServiceA2A JSON-RPC on / and /a2askills search_products, get_productThe same two reads as agent skills (ADR 0007)
offer-availability (network)OA upstream, PD downstreamConformistKafka retailnetwork.offer-availability.eventssix item and listing eventsThe item master and listing availability are the network's language; the context keeps only what the join needs
product-contentPC upstream, PD downstreamConformistKafka retailnetwork.product-content.eventsProductContentPublished, ProductContentRetired, CategoryTreePublishedSame-shape sibling feed: revision, full content and the whole tree per version
pricingPR upstream, PD downstreamConformistKafka retailnetwork.pricing.eventsItemPriceChanged, ItemPriceWithdrawnThe effective price is pricing's fact; the context copies prices and the version guard
offer-availabilityOA supplier, PD customerCustomer/SupplierREST GET /catalog; GET /listingslist catalogue; list listingsRebuild only. GET /catalog is an Open Host Service route; GET /listings has no storefront read, so it is an in-org read on an ops-only path, the one documented exception
pricingPR supplier, PD customerCustomer/SupplierREST GET /item-prices (paged)list item pricesRebuild only: prices before the events begin
product-contentPC supplier, PD customerCustomer/SupplierREST GET /product-contents (paged), GET /categorieslist contents; list categoriesRebuild only: published content and the tree before the events begin

Notes on the patterns​

  • No anti-corruption layer. All three feeds are inside one organisation and publish a stable CloudEvents contract; conforming is cheap. The monotonic guards order facts, they do not translate them.
  • Conformist on the feeds. The feeds are published facts, not negotiated interfaces; the context applies them as published and ignores unknown fields.
  • No shared kernel. catalogItemId, listingId and categoryId are values copied from messages, never shared code or tables.
  • Open Host Service in one direction only. The context hosts the shopper-facing reads and is a customer of every synchronous call it makes.
  • Nothing downstream but the shopper. It publishes nothing, so no bounded context depends on it; the read side can be rebuilt, reindexed or swapped behind SearchPort without a neighbour noticing.
  • Separate Ways with shopping-cart, checkout and customer-payments: the cart keeps its own purchasability view from the same feeds rather than calling this context.
  • No fleet edge. The context never consumes a warehouse.* topic and never calls a warehouse-systems service.