Skip to main content

Domain Events

Built on develop, not deployed

Derived from model/model.yaml. The product-discovery service is built on develop (IQVO/product-discovery at 9c2f945, checked 2026-10-27) and not deployed (no warehouse-infra entry). Every Err... name, REST route and CloudEvents type of this context named on this page exists in the service; where the built service differs from the model's design, the page says so (As built) or the context's Service and operations section lists it.

Every event this context consumes, from contexts[product-discovery].consumes and .inbound, with the producer's publishes entry for each. This context publishes nothing (publishes: []): no retailnetwork.product-discovery.events topic is ever written, and the .analytics topic of the tier convention is never written either. The storefront-wide rules are on Event standard: CloudEvents.

Envelope​

Every consumed Kafka message is a CloudEvents 1.0 event in structured JSON mode (conventions.cloudevents), minted and enveloped by its producer:

AttributeValue (per producer)
specversion1.0
ida UUID minted once by the producer; a redelivery carries the same id — this context's inbox key
source/retailnetwork/offer-availability, /retailnetwork/product-content or /retailnetwork/pricing
typecom.retailnetwork.<tier>.<producer>.<entity>.<EventName> — tier commerce for offer-availability, tier storefront for the two siblings
subjectthe producer's aggregate root id (also the Kafka partition key)
timethe instant the fact happened, UTC
dataschemaurn:retailnetwork:<producer>:events:<EventName>:v1
Kafka topicsretailnetwork.offer-availability.events, retailnetwork.product-content.events, retailnetwork.pricing.events

Consumption rules (conventions.integration_rules): idempotent on the CloudEvents id — the id is inserted into processed_events in the same transaction as the projection effect, and a duplicate is acknowledged without effect; dispatch on the full type string, never on a suffix. Consumer group names come from mandatory environment variables (OFFER_AVAILABILITY_CONSUMER_GROUP, PRICING_CONSUMER_GROUP, PRODUCT_CONTENT_CONSUMER_GROUP; the service refuses to start without them); the names the design suggests: product-discovery.offer-availability, product-discovery.product-content, product-discovery.pricing.

Ordering rules. Within one producer, events keyed by the same root id arrive in order. Across roots and across producers nothing is promised, so business decision 4 adds per-source monotonic guards on top of the inbox: listing asOf, content revision, price version. A late-arriving older fact is skipped, even across a rebalance or a replay — and a fact for an item whose CatalogItemCreated has not landed yet simply creates a partial row that fills in (no invariant can be violated; there are no invariants).

Published​

None. publishes: [] is the design: a read side with no events out is the standard CQRS shape, and it keeps every write path free of a dependency on this context (see the Context Map). The canvas open questions record the one cost: search analytics (query terms, zero-result and fallback rates) have no event to ride on.

Consumed​

From offer-availability (retailnetwork.offer-availability.events, Conformist)​

EventFull typeFields usedWhat this context does
CatalogItemCreatedcom.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemCreatedcatalogItemId, title, hazmat, fragileCreates (or fills in) the ProductView row: title and flags. Dimensions, weight and GTIN are dropped — the item master owns them. purchasable recomputed (item ACTIVE).
CatalogItemDiscontinuedcom.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemDiscontinuedcatalogItemIdMarks the item DISCONTINUED: purchasable goes false (PurchasableRule requires an ACTIVE item). The row stays — the page still renders, as currently unavailable.
ListingCreatedcom.retailnetwork.commerce.offer-availability.listing.ListingCreatedlistingId, catalogItemId, nodeIdLearns the listing-to-item mapping; a LIVE listing with quantity above 0 feeds inStock.
ListingAvailabilityChangedcom.retailnetwork.commerce.offer-availability.listing.ListingAvailabilityChangedlistingId, catalogItemId, availableQty, asOfUpdates the listing's quantity, guarded by asOf; inStock and then purchasable recomputed. basis, feedId and ownerRef are dropped.
ListingSuppressedcom.retailnetwork.commerce.offer-availability.listing.ListingSuppressedlistingIdMarks that listing SUPPRESSED; suppressed listings never count toward inStock. The item-to-listing mapping comes from the stored ListingCreated row (the event itself carries no catalogItemId). The network's reason is dropped.
ListingRestoredcom.retailnetwork.commerce.offer-availability.listing.ListingRestoredlistingIdMarks the listing LIVE again; inStock recomputed.

From product-content (retailnetwork.product-content.events, Conformist)​

EventFull typeFields usedWhat this context does
ProductContentPublishedcom.retailnetwork.storefront.product-content.productcontent.ProductContentPublishedcatalogItemId, revision, description, attributes, primaryCategoryIdReplaces the item's content on the ProductView, guarded by revision (an older revision is skipped), then re-indexes the search row (weights: attributes B, description C). purchasable recomputed (content PUBLISHED).
ProductContentRetiredcom.retailnetwork.storefront.product-content.productcontent.ProductContentRetiredcatalogItemIdThe item's content is no longer PUBLISHED: purchasable goes false; the page shows the item without sellable content.
CategoryTreePublishedcom.retailnetwork.storefront.product-content.categorytree.CategoryTreePublishedversion, categoriesReplaces the CategoryView tree for that version, guarded by version; purchasable counts are re-derived from ProductView.

From pricing (retailnetwork.pricing.events, Conformist)​

EventFull typeFields usedWhat this context does
ItemPriceChangedcom.retailnetwork.storefront.pricing.itemprice.ItemPriceChangedcatalogItemId, effectivePriceMinor, versionUpdates the effective price, guarded by version. purchasable recomputed (price ACTIVE).
ItemPriceWithdrawncom.retailnetwork.storefront.pricing.itemprice.ItemPriceWithdrawncatalogItemIdThe price is WITHDRAWN: purchasable goes false (the rule requires an ACTIVE price).

Two payload notes (model gaps, also on the canvas open questions). The ProductView purpose and the API render the product page with bullets, media and the list price, yet the declared consumes fields name neither bullets/media (on ProductContentPublished) nor listPriceMinor/currency (on ItemPriceChanged); and CategoryTreePublished feeds CategoryView only, so a category rename never re-indexes the categoryPath the search weights at A. These pages copy the fields the purpose names and flag the declaration gap.

Example envelope​

The event the purchasable verdict turns on, ListingAvailabilityChanged, one listing dropping to zero (all ids synthetic, all values illustrative):

{
"specversion": "1.0",
"id": "9a1c7b52-3d84-4f0e-8b7a-2c5d9e0f1a3b",
"source": "/retailnetwork/offer-availability",
"type": "com.retailnetwork.commerce.offer-availability.listing.ListingAvailabilityChanged",
"subject": "lst-40987",
"time": "2026-10-25T09:41:07Z",
"datacontenttype": "application/json",
"dataschema": "urn:retailnetwork:offer-availability:events:ListingAvailabilityChanged:v1",
"data": {
"listingId": "lst-40987",
"catalogItemId": "cat-100234",
"nodeId": "node-msp-14",
"availableQty": 0,
"basis": "PHYSICAL",
"asOf": "2026-10-25T09:41:05Z",
"feedId": "feed-88213"
}
}

This context reads four fields of data, inserts the id into processed_events, applies the asOf guard, and — if the item's last LIVE listing just went to zero — flips inStock and purchasable to false in the same transaction. No PII anywhere: a listing event carries quantities, never a name or address (conventions.no_auth, meta.hard_boundary).