Skip to main content

Context Map

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 Context Mapping. This is order-sourcing's slice of the network context map: every relationship this context has, with the upstream (U) and downstream (D) side, the pattern and the channel. The slice is drawn as two diagrams (upstream, downstream) to stay readable. Four neighbours appear on both sides: this context consumes from them and they consume from it. The pattern for each direction is the one the downstream side's inbound row declares.

Upstream of order-sourcing​

Derived from: model.yaml → contexts[order-sourcing].inbound, .consumes; classification labels from each neighbour's classification.

Downstream of order-sourcing​

Derived from: model.yaml → contexts[order-sourcing].publishes (consumers), .rest, .inbound (the planner row); the inbound rows of vendor-connectivity, linehaul-transportation, delivery-promise and customer-ordering; meta.hard_boundary; external[network-fulfillment].

Legend: solid arrows point from upstream to downstream; the dotted line without an arrow head is a deliberately absent relationship. Node*, Lane*, Listing*, Departure*, DeliveryWave* and PurchaseOrder* stand for the full event lists in the table below. The vendor-connectivity → network-fulfillment edge is drawn only to show where the fleet sits; it is not this context's relationship.

Omitted: analytics-only events (FulfillmentQueued, FulfillmentDelivered, no domain consumer), Postgres and Kafka as infrastructure, and the future contexts (customer-returns, customer-notification, payments-and-invoicing), which have no edge here.

Relationships​

NeighbourDirectionPatternChannelMessagesWhy this pattern
customer-ordering (Generic)U → OSCustomer/SupplierKafka retailnetwork.customer-ordering.eventsCustomerOrderPlaced, CustomerOrderCancelledSourcing needs every group with its promise constraint (groups(groupNo, promiseId, tier, witnessNodeId, shipBy, deliverByEarliest, deliverByLatest, lines)); the event's shape is negotiated for this consumer.
customer-ordering (Generic)OS → UConformist (customer-ordering conforms)Kafka retailnetwork.order-sourcing.eventsFulfillmentLocked, FulfillmentShipped, FulfillmentUnsourceablecustomer-ordering only reflects sourcing facts into its status and tracking view; it takes them as published.
delivery-promise (Core)U → OSCustomer/SupplierKafka retailnetwork.delivery-promise.eventsPromiseRevised, PromiseBookExhaustedThe re-promise answers this context's FulfillmentUnsourceable; book exhaustion feeds bookPressurePenalty.
delivery-promise (Core)OS → UCustomer/SupplierKafka retailnetwork.order-sourcing.eventsFulfillmentUnsourceable, FulfillmentLockedThe two Core contexts form a loop: unsourceable → re-promise → re-queue (ADR 0002). Each side is the other's customer for one message pair.
vendor-connectivity (Supporting)OS → UCustomer/SupplierKafka retailnetwork.order-sourcing.eventsFulfillmentReleasedToNode, FulfillmentReleaseWithdrawn, FulfillmentCancelledvendor-connectivity cancels the issued purchase order of a withdrawn release and turns a release (one order, even for a merged release) into a purchase order (IssueOnRelease, poNumber idempotent on assignmentId + releaseNo) and cancels it on FulfillmentCancelled (CancelOnSourcingCancel).
vendor-connectivity (Supporting)U → OSCustomer/SupplierKafka retailnetwork.vendor-connectivity.eventsPurchaseOrderAccepted, PurchaseOrderRejected, PurchaseOrderExpired, VendorShipmentConfirmedThe outcomes carry assignmentId and releaseNo for this consumer; acceptance is the path lock (ADR 0005).
linehaul-transportation (Supporting)U → OSConformistKafka retailnetwork.linehaul-transportation.eventsDepartureScheduled, DepartureCapacityChanged, DepartureCancelledDepartures are linehaul's published facts; they feed NetworkGraphView.
linehaul-transportation (Supporting)OS → UCustomer/SupplierKafka retailnetwork.order-sourcing.eventsFulfillmentReleasedToNode, FulfillmentReassigned, FulfillmentLocked, FulfillmentCancelledlinehaul expects volume (ExpectedVolumeView) and books the pickup on lock (BookOnLock).
shipping-and-tracking (Generic)U → OSConformistKafka retailnetwork.shipping-and-tracking.eventsPackageDeliveredA tracking fact, taken as published; drives MarkDelivered.
node-topology (Supporting)U → OSConformistKafka retailnetwork.node-topology.eventsNodeRegistered, NodeOperationalProfileDeclared, NodeActivated, NodeSuspended, NodeRetired, LaneOpened, LaneClosed, ServiceAreaAssigned, RegionDefinedMaster data of the network's shape; feeds NodeProfileView and NetworkGraphView.
offer-availability (Supporting)U → OSConformistKafka retailnetwork.offer-availability.eventsListingCreated, ListingAvailabilityChanged, ListingSuppressed, ListingRestored, CatalogItemDiscontinuedWhich node can ship which item, and the listingId a release must carry; feeds AvailabilityView.
last-mile-delivery (Supporting)U → OSConformistKafka retailnetwork.last-mile-delivery.eventsDeliveryWaveScheduled, DeliveryWaveCapacityChangedWave capacity for the last leg of a candidate; feeds NetworkGraphView.
node-performance (Supporting)U → OSConformistKafka retailnetwork.node-performance.eventsNodeScorecardUpdatedMeasured performance; feeds scorecardPenalty through ScorecardView.
Network-ops planner (person)OS → plannerOpen Host (UI)REST GET /assignments?state=&nodeId=&orderId=, GET /assignments/{assignmentId}, POST /assignments/{assignmentId}/reoptimisationsListAssignments, GetAssignment, ReoptimiseAssignmentAn operator surface; the model's inbound row calls it UI.
network-fulfillment (warehouse-systems fleet, other organization; Supporting in the fleet)noneSeparate Ways——The hard boundary: no retail-network context calls a fleet service or reads a fleet topic. The fleet reaches this context's decisions only as purchase orders it polls from vendor-connectivity's Vendor API (vendor API).

Notes on the patterns​

  • Customer/Supplier both ways with delivery-promise. Not a Shared Kernel: no model element is shared. The promise constraint crosses as four fields inside CustomerOrderPlaced, and the loop closes with FulfillmentUnsourceable → PromiseRevised.
  • Conformist to the logistics and partner master data. Topology, availability, departures, waves and scorecards are consumed as published into local read models. Their owners do not adapt to this context.
  • No synchronous dependency. sync_calls is empty: every decision is made from local, event-fed read models, so a neighbour outage delays freshness, never a release.
  • No Anti-Corruption Layer is needed. Every neighbour speaks the same network language. The ACL toward the fleet lives in the fleet (network-fulfillment), behind vendor-connectivity's Open Host Service.