Skip to main content

Domain Message Flow

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 ddd-crew Domain Message Flow Modelling. Four scenarios. Participants are contexts and actors, abbreviated by context code: NF = network-fulfillment (the fleet, vendor V-WS), VC = vendor-connectivity, OA = offer-availability, NT = node-topology, DP = delivery-promise, OS = order-sourcing, ST = shipping-and-tracking, NP = node-performance. Every arrow is a message from model.yaml, prefixed cmd: (command), qry: (query) or evt: (event). Event arrows are written <entity>.<EventName>; the full type is com.retailnetwork.<tier>.<producer>.<entity>.<EventName> (see Domain Events). Path parameters are written without braces. The domain-wide flows are on Domain Message Flows.

1. A full inventory feed is applied (happy path)​

Derived from: model.yaml → contexts[vendor-connectivity].inbound, .sync_calls, .aggregates[Submission], .publishes[SubmissionProcessed]; contexts[offer-availability].aggregates[InventoryFeed], .publishes[InventoryFeedApplied].

The same apply, seen from the availability consumers:

Derived from: model.yaml → contexts[offer-availability].publishes[ListingAvailabilityChanged], .policies[FullFeedZeroing], .aggregates[Listing]; contexts[delivery-promise].read_models[AvailabilityView], contexts[order-sourcing].read_models[AvailabilityView].

Omitted: vendor-connectivity's ownership check (ErrNodeNotOwnedByVendor) and rate limiting; the outbox relay between commit and Kafka, so the event arrows may be seen after the reply; the listings whose line was stale, which raise no event. One ListingAvailabilityChanged goes out per changed listing; the diagram shows one arrow per consumer. A partial feed is the same flow without zeroing.

2. A feed is refused, or changes nothing (failure path)​

Derived from: model.yaml → contexts[offer-availability].aggregates[InventoryFeed].invariants, .aggregates[Listing].invariants, .publishes[InventoryFeedApplied]; contexts[vendor-connectivity].aggregates[Submission], .publishes[SubmissionProcessed].

Omitted: what vendor-connectivity does with a 409 on a feed it already applied (its ErrSubmissionAlreadyProcessed guards its own side). The problem type slugs and status codes follow the service's apis/openapi.yaml (Use Cases). A feed older than the node's last applied feed ends SUPERSEDED and a FAILED feedId may be sent again (ADR 0002 A11).

3. A node is suspended, then activated again​

Derived from: model.yaml → contexts[node-topology].inbound, .aggregates[Node].transitions, .publishes; contexts[offer-availability].policies[SuppressOnNodeUnavailable], .read_models[NodeStatusView], .publishes.

Omitted: one ListingSuppressed / ListingRestored goes out per listing; the diagram shows one arrow per consumer. delivery-promise and order-sourcing also consume NodeSuspended and NodeActivated directly; those arrows are on their pages. NodeRetired follows the first half of this flow and is never followed by NodeActivated (RETIRED is terminal in node-topology).

4. A catalogue item is created, listed and browsed​

Derived from: model.yaml → contexts[offer-availability].inbound, .rest, .aggregates[CatalogItem], .publishes[CatalogItemCreated].

Then the item is listed on a node:

Derived from: model.yaml → contexts[offer-availability].inbound, .rest, .aggregates[CatalogItem], .aggregates[Listing].invariants, .publishes.

Omitted: DiscontinueItem (one command, one CatalogItemDiscontinued to delivery-promise and order-sourcing); the listing has no availability until the node's first feed names it.