Skip to main content

Bounded Context Canvas

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 the ddd-crew Bounded Context Canvas v5. Every message row comes from contexts[node-topology].inbound, .rest, .publishes and .sync_calls in the model, and from the neighbours' consumes and sync_calls entries that name this context.

Canvas at a glance​

Two pictures of the sections below, laid out like the ddd-crew canvas: first the inbound collaborators (with the purpose, domain roles and business decisions of this context), then the outbound collaborators it notifies. Arrows follow the message type: solid blue commands (cmd), dotted green queries (qry), thick orange events (evt). Box shapes mark the collaborator kind: rounded = people or any client; blue = sibling bounded context. Path parameters are written without braces inside the diagrams.

Inbound​

Outbound​

Derived from: model.yaml → contexts[node-topology].inbound, .publishes, .sync_calls (empty), .purpose, .roles, .business_decisions; and the consumes lists of the seven consumers.

The diagrams omit: assumptions, verification metrics, open questions and the ubiquitous language (sections below); the relationship pattern per message (see the tables); the full CloudEvents types (see the Outbound table); and customer-ordering and shipping-and-tracking, which have no edge to this context. There is no outbound command or query: sync_calls is empty.

Name​

Node Topology (node-topology, code NT, CloudEvents tier logistics).

Purpose​

To be the authoritative registry of the network's physical shape:

  • every node: vendor fulfillment centres, inbound cross-docks and returns centres, and the network's own sortation centres, delivery stations and air hubs;
  • each node's declared operational profile, versioned;
  • the directed lanes between nodes;
  • the regions;
  • which delivery station serves which postal prefix.

It holds declared facts. It does not schedule, promise, assign or measure.

Strategic Classification​

AxisVerdict
DomainSupporting. See Core Domain Chart.
Business ModelEnabler: every promise, assignment and route rests on it.
EvolutionCustom-built. The operational profile is shaped after a Product surface (the supply-source (multi-location inventory) API, see the vendor platform API surface map).

Domain Roles​

RoleApplies?Evidence in the model
SpecificationYes, primaryIt specifies the shape every other logistics decision works within: node types, allowed lane pairs, service areas.
Gateway for declared capability (owner)YesVendors' declarations (DeclareOperationalProfile, declaredBy: VENDOR) arrive here, through vendor-connectivity, and leave as NodeOperationalProfileDeclared.
Master dataYesLow write rate, many readers: nine events, seven consuming contexts, three read queries for any context.
Execution, Analysis, EnforcerNoIt makes no per-order decision and measures nothing.

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
vendor-connectivityRegisterNode (vendor node)CommandREST POST /nodes (in-org)Customer/Supplier (this context is the Supplier)
vendor-connectivityDeclareOperationalProfileCommandREST PUT /nodes/{nodeId}/operational-profile (in-org)Customer/Supplier
network-ops plannerRegisterNode (network node)CommandREST POST /nodesUI
network-ops plannerActivateNodeCommandREST POST /nodes/{nodeId}/activationsUI
network-ops plannerSuspendNodeCommandREST POST /nodes/{nodeId}/suspensionsUI
network-ops plannerRetireNodeCommandREST POST /nodes/{nodeId}/retirementsUI
network-ops plannerOpenLaneCommandREST POST /lanesUI
network-ops plannerCloseLaneCommandREST POST /lanes/{laneId}/closuresUI
network-ops plannerAssignServiceAreaCommandREST PUT /service-areas/{postalPrefix}UI
network-ops plannerDefineRegionCommandREST POST /regionsUI
Any contextGetNodeQueryREST GET /nodes/{nodeId}Open Host Service
Any contextlist nodes (no message name in the model)QueryREST GET /nodes?type=&region=&status=Open Host Service
Any contextListLanesQueryREST GET /lanes?origin=&destination=Open Host Service
Any contextResolveServiceAreaQueryREST GET /service-areas/{postalPrefix}Open Host Service

No inbound event: the model's consumes list for this context is empty. No neighbour declares a synchronous query to this context in its sync_calls; the only declared synchronous caller is vendor-connectivity, with the two commands above.

Outbound Communication​

Every event goes to topic retailnetwork.node-topology.events, source /retailnetwork/node-topology, through a transactional outbox.

CollaboratorMessageTypeChannelRelationship
offer-availability, delivery-promise, order-sourcing, linehaul-transportation, last-mile-delivery, node-performance, vendor-connectivityNodeRegisteredEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRegisteredOpen Host Service + Published Language (consumers Conformist)
delivery-promise, order-sourcing, linehaul-transportation, node-performanceNodeOperationalProfileDeclaredEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeOperationalProfileDeclaredOHS + PL (Conformist)
offer-availability, delivery-promise, order-sourcing, linehaul-transportation, vendor-connectivityNodeActivatedEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeActivatedOHS + PL (Conformist)
offer-availability, delivery-promise, order-sourcing, linehaul-transportation, vendor-connectivityNodeSuspendedEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeSuspendedOHS + PL (Conformist)
offer-availability, delivery-promise, order-sourcing, linehaul-transportation, vendor-connectivityNodeRetiredEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRetiredOHS + PL (Conformist)
linehaul-transportation, delivery-promise, order-sourcingLaneOpenedEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.lane.LaneOpenedOHS + PL (Conformist)
linehaul-transportation, delivery-promise, order-sourcingLaneClosedEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.lane.LaneClosedOHS + PL (Conformist)
delivery-promise, order-sourcing, last-mile-deliveryServiceAreaAssignedEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.servicearea.ServiceAreaAssignedOHS + PL (Conformist)
delivery-promise, order-sourcingRegionDefinedEventretailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.region.RegionDefinedOHS + PL (Conformist)

No outbound command or query (sync_calls: []). Full payloads: Domain Events. Relationship reasoning: Context Map.

Ubiquitous Language​

Full glossary: Ubiquitous Language. Top terms: Node, Node Type, Node Operator, Operational Profile (versioned by profileRevision), Cutoff, Handling Time, Throughput Cap, Lane, Region, Service Area.

Business Decisions​

  1. Parcel nodes are network-operated. A SORTATION_CENTER, DELIVERY_STATION or AIR_HUB always has operator NETWORK; a vendor registers only FULFILLMENT_CENTER, INBOUND_CROSS_DOCK or RETURNS_CENTER (ErrOperatorNotAllowedForNodeType).
  2. Demand only while ACTIVE and OUTBOUND. Capabilities come from the node type (DefaultCapabilitiesByType). The decision is applied by the consumers (offer-availability suppresses listings on a non-ACTIVE node, delivery-promise and order-sourcing read node status from their NodeProfileView).
  3. Profiles are versioned, never edited. profileRevision strictly increases (ErrStaleProfileRevision). A FULFILLMENT_CENTER needs at least one cutoff and a handlingTime above zero before activation (ErrIncompleteOperationalProfile), and every cutoff falls inside the operating hours of its day (ErrCutoffOutsideOperatingHours).
  4. Lanes follow the allowed type pairs, and both ends are ACTIVE when opened. ErrLaneLoop, ErrLaneTypePairNotAllowed, ErrLaneEndpointNotActive; at most one OPEN lane per origin, destination and mode (ErrDuplicateLane).
  5. One delivery station per postal prefix per assignment version. ErrNotADeliveryStation, ErrStaleAssignmentVersion.
  6. RETIRED is terminal (ErrNodeRetired).

Assumptions​

  • Vendors never call this context directly. Every vendor node arrives through vendor-connectivity, which has already checked that the vendor acts on its own nodes (ErrNodeNotOwnedByVendor is enforced there).
  • Write volume stays low (tens of node writes a day; lane and service-area bulk loads only at network redesign), so a single writer per aggregate and optimistic concurrency are enough.
  • Consumers keep their own read models from the events and never need a synchronous read on their hot path (model conventions.integration_rules).
  • The reference network has single-digit regions (eight in the model's size estimate).

Verification Metrics​

Proposed, measurable once built:

  • Event lag: time from a committed write to the outbox row being published on retailnetwork.node-topology.events, p95.
  • Pickup coverage: share of cutoffs of ACTIVE vendor FULFILLMENT_CENTER nodes for which linehaul-transportation has a pickup departure on the next operating day (target: all of them).
  • Unserved prefixes: count of postal prefixes resolved by GET /service-areas/{postalPrefix} with a 404, per day.
  • Stale-write rate: ErrStaleProfileRevision and ErrStaleAssignmentVersion responses per day (a high rate means callers race each other).
  • Refused parcel registrations: ErrOperatorNotAllowedForNodeType responses per vendor (vendors trying to register a parcel node).

Open Questions​

  • Lanes and service areas after a node leaves service. When a node is suspended or retired, its lanes stay OPEN and the prefixes assigned to a retired delivery station stay ASSIGNED. The model has no policy that closes or reassigns them.
  • Who declares a network node's profile? declaredBy allows NETWORK_OPS, but the planner's inbound row in the model does not list DeclareOperationalProfile.
  • A new profile on an ACTIVE fulfillment centre. The completeness rule holds "before activation". Whether a later revision may drop every cutoff is not stated.
  • Cutoffs have no day. CutoffSlot{localTime, maxOrders?} carries no day of week, so "inside the operating hours of their day" must be read as "inside the hours of every operating day".
  • Region membership is not checked. No invariant makes a node's or a service area's regionId name a defined region.
  • Not-found and illegal-transition errors (as built). The model names no Err... for an unknown nodeId, laneId or postalPrefix, nor for a transition outside the table; the service answers 404 not-found and 409 illegal-transition (shared problem types, apis/openapi.yaml).
  • Pickup points (open: service ADR 0017, merged in develop). The model's node_types has PICKUP_POINT (capability COLLECTION, operator NETWORK or PARTNER, never a lane endpoint), but these pages do not describe it: the node-types table, the operator rules, the servingStationNodeId on registration and its invariants, and the resulting use-case and sequence changes are not written up here. Needs a pass against docs/adr/0017-pickup-points.md in the service repo; not invented here.