Domain Events
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.
Every event this context publishes and consumes, from
contexts[offer-availability].publishes and .consumes, with the envelope
rules of conventions.cloudevents. The event standard is
CloudEvents; the namespace
decision is ADR 0007.
Envelope
| Attribute | Value |
|---|---|
specversion | 1.0 (structured JSON, mandatory on every Kafka message) |
id | a UUID minted once, when the event is written to outbox_events; a redelivery carries the same id |
source | /retailnetwork/offer-availability |
type | com.retailnetwork.commerce.offer-availability.<entity>.<EventName>; <entity> is catalogitem, listing or inventoryfeed |
subject | the aggregate root id: catalogItemId, listingId or feedId |
time | the instant the aggregate change committed, UTC |
datacontenttype | application/json |
dataschema | urn:retailnetwork:offer-availability:events:<EventName>:v1 |
| Topic | retailnetwork.offer-availability.events |
| Kafka key | the same aggregate root id as subject, so one aggregate's events share a partition |
Every event leaves through a transactional outbox written in the same
transaction as the aggregate change (conventions.integration_rules).
Published
| Event | Full type | Subject / key | Producing command (use case) | Consumers |
|---|---|---|---|---|
CatalogItemCreated | com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemCreated | catalogItemId | CreateCatalogItem | delivery-promise, shipping-and-tracking, seller-inbound |
CatalogItemDiscontinued | com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemDiscontinued | catalogItemId | DiscontinueItem | delivery-promise, order-sourcing, seller-inbound |
CatalogItemPackagingDeclared | com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemPackagingDeclared | catalogItemId | DeclarePackaging | seller-inbound, vendor-connectivity |
CatalogItemPackLevelRetired | com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemPackLevelRetired | catalogItemId | RetirePackLevel | seller-inbound, vendor-connectivity |
ListingCreated | com.retailnetwork.commerce.offer-availability.listing.ListingCreated | listingId | CreateListing | delivery-promise, order-sourcing, vendor-connectivity |
ListingAvailabilityChanged | com.retailnetwork.commerce.offer-availability.listing.ListingAvailabilityChanged | listingId | ApplyAvailability (inside ApplyInventoryFeed, including FullFeedZeroing) | delivery-promise, order-sourcing |
ListingSuppressed | com.retailnetwork.commerce.offer-availability.listing.ListingSuppressed | listingId | SuppressListing (policy SuppressOnNodeUnavailable) | delivery-promise, order-sourcing |
ListingRestored | com.retailnetwork.commerce.offer-availability.listing.ListingRestored | listingId | RestoreListing (policy SuppressOnNodeUnavailable) | delivery-promise, order-sourcing |
InventoryFeedApplied | com.retailnetwork.commerce.offer-availability.inventoryfeed.InventoryFeedApplied | feedId | ApplyInventoryFeed (feed reaches APPLIED) | node-performance |
Data fields
The field lists are the model's data arrays. Types are the proposed JSON
types.
CatalogItemCreated
| Field | Type | Meaning |
|---|---|---|
catalogItemId | string | The item's id (also subject). |
title | string | Display title. |
lengthMm | integer | Length in millimetres, > 0. |
widthMm | integer | Width in millimetres, > 0. |
heightMm | integer | Height in millimetres, > 0. |
weightG | integer | Weight in grams, > 0. |
hazmat | boolean | Hazardous-material handling flag. |
fragile | boolean | Fragile handling flag. |
gtin | string, optional | Proposed (ADR 0009): the each-level GTIN, 14 digits. Additive. |
CatalogItemDiscontinued
| Field | Type | Meaning |
|---|---|---|
catalogItemId | string | The discontinued item. |
ListingCreated
| Field | Type | Meaning |
|---|---|---|
listingId | string | The listing's id (also subject). |
catalogItemId | string | The item offered. |
nodeId | string | The node it is offered from. |
ListingAvailabilityChanged
| Field | Type | Meaning |
|---|---|---|
listingId | string | The listing (also subject). |
catalogItemId | string | The item, so consumers need no join. |
nodeId | string | The node, so consumers need no join. |
availableQty | integer | The node's claimed quantity, >= 0. |
basis | string | PHYSICAL, THROUGHPUT_CONSTRAINED or UNKNOWN, as the vendor declared it. |
asOf | string (date-time) | The instant the number is true for; strictly increasing per listing. |
feedId | string | The feed that carried the number. |
ListingSuppressed
| Field | Type | Meaning |
|---|---|---|
listingId | string | The listing (also subject). |
nodeId | string | Its node. |
reason | string | Why it was suppressed. The model gives no vocabulary; the only modelled trigger is SuppressOnNodeUnavailable (node suspended or retired). |
ListingRestored
| Field | Type | Meaning |
|---|---|---|
listingId | string | The listing (also subject). |
nodeId | string | Its node. |
InventoryFeedApplied
| Field | Type | Meaning |
|---|---|---|
feedId | string | The feed (also subject). |
nodeId | string | The node the feed is for. |
fullUpdate | boolean | True for a full feed. |
lineCount | integer | Lines in the feed as received. |
appliedAt | string (date-time) | When the feed reached APPLIED. |
Example envelope
ListingAvailabilityChanged is the event the promise and sourcing read
models depend on most:
{
"specversion": "1.0",
"id": "5b0f8a52-3c1e-4d7a-9f4e-2a6d1c9e7b31",
"source": "/retailnetwork/offer-availability",
"type": "com.retailnetwork.commerce.offer-availability.listing.ListingAvailabilityChanged",
"subject": "LST-000184",
"time": "2026-10-22T14:05:12Z",
"datacontenttype": "application/json",
"dataschema": "urn:retailnetwork:offer-availability:events:ListingAvailabilityChanged:v1",
"data": {
"listingId": "LST-000184",
"catalogItemId": "CI-004512",
"nodeId": "NODE-VWS-FC01",
"availableQty": 120,
"basis": "THROUGHPUT_CONSTRAINED",
"asOf": "2026-10-22T14:00:00Z",
"feedId": "FEED-20261022-0007"
}
}
The identifiers are synthetic examples; the model fixes no id format.
Consumed
All four come from node-topology on retailnetwork.node-topology.events
(tier logistics, entity node). Proposed consumer group:
offer-availability-node-status.
| Event | Full type | Fields used | What this context does |
|---|---|---|---|
NodeRegistered | com.retailnetwork.logistics.node-topology.node.NodeRegistered | nodeId, nodeType, operator, vendorId | Inserts the node into NodeStatusView with status PROPOSED (the first state of node-topology's Node). |
NodeActivated | com.retailnetwork.logistics.node-topology.node.NodeActivated | nodeId, activatedAt | Sets the node ACTIVE in NodeStatusView; then, per SuppressOnNodeUnavailable, RestoreListing on every listing of the node suppressed for node unavailability. |
NodeSuspended | com.retailnetwork.logistics.node-topology.node.NodeSuspended | nodeId, reason, suspendedAt | Sets the node SUSPENDED; then SuppressListing on every LIVE listing of the node. |
NodeRetired | com.retailnetwork.logistics.node-topology.node.NodeRetired | nodeId, retiredAt | Sets the node RETIRED; then SuppressListing on every LIVE listing of the node. |
NodeRegistered also carries subtype, vendorNodeCode, regionId,
timezone, postalCode and countryCode; this context does not use them.
Three more come from seller-inbound on retailnetwork.seller-inbound.events
(tier partner), on the consumer group SELLER_INBOUND_CONSUMER_GROUP
(service ADRs 0013 and 0014). Every other type on that topic is acknowledged
and counted, never dead-lettered.
| Event | Full type | Fields used | What this context does |
|---|---|---|---|
SellerSuspended | com.retailnetwork.partner.seller-inbound.seller.SellerSuspended | sellerId, suspendedAt | Sets the seller SUSPENDED in SellerStatusView; every LIVE listing of the owner is suppressed with OWNER_SUSPENDED (gap G48). |
SellerReinstated | com.retailnetwork.partner.seller-inbound.seller.SellerReinstated | sellerId, reinstatedAt | Sets the seller ACTIVE; every OWNER_SUSPENDED listing of the owner is reconciled: LIVE when no other cause holds, otherwise suppressed with the remaining highest cause. |
InboundShipmentReceived | com.retailnetwork.partner.seller-inbound.inboundshipment.InboundShipmentReceived | sellerId, nodeId, received | Creates the missing owner listing per received item at availability 0 / UNKNOWN, suppressed when a cause holds; an existing listing is left as it is (gap G51). |
As built (service ADR 0015) the context also consumes one event of
customer-returns, from retailnetwork.customer-returns.events:
| Event | Full type | Fields used | What this context does |
|---|---|---|---|
ReturnCompleted | com.retailnetwork.commerce.customer-returns.returnauthorization.ReturnCompleted | authorizationId, nodeId, lines, receivedAt | Per line, raises the available quantity of the listing of (catalogItemId, nodeId, ownerRef) by qtyRestockable: a delta, not a snapshot. A line with nothing restockable, without a usable item or without a listing is skipped and counted. Unsellable units touch no listing, and no listing is created from a return (policy RestockOnReturnCompleted). |
Idempotency and ordering
- Inbox. Each consumed CloudEvents
idis recorded inprocessed_eventsin the same transaction as the view update, the listing changes and their outbox rows. A redeliveredidis skipped (conventions.integration_rules: "Every consumer is idempotent on the CloudEvents id"). - Dispatch on the full type string, never on a suffix.
- Order per node.
node-topologykeys bynodeId, so one node's events arrive in order on one partition. - Replays are safe. Suppressing a
SUPPRESSEDlisting or restoring aLIVEone is a no-op that raises no event (proposed).
Packaging and owner fields
Built, ADR 0009 as realized by
offer-availabilityADR 0006 (catalogue GTIN and packaging hierarchy, and the optional owner of a listing). This section is the delta the seller-inbound design added to this page; where the service decided differently, the text below says so.
CatalogItemPackagingDeclared (entity catalogitem, subject catalogItemId)
| Field | Type | Meaning |
|---|---|---|
catalogItemId | string | The item. |
level | enum | EACH, INNER, CASE or PALLET: the one level this event declares. |
gtin | string | The level's GTIN, 14 digits. |
childGtin | string, optional | The next lower level's GTIN; absent for EACH. |
unitsPerPack | integer | Direct factor to eaches: at least 2 above EACH, 1 for EACH. |
declaredAt | RFC 3339 instant | When the level was declared. |
CatalogItemPackLevelRetired (same entity and subject)
| Field | Type | Meaning |
|---|---|---|
catalogItemId, level, gtin | string | The level that ends. It is retired (inactive), not deleted, so shipments in flight still validate. |
retiredAt | RFC 3339 instant | When the level was retired. |
ListingCreated and ListingAvailabilityChanged gain an optional
ownerRef (the seller of record; absent means the vendor's own stock). Both
are additive, so the :v1 data schema stays v1; no existing consumer reads
the field.
Quantities everywhere stay in eaches.