Skip to main content

Context map

Following ddd-crew Context Mapping. This is Delivery Promise's slice of the retail-network map (the domain context map on the aggregator): every relationship, with upstream (U) and downstream (D) side, pattern and channel. The patterns are the aggregator model's classification; the channels and messages were checked against this repository's code and the neighbours' origin/develop.

Delivery Promise is downstream of the data owners it builds local read models from, and upstream of the contexts that act on a promise. customer-ordering and order-sourcing are both: one relationship per message flow.

Upstream: the data the promise is built from​

Source: internal/adapters/inbound/kafka/dispatch.go (Handlers).

Partners in the order flow, and downstream​

Source: apis/openapi.yaml, apis/asyncapi.yaml, and the consumers' handlers.go on origin/develop (customer-ordering, order-sourcing, node-performance).

Legend: ==> event flow over Kafka, --> synchronous REST (the arrow points from the server, the upstream, to the caller), -.-> published with no consuming context. Omitted: Postgres and Kafka themselves.

Relationships​

NeighbourDirectionPatternChannelMessagesWhy
node-topology (Supporting)U to D (this context downstream)OHS + PL / ConformistKafka retailnetwork.node-topology.eventsNodeRegistered, NodeOperationalProfileDeclared, NodeActivated, NodeSuspended, NodeRetired, LaneOpened, LaneClosed, ServiceAreaAssigned, RegionDefinedMaster data with many consumers; taken as published into rm_nodes, rm_lanes, rm_areas, rm_regions
offer-availability (Supporting)U to DOHS + PL / ConformistKafka retailnetwork.offer-availability.eventsCatalogItemCreated, CatalogItemDiscontinued, ListingCreated, ListingAvailabilityChanged, ListingSuppressed, ListingRestoredavailability per listing used as published, never re-derived
linehaul-transportation (Supporting)U to DOHS + PL / ConformistKafka retailnetwork.linehaul-transportation.eventsDepartureScheduled, DepartureCapacityChanged, DepartureCancelled, BookingMoved, BookingFailed, LoadDeparted, LoadArriveddepartures are the edges of the search graph; cancelled, moved or failed ones put promises at risk; load departures and arrivals pair into the measured transit a MEASURED quote rests on (ADR 0014)
last-mile-delivery (Supporting)U to DOHS + PL / ConformistKafka retailnetwork.last-mile-delivery.eventsDeliveryWaveScheduled, DeliveryWaveCapacityChanged, DeliveryWaveCancelled, PackageInductionDeferredwaves give the promise window and stop capacity
node-performance (Supporting)U to DOHS + PL / ConformistKafka retailnetwork.node-performance.eventsNodeScorecardUpdated, NodeTierEligibilityChangedthe grade is used as published; the handicap rule is this context's own. The eligibility decision for the fast tiers is node-performance's too: this context only drops the ineligible nodes from SAME_DAY and NEXT_DAY candidates (ADR 0022)
shipping-and-tracking (Generic)U to DOHS + PL / ConformistKafka retailnetwork.shipping-and-tracking.eventsPackageDelivered, PackageExceptionRaised, PackageLost, PackageReturnedpackage facts drive judgement and risk
customer-ordering (Generic)this context U, CO DCustomer/Supplier (CO is the Customer)REST POST /promises, /confirmations, /cancellations; Kafka retailnetwork.delivery-promise.eventsmake, confirm, cancel; PromiseAtRisk, PromiseRevised, PromiseKept, PromiseBroken, PromiseUnkeepablecheckout needs an answer inside the shopper's request; CO's order status depends on promise changes. Verified in customer-ordering's gateway and Kafka handlers
customer-ordering (Generic)CO U, this context DCustomer/SupplierKafka retailnetwork.customer-ordering.eventsCustomerOrderPlaced, CustomerOrderCancelledplacing the order confirms provisional promises; cancelling releases them
order-sourcing (Core)OS U, this context DCustomer/SupplierKafka retailnetwork.order-sourcing.eventsFulfillmentLocked, FulfillmentShipped, FulfillmentUnsourceablean unsourceable group comes back to re-promise; sourcing never breaks a promise silently
order-sourcing (Core)this context U, OS DCustomer/SupplierKafka retailnetwork.delivery-promise.eventsPromiseRevised, PromiseBookExhausteda revised window changes the sourcing constraint; an exhausted book raises the cost of that cutoff. Verified in order-sourcing's handlers.go
Shopper / storefront (shopping-cart, storefront-bff)this context UOpen HostREST POST /delivery-quotesquoteany client may ask for a quote; no contract is negotiated per client. Verified in both clients' allowlists
node-performance (Supporting)this context U, NP DOHS + PL / ConformistKafka retailnetwork.delivery-promise.eventsPromiseKept, PromiseBrokenNP counts kept and broken promises per node. Verified in node-performance's handlers.go
analytics (no context)this context UPublished LanguageKafka retailnetwork.delivery-promise.analyticsPromiseMade, PromiseConfirmed, PromiseReleased, PromiseCancelled, DeliveryOfferQuoted, PromisePolicyPublished, DeliveryRequestAnsweredpublished for the record; no consumer found
warehouse-ops-agentthis context Uread-only MCP/mcp on delivery-promise-mcp:8090six toolsconfigured in warehouse-infra
vendor-connectivity (Supporting)noneSeparate Waysnonenonethe vendor side starts after order-sourcing releases a group
warehouse-systems fleetnoneSeparate Ways (hard boundary)nonenoneno warehouse.* topic is read and no fleet service is called; the only seam is the Vendor API, which this context does not use

Notes on the patterns​

  • Conformist, with no ACL, toward the data owners. Every upstream publishes the vocabulary this context needs under the same language; the read models store it as published. A Shared Kernel is avoided: order-sourcing builds its own network graph from the same events and the two contexts share no code or table.
  • Customer/Supplier, both ways, with the two order-flow contexts. The contracts were shaped for each other: PromiseMade's fields are what checkout needs, CustomerOrderPlaced carries each group's promiseId, and FulfillmentUnsourceable carries the promiseId back. It is not a Partnership: each side releases its half on its own schedule because every message is versioned (dataschema ...:v1).
  • No synchronous call out. Every input of the promise hot path is a local read model. A neighbour that is down slows freshness, not quotes. See Integration for failure behaviour.