Skip to main content

Domain Events

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.

Every event this context publishes, with its full CloudEvents type, and the (empty) list of events it consumes. The envelope rules are the domain-wide event standard.

Envelope​

AttributeValue
specversion1.0 (structured JSON, mandatory on every Kafka message)
ida UUID minted once when the outbox row is written; a relay retry re-sends the same id
source/retailnetwork/node-topology
typecom.retailnetwork.logistics.node-topology.<entity>.<EventName>; tier logistics; entity node, lane, servicearea or region
subjectthe aggregate root id: nodeId, laneId, postalPrefix or regionId
timethe instant the change was committed, UTC
datacontenttypeapplication/json
dataschemaurn:retailnetwork:node-topology:events:<EventName>:v1
Topicretailnetwork.node-topology.events
Kafka keythe same aggregate root id as subject, so one aggregate's events stay in order on one partition

Every event leaves through a transactional outbox, written in the same transaction as the aggregate (model conventions.integration_rules).

Derived from: model.yaml → conventions.cloudevents, conventions.integration_rules.

Published​

Summary​

EventFull typeSubject / keyProducing commandConsumers
NodeRegisteredcom.retailnetwork.logistics.node-topology.node.NodeRegisterednodeIdRegisterNodeoffer-availability, delivery-promise, order-sourcing, linehaul-transportation, last-mile-delivery, node-performance, vendor-connectivity, seller-inbound
NodeOperationalProfileDeclaredcom.retailnetwork.logistics.node-topology.node.NodeOperationalProfileDeclarednodeIdDeclareOperationalProfiledelivery-promise, order-sourcing, linehaul-transportation, node-performance, vendor-connectivity, seller-inbound
NodeActivatedcom.retailnetwork.logistics.node-topology.node.NodeActivatednodeIdActivateNodeoffer-availability, delivery-promise, order-sourcing, linehaul-transportation, vendor-connectivity, seller-inbound
NodeSuspendedcom.retailnetwork.logistics.node-topology.node.NodeSuspendednodeIdSuspendNodeoffer-availability, delivery-promise, order-sourcing, linehaul-transportation, vendor-connectivity, seller-inbound
NodeRetiredcom.retailnetwork.logistics.node-topology.node.NodeRetirednodeIdRetireNodeoffer-availability, delivery-promise, order-sourcing, linehaul-transportation, vendor-connectivity, seller-inbound
LaneOpenedcom.retailnetwork.logistics.node-topology.lane.LaneOpenedlaneIdOpenLanelinehaul-transportation, delivery-promise, order-sourcing
LaneCostDeclaredcom.retailnetwork.logistics.node-topology.lane.LaneCostDeclaredlaneIdDeclareLaneCostorder-sourcing
LaneEmissionDeclaredcom.retailnetwork.logistics.node-topology.lane.LaneEmissionDeclaredlaneIdDeclareLaneEmissionorder-sourcing
LaneClosedcom.retailnetwork.logistics.node-topology.lane.LaneClosedlaneIdCloseLanelinehaul-transportation, delivery-promise, order-sourcing
ServiceAreaAssignedcom.retailnetwork.logistics.node-topology.servicearea.ServiceAreaAssignedpostalPrefixAssignServiceAreadelivery-promise, order-sourcing, last-mile-delivery
RegionDefinedcom.retailnetwork.logistics.node-topology.region.RegionDefinedregionIdDefineRegiondelivery-promise, order-sourcing

Derived from: model.yaml → contexts[node-topology].publishes, .aggregates[*].events.

The data field lists below are exactly the model's data lists. Types and descriptions are the proposed wire format.

NodeRegistered​

Producing use case: RegisterNode. What consumers do with it: build their node read models (NodeStatusView, NodeProfileView, StationView, VendorNodeView).

FieldTypeMeaning
nodeIdstringThe network's id of the node
nodeTypeenumFULFILLMENT_CENTER, INBOUND_CROSS_DOCK, RETURNS_CENTER, SORTATION_CENTER, DELIVERY_STATION, AIR_HUB
subtypeenum, nullableA FULFILLMENT_CENTER subtype; null otherwise
operatorenumNETWORK or VENDOR
vendorIdstring, nullableSet when operator is VENDOR
vendorNodeCodestring, nullableThe vendor's own code; set when operator is VENDOR
regionIdstringThe node's region
timezonestringIANA time zone of the building
postalCodestringPostal code of the building
countryCodestringISO 3166-1 alpha-2

Capabilities are not on the wire: consumers derive them from nodeType (policy DefaultCapabilitiesByType, model node_types).

NodeOperationalProfileDeclared​

Producing use case: DeclareOperationalProfile. What consumers do with it: linehaul-transportation (re)generates pickup departures per cutoff (PickupFromCutoffs); delivery-promise and order-sourcing update NodeProfileView (handling time, cutoffs, throughput cap); node-performance records the declaration it will measure against.

FieldTypeMeaning
nodeIdstringThe node
profileRevisionintegerStrictly increasing per node
timezonestringIANA time zone the local times are in
operatingHoursByDayobject{monday … sunday: {start, end}}, local times as HH:mm; a missing day is closed
holidaysarray of ISO datesDays the node is closed all day
handlingTimeMinutesintegerDeclared time from order release to a package ready for handover
cutoffsarray of {localTime, days?, maxOrders?}localTime (HH:mm) is when packages are ready for handover; days lists the weekdays it applies to (default: every operating day); maxOrders optional
throughputCap{value, timeUnit, unit}Maximum orders per time unit; value is an integer above zero, timeUnit is HOUR or DAY, unit is ORDER
sortDwellMinutesinteger, optionalDeclared sort dwell; present only for SORTATION_CENTER and AIR_HUB nodes
inboundobject, optionalProposed (ADR 0009): {maxCartonWeightG, maxCartonDimsMm{l,w,h}, acceptsPallets, requiresSscc}; present only for nodes with the INBOUND capability. Additive: a consumer that ignores it is unaffected.
declaredByenumVENDOR or NETWORK_OPS

NodeActivated​

Producing use case: ActivateNode. Consumers mark the node sellable and promisable; offer-availability restores listings it suppressed for the node's unavailability.

FieldTypeMeaning
nodeIdstringThe node
activatedAttimestampWhen it became ACTIVE

NodeSuspended​

Producing use case: SuspendNode. offer-availability suppresses the node's listings; linehaul-transportation cancels future pickups.

FieldTypeMeaning
nodeIdstringThe node
reasonstringWhy the planner suspended it
suspendedAttimestampWhen it became SUSPENDED

NodeRetired​

Producing use case: RetireNode. Same reactions as NodeSuspended, for good.

FieldTypeMeaning
nodeIdstringThe node
retiredAttimestampWhen it became RETIRED

LaneOpened​

Producing use case: OpenLane. linehaul-transportation may schedule departures on it; delivery-promise and order-sourcing add it to their graph.

FieldTypeMeaning
laneIdstringThe lane
originNodeIdstringOrigin node
destinationNodeIdstringDestination node
modeenumGROUND or AIR
nominalTransitMinutesintegerNominal transit time

LaneCostDeclared​

Producing use case: DeclareLaneCost, on every declaration; a newer declaration supersedes the previous value. A lane that was never declared on publishes nothing. order-sourcing keeps the latest declaration per laneId and folds the declared cents into its money-denominated assignment cost (node-topology ADR 0014).

FieldTypeMeaning
laneIdstringThe lane
costPerUnitCentsintegerThe planner's declared marginal cost of moving one package-unit across the lane on one departure, integer cents (0 to 10000000; 0 is a legal declaration; no currency field)
declaredAttimestampWhen the planner declared it

LaneEmissionDeclared​

Producing use case: DeclareLaneEmission, on every declaration; a newer declaration supersedes the previous value. A lane that was never declared on publishes nothing. order-sourcing keeps the latest declaration per laneId and records it in its carbon estimate; its ranking does not change (node-topology ADR 0018).

FieldTypeMeaning
laneIdstringThe lane
gCo2ePerUnitintegerThe planner's declared carbon emission of moving one package-unit across the lane on one departure, grams of CO2-equivalent (0 to 10000000; 0 is a legal declaration)
declaredAttimestampWhen the planner declared it

LaneClosed​

Producing use case: CloseLane.

FieldTypeMeaning
laneIdstringThe lane
closedAttimestampWhen it closed

ServiceAreaAssigned​

Producing use case: AssignServiceArea.

FieldTypeMeaning
postalPrefixstringThe postal prefix
deliveryStationNodeIdstringThe DELIVERY_STATION that serves it
regionIdstringThe station's region
assignmentVersionintegerStrictly increasing per prefix; consumers keep the highest

RegionDefined​

Producing use case: DefineRegion.

FieldTypeMeaning
regionIdstringThe region
codestringUnique short code
namestringDisplay name

Example envelope​

NodeOperationalProfileDeclared is the event most decisions downstream depend on: pickup departures, promise cutoffs and the throughput cap all come from it. One complete envelope, with illustrative values:

{
"specversion": "1.0",
"id": "3f6c2a9e-8b1d-4c7a-9e55-0d2f6b7a1c44",
"source": "/retailnetwork/node-topology",
"type": "com.retailnetwork.logistics.node-topology.node.NodeOperationalProfileDeclared",
"subject": "node-0f3a91",
"time": "2026-10-22T13:05:12Z",
"datacontenttype": "application/json",
"dataschema": "urn:retailnetwork:node-topology:events:NodeOperationalProfileDeclared:v1",
"data": {
"nodeId": "node-0f3a91",
"profileRevision": 3,
"timezone": "America/Sao_Paulo",
"operatingHoursByDay": {
"monday": {"start": "06:00", "end": "22:00"},
"tuesday": {"start": "06:00", "end": "22:00"},
"wednesday": {"start": "06:00", "end": "22:00"},
"thursday": {"start": "06:00", "end": "22:00"},
"friday": {"start": "06:00", "end": "22:00"},
"saturday": {"start": "08:00", "end": "14:00"}
},
"holidays": ["2026-12-25"],
"handlingTimeMinutes": 240,
"cutoffs": [
{"localTime": "11:00"},
{"localTime": "18:00", "days": ["monday", "tuesday", "wednesday", "thursday", "friday"], "maxOrders": 1200}
],
"throughputCap": {"value": 400, "timeUnit": "HOUR", "unit": "ORDER"},
"declaredBy": "VENDOR"
}
}

The values are illustrative. Sunday is absent, so the node is closed on Sunday. The 11:00 cutoff has no days, so it applies to every operating day (Monday to Saturday); the 18:00 cutoff names Monday to Friday because Saturday closes at 14:00 (ErrCutoffOutsideOperatingHours). The example is a fulfillment centre, so it carries no sortDwellMinutes (ErrSortDwellNotAllowed).

Consumed​

None. The model's consumes list for node-topology is empty, so the context has no Kafka consumer, no consumer group and no inbox to dedupe. Its inputs are the REST commands listed on Use Cases.

Analytics​

The model names no analytics event for this context, so nothing is published on retailnetwork.node-topology.analytics.