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 maps to an entry of contexts[delivery-promise].inbound, .publishes, .consumes or .rest in the model.

Canvas at a glance​

Two pictures of the sections below, laid out like the ddd-crew canvas: first the inbound collaborators feeding this context (with its purpose, domain roles and the business decisions it enforces), then the outbound collaborators it notifies. Arrows follow the message type: solid blue commands (cmd), dotted green queries (qry), thick orange events (evt); each arrow names its channel and the messages it carries. Box shapes mark the collaborator kind: rounded = people, UI or any client; blue = sibling bounded context; grey = this context's own analytics stream; dashed = published with no consuming context ("analytics only" in the model). Channel names on the arrows are abbreviated; the tables below carry the exact route, topic and CloudEvents type for every message.

Inbound​

Outbound​

Derived from: model.yaml → contexts[delivery-promise].inbound, .publishes[*].consumers, .aggregates[DeliveryOffer].notes, .sync_calls (empty). The diagrams omit assumptions, verification metrics, open questions and the ubiquitous language (sections below), the relationship pattern per message (see the tables), the REST read routes with no named caller, and the replies to the two REST calls. Node* 5 stands for NodeRegistered, NodeOperationalProfileDeclared, NodeActivated, NodeSuspended, NodeRetired; Lane* 2 for LaneOpened, LaneClosed; CatalogItem* 2 for CatalogItemCreated, CatalogItemDiscontinued; Listing* 4 for ListingCreated, ListingAvailabilityChanged, ListingSuppressed, ListingRestored.

Name​

Delivery Promise (delivery-promise, code DP, CloudEvents tier commerce).

Purpose​

To tell a shopper, before and at purchase, the date a package will arrive, and to make that date true by construction:

  • a delivery offer is quoted only from a feasible witness path (node cutoff, scheduled departures, delivery wave) that has remaining capacity;
  • a promise holds that capacity on the witness node's pickup cutoff until the order is placed or the hold expires;
  • when the path breaks, the promise is revised to a later window, never an earlier one;
  • every promise is judged kept or broken at delivery.

Strategic Classification​

AxisVerdict
DomainCore (model classification: Core; chart differentiation 0.92, complexity 0.85). See the core domain chart page.
Business ModelRevenue generator (conversion) and cost reducer (no promise the network cannot keep).
EvolutionCustom-built.

Domain Roles​

RoleApplies?Evidence in the model
Execution (promising)Yes, primaryMakePromise, ConfirmPromise, RevisePromise, JudgePromise; the Promise lifecycle.
Analysis (feasibility search)YesQuoteDeliveryOffers and PromisePolicy: the earliest feasible witness path over seven read models.
Enforcer (capacity holds)YesPromiseBook: provisional + confirmed <= share (ErrPromiseCapacityExhausted); ReleaseExpiredHolds.
Gateway / ACLNoIt conforms to every upstream's published language; it translates nothing at its boundary.
SpecificationNoIt publishes promise facts, not capability specifications.

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
Shopper / storefrontQuoteDeliveryOffersQueryREST POST /delivery-quotesOpen Host
customer-orderingQuoteDeliveryOffersQueryREST POST /delivery-quotes (in-org)Customer/Supplier (DP is the Supplier)
customer-orderingMakePromiseCommandREST POST /promises (in-org)Customer/Supplier (DP is the Supplier)
customer-orderingCustomerOrderPlacedEventKafka retailnetwork.customer-ordering.events, com.retailnetwork.commerce.customer-ordering.customerorder.CustomerOrderPlacedCustomer/Supplier
customer-orderingCustomerOrderCancelledEventKafka retailnetwork.customer-ordering.events, com.retailnetwork.commerce.customer-ordering.customerorder.CustomerOrderCancelledCustomer/Supplier
order-sourcingFulfillmentUnsourceableEventKafka retailnetwork.order-sourcing.events, com.retailnetwork.commerce.order-sourcing.assignment.FulfillmentUnsourceableCustomer/Supplier
order-sourcingFulfillmentLockedEventKafka retailnetwork.order-sourcing.events, com.retailnetwork.commerce.order-sourcing.assignment.FulfillmentLockedCustomer/Supplier
shipping-and-trackingPackageDeliveredEventKafka retailnetwork.shipping-and-tracking.events, com.retailnetwork.logistics.shipping-and-tracking.journey.PackageDeliveredConformist
shipping-and-trackingPackageExceptionRaisedEventKafka retailnetwork.shipping-and-tracking.events, com.retailnetwork.logistics.shipping-and-tracking.journey.PackageExceptionRaisedConformist
linehaul-transportationDepartureScheduledEventKafka retailnetwork.linehaul-transportation.events, com.retailnetwork.logistics.linehaul-transportation.departure.DepartureScheduledConformist
linehaul-transportationDepartureCapacityChangedEventKafka retailnetwork.linehaul-transportation.events, com.retailnetwork.logistics.linehaul-transportation.departure.DepartureCapacityChangedConformist
linehaul-transportationDepartureCancelledEventKafka retailnetwork.linehaul-transportation.events, com.retailnetwork.logistics.linehaul-transportation.departure.DepartureCancelledConformist
last-mile-deliveryDeliveryWaveScheduledEventKafka retailnetwork.last-mile-delivery.events, com.retailnetwork.logistics.last-mile-delivery.wave.DeliveryWaveScheduledConformist
last-mile-deliveryDeliveryWaveCapacityChangedEventKafka retailnetwork.last-mile-delivery.events, com.retailnetwork.logistics.last-mile-delivery.wave.DeliveryWaveCapacityChangedConformist
node-topologyNodeRegisteredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRegisteredConformist
node-topologyNodeOperationalProfileDeclaredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeOperationalProfileDeclaredConformist
node-topologyNodeActivatedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeActivatedConformist
node-topologyNodeSuspendedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeSuspendedConformist
node-topologyNodeRetiredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRetiredConformist
node-topologyLaneOpenedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.lane.LaneOpenedConformist
node-topologyLaneClosedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.lane.LaneClosedConformist
node-topologyServiceAreaAssignedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.servicearea.ServiceAreaAssignedConformist
node-topologyRegionDefinedEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.region.RegionDefinedConformist
offer-availabilityCatalogItemCreatedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemCreatedConformist
offer-availabilityCatalogItemDiscontinuedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemDiscontinuedConformist
offer-availabilityListingCreatedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingCreatedConformist
offer-availabilityListingAvailabilityChangedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingAvailabilityChangedConformist
offer-availabilityListingSuppressedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingSuppressedConformist
offer-availabilityListingRestoredEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingRestoredConformist
node-performanceNodeScorecardUpdatedEventKafka retailnetwork.node-performance.events, com.retailnetwork.partner.node-performance.scorecard.NodeScorecardUpdatedConformist

REST read routes with no named caller. The model's rest list also has GET /delivery-offers/{offerId}, GET /promises/{promiseId}, GET /promises?orderId= and GET /promise-books?nodeId=&date=. No inbound row names who calls them, so this canvas shows no collaborator for them (see Open Questions). They are in the OpenAPI contract.

Outbound Communication​

Every event leaves through the transactional outbox on topic retailnetwork.delivery-promise.events, source /retailnetwork/delivery-promise, subject and Kafka key = the aggregate root id.

CollaboratorMessageTypeChannelRelationship
none (analytics only)PromiseMadeEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseMadePublished Language
none (analytics only)PromiseConfirmedEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseConfirmedPublished Language
customer-orderingPromiseAtRiskEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseAtRiskCustomer/Supplier (DP is the Supplier)
customer-ordering, order-sourcingPromiseRevisedEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseRevisedCustomer/Supplier
node-performance, customer-orderingPromiseKeptEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseKeptOHS + PL (node-performance is Conformist); Customer/Supplier with customer-ordering
node-performance, customer-orderingPromiseBrokenEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseBrokenOHS + PL (node-performance is Conformist); Customer/Supplier with customer-ordering
none (analytics only)PromiseReleasedEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseReleasedPublished Language
none (analytics only)PromiseCancelledEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promise.PromiseCancelledPublished Language
order-sourcingPromiseBookExhaustedEventKafka retailnetwork.delivery-promise.events, com.retailnetwork.commerce.delivery-promise.promisebook.PromiseBookExhaustedCustomer/Supplier
own analyticsDeliveryOfferQuotedEvent (analytics only)Kafka retailnetwork.delivery-promise.analyticsInternal
——Synchronous callnone: sync_calls: []; the promise hot path makes no synchronous call—

Full message details: the domain events page. Relationship reasons: the context map page.

Ubiquitous Language​

Full glossary: the ubiquitous language page. Top terms: Delivery Offer, Service Tier, Promise, Ship-By, Deliver-By Window, Witness Path, Promise Basis (SCHEDULED / NOMINAL), Promise Book, Capacity Hold, Handicap, Re-promise, Promise Kept / Broken, Shipment Group.

Business Decisions​

  1. No path, no offer. A delivery offer exists only if at least one feasible path exists now. Otherwise that tier returns no offer and the constraint that blocked it (OfferConstraint).
  2. Fast tiers are never quoted from nominal lane times. Only STANDARD may fall back to nominal transit, and the promise records basis NOMINAL (ErrNominalBasisNotAllowedForTier, ADR 0008).
  3. A promise holds capacity. It reserves capacity on the node's pickup cutoff (PromiseBook); provisional holds expire if the order is not placed (ReleaseExpiredHolds).
  4. One promise per shipment group. A multi-node order gets one promise per group (ShipmentGrouping, ErrGroupSpansNodes).
  5. Handicap, never silent exclusion. A poorly performing node gets a later ship-by by its scorecard grade (ScorecardHandicap).
  6. Kept means on time. Delivered on or before deliverByLatest (JudgeOnDelivery).
  7. Dates only move later. A revision never moves deliverByLatest earlier (ErrRevisionMovesEarlier).
  8. Peak control by deadline. Per tier and region, a policy-versioned local order deadline (TierOrderDeadline) stops new workable demand for that tier.

Assumptions​

  • Upstream events arrive within seconds. The read models are only as fresh as the slowest topic; a stale DepartureView can quote a departure that is already full.
  • linehaul-transportation keeps a 14-day horizon of departures (HorizonRoll), including one pickup departure per declared cutoff of every ACTIVE vendor fulfillment node; without it there is no witness path.
  • last-mile-delivery publishes waves ahead of time for every delivery station with a service area.
  • Every postal prefix the storefront sends maps to one delivery station (node-topology: one station per prefix per assignment version).
  • A cancelled departure is announced before its cutoff wherever possible (linehaul-transportation business decision), so re-promising has time to act.
  • Customer-ordering places the order before the hold expires in the normal case; the hold is a guard, not the main path.

Verification Metrics​

MetricDefinitionSource
Promise-kept ratePromiseKept / (PromiseKept + PromiseBroken) per tier, per region, per weekown events topic
Re-promise ratePromiseRevised / PromiseConfirmed per tierown events topic
At-risk ratePromiseAtRisk / PromiseConfirmedown events topic
Hold leakagePromiseReleased / PromiseMade; a high value means checkout abandons or the hold is too shortown events topic
No-offer share by constraintshare of quotes per tier with no offer, split by OfferConstraintanalytics topic (DeliveryOfferQuoted)
Quote latencyp99 of POST /delivery-quotes; a target to set before buildHTTP metrics
Read-model lagnow - time of the last applied CloudEvent, per consumed topicinbox (processed_events)
NOMINAL shareshare of STANDARD promises with basis NOMINALown events topic
Book exhaustionPromiseBookExhausted per node per dayown events topic
Broken by causePromiseBroken grouped by cause and nodeIdown events topic

Open Questions​

Each one is a gap or an unstated rule in the model, reported to the model owner, not decided here.

  1. Offer shape for a multi-line group. DeliveryOffer is described per (catalogue item, quantity, destination, tier), yet a Promise covers a multi-line ShipmentGroup and PromiseMade carries a single offerId. This pack lets an offer carry the group's lines (one line on a product page).
  2. Basis and policy version on the offer. PromiseMade needs basis and policyVersion; DeliveryOffer stores neither, and WitnessPath does not say how a NOMINAL path (no scheduled departures) is written.
  3. What FulfillmentLocked is for. It is consumed, but no policy or read model says what this context does with it. It is the only consumed event that carries assignmentId with orderId and groupNo, which judgement needs (question 4), and it names the node that really ships, which the witness book does not count.
  4. Finding the promise of a delivered package. PackageDelivered and PackageExceptionRaised carry assignmentId and orderId, not promiseId or groupNo. For a group shipped in several packages, the model does not say which delivery judges it.
  5. A package that never arrives (resolved). PackageLost and PackageReturned are consumed: the promise of every assignment that shares the tracking number is judged BROKEN with cause LOST or RETURNED (ADR 0025), so a lost package's promise is judged.
  6. A cancelled delivery wave (resolved). DeliveryWaveCancelled is consumed: the wave is marked cancelled in DeliveryWaveView and every active promise whose witness wave it is is flagged AT_RISK with reason WAVE_CANCELLED, then RepromiseOnRisk runs.
  7. Where a book comes from (resolved, G9). The first HoldCapacity for a pickup opens the book (OpenBook, policy LazyBookOpening). Its share is ceil(min(maxOrders, throughput cap x window) x capacitySharePercent / 100), at least 1 (policy BookShare). A clock job closes the book at cutoffAt (policy CloseBooksAtCutoff), and holds stop from the holdDeadline.
  8. Who owns TierOrderDeadline. No aggregate, route or event carries the deadlines or policyVersion, and no OfferConstraint names "past the order deadline".
  9. Handicap edge cases. ScorecardHandicap in the model does not map grade PROVISIONAL (the promise model page reads it as no handicap), and does not say which scorecard window (7-day or 30-day) applies. As built, grades and handicaps read the 30-day window and the 7-day window gates the fast tiers through NodeTierEligibilityChanged.
  10. A late CustomerOrderPlaced. customer-ordering normally confirms synchronously, and the event consumer is the reconciling confirm. If the hold expired first, the consumer skips that group with a warning log (never retried), confirms the other groups of the order, and the ReleaseExpiredHolds sweeper releases the lapsed PROVISIONAL promise; the placed order then has a RELEASED promise and no event tells customer-ordering.
  11. Capacity on revision and cancellation. The model does not say whether RevisePromise moves the hold to a new book, or that CustomerOrderCancelled maps to CancelPromise and releases confirmed capacity. This pack assumes both.
  12. The read routes' callers. Four GET routes have no named caller.
  13. Transaction boundary of MakePromise. Consuming the offer, creating the promise and holding capacity touch three aggregates. This pack commits them in one local transaction (see the use cases page).
  14. Vocabularies. PromiseBroken.cause, PromiseAtRisk.reason and PromiseReleased.reason have no enumerated values; offerTtl and the hold TTL have no values.