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 inbound, consumes, publishes or sync_calls of this context in the model.

Canvas at a glance​

Two pictures of the sections below. 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; blue = sibling bounded context; double border = external system (the other organization); dashed = no context consumer. Channel names are abbreviated; the tables carry the exact route, topic and CloudEvents type.

Inbound​

Derived from: model.yaml → contexts[vendor-connectivity].inbound, .consumes, .purpose, .roles, .business_decisions.

Outbound​

Derived from: model.yaml → contexts[vendor-connectivity].inbound, .consumes, .publishes, .sync_calls, .purpose, .roles, .business_decisions.

Omitted: the internal triggers that drive commands without a collaborator (the ExpireUnacknowledged sweep and the submission processor that runs ProcessSubmission after notBefore); replies to queries; the relationship pattern per message (see the tables); assumptions, metrics and open questions. "Accepted, Rejected, Expired" on the arrows abbreviate the full PurchaseOrder... event names.

Name​

Vendor Connectivity (vendor-connectivity, code VC, CloudEvents tier partner).

Purpose​

The network's Open Host Service for vendors that operate fulfillment nodes. It publishes the Vendor API and its Published Language: vendors register nodes, declare their operational profile, send inventory feeds, poll purchase orders, acknowledge them in full inside the acknowledgement window, request labels and confirm shipment. Every write is an asynchronous transaction a vendor reconciles.

Strategic Classification​

AxisVerdict
DomainSupporting. See the Core Domain Chart.
Business ModelRevenue-channel enabler (third-party capacity without integration cost).
EvolutionProduct: the protocol shape is well known and adopted in the network's own vocabulary.

Domain Roles​

RoleApplies?Why
Gateway / Open Host ServiceYes, primaryThe Vendor API is the one door for every vendor; its schemas are the Published Language (apis/vendor-connectivity/openapi.yaml). It relays node, profile and inventory writes to their owners.
ExecutionYesOwns the purchase-order protocol and its clock: issue, ackBy, expiry, acceptance, label gate, shipment confirmation.
AnalysisNoMeasuring vendors is node-performance's job.
SpecificationNoNode and listing master data belong to node-topology and offer-availability.

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
network-fulfillment (warehouse-systems, vendor V-WS)RegisterVendorNodeCommandVendor API POST /vendor/nodesOHS + PL (downstream is Conformist + ACL)
network-fulfillmentDeclareNodeProfileCommandVendor API PUT /vendor/nodes/{nodeId}/profileOHS + PL (downstream is Conformist + ACL)
network-fulfillmentSubmitInventoryCommandVendor API POST /vendor/inventoryOHS + PL (downstream is Conformist + ACL)
network-fulfillmentSubmitAcknowledgementCommandVendor API POST /vendor/acknowledgementsOHS + PL (downstream is Conformist + ACL)
network-fulfillmentRequestLabelCommandVendor API POST /vendor/shipping-labelsOHS + PL (downstream is Conformist + ACL)
network-fulfillmentSubmitShipmentConfirmationCommandVendor API POST /vendor/shipment-confirmationsOHS + PL (downstream is Conformist + ACL)
network-fulfillmentPollPurchaseOrdersQueryVendor API GET /vendor/purchase-orders?createdAfter=&nodeId=&nextCursor=OHS + PL
network-fulfillmentGetPurchaseOrderQueryVendor API GET /vendor/purchase-orders/{poNumber}OHS + PL
network-fulfillmentGetTransactionQueryVendor API GET /vendor/transactions/{transactionId}OHS + PL
network-fulfillmentGetNodeQueryVendor API GET /vendor/nodes/{nodeId}OHS + PL
network-fulfillmentGetScorecardQueryVendor API GET /vendor/nodes/{nodeId}/scorecardOHS + PL
A vendor's returns-centre system (the fleet has no client for these on its develop)PollReturnAdvices, GetReturnAdviceQueryVendor API GET /vendor/return-advices, GET /vendor/return-advices/{authorizationId} (service ADR 0014)OHS + PL
A vendor's returns-centre systemSubmitReturnOutcomeCommandVendor API POST /vendor/return-outcomes (service ADR 0014)OHS + PL
customer-returnsReturnAuthorized, ReturnLabelIssued, ReturnCancelledEventKafka retailnetwork.customer-returns.events (into ReturnAdviceView)Conformist
Network partner managers (human)OnboardVendorCommandREST POST /vendorsUI
order-sourcingFulfillmentReleasedToNodeEventKafka retailnetwork.order-sourcing.events, com.retailnetwork.commerce.order-sourcing.assignment.FulfillmentReleasedToNodeCustomer/Supplier
order-sourcingFulfillmentReleaseWithdrawnEventKafka retailnetwork.order-sourcing.events, com.retailnetwork.commerce.order-sourcing.assignment.FulfillmentReleaseWithdrawnCustomer/Supplier
order-sourcingFulfillmentCancelledEventKafka retailnetwork.order-sourcing.events, com.retailnetwork.commerce.order-sourcing.assignment.FulfillmentCancelledCustomer/Supplier
node-topologyNodeRegisteredEventKafka retailnetwork.node-topology.events, com.retailnetwork.logistics.node-topology.node.NodeRegisteredConformist
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
offer-availabilityListingCreatedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.listing.ListingCreatedConformist

Outbound Communication​

CollaboratorMessageTypeChannelRelationship
node-performanceVendorOnboardedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.vendoraccount.VendorOnboardedConformist (downstream)
node-performancePurchaseOrderIssuedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderIssuedConformist (downstream)
order-sourcing, node-performancePurchaseOrderAcceptedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderAcceptedCustomer/Supplier (order-sourcing); Conformist (node-performance)
order-sourcing, node-performancePurchaseOrderRejectedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderRejectedCustomer/Supplier (order-sourcing); Conformist (node-performance)
order-sourcing, node-performancePurchaseOrderExpiredEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderExpiredCustomer/Supplier (order-sourcing); Conformist (node-performance)
analytics onlyPurchaseOrderCancelledEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.PurchaseOrderCancelled— (no context consumer)
order-sourcing, shipping-and-tracking, node-performanceVendorShipmentConfirmedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.purchaseorder.VendorShipmentConfirmedCustomer/Supplier (order-sourcing, shipping-and-tracking); Conformist (node-performance)
node-performanceSubmissionProcessedEventKafka retailnetwork.vendor-connectivity.events, com.retailnetwork.partner.vendor-connectivity.submission.SubmissionProcessedConformist (downstream)
node-topologyRegisterNode, DeclareOperationalProfileCommandREST (in-org) POST /nodes, PUT /nodes/{nodeId}/operational-profileCustomer/Supplier (this context is the Customer)
offer-availabilityApplyInventoryFeedCommandREST (in-org) POST /inventory-feedsCustomer/Supplier (this context is the Customer)
shipping-and-trackingIssueLabelCommandREST (in-org) POST /labelsCustomer/Supplier (this context is the Customer)
node-performanceGetScorecardQueryREST (in-org) GET /scorecards/{nodeId}Customer/Supplier (this context is the Customer)

Full payloads: Domain Events. Patterns and reasons: Context Map.

Ubiquitous Language​

Full glossary with the fleet translation: Ubiquitous Language. Top terms: Vendor, Purchase Order (poNumber), Acknowledgement (fill-or-kill), ackBy, Required Ship-By, Submission / Transaction (transactionId), Label (never the address), Vendor API.

Business Decisions​

  1. Acknowledge once, in full, before ackBy. Fill-or-kill; partial acknowledgements are refused (ErrPartialAcknowledgement, ErrAlreadyAcknowledged, ErrAckWindowClosed).
  2. ackBy = min(issuedAt + vendor ackWindow, requiredShipBy - node handlingTime).
  3. A label is issued only for an ACCEPTED purchase order; a shipment is confirmed only after a label (ErrLabelBeforeAcceptance, ErrConfirmWithoutLabel).
  4. Every vendor write returns 202 with a transactionId; the write takes effect when its transaction succeeds.
  5. The Vendor API never carries ship-to PII.
  6. Rate limits are part of the contract (429 with Retry-After).
  7. One release, one purchase order. poNumber is idempotent on assignmentId + releaseNo (policy IssueOnRelease), so a redelivered release never issues a second order.
  8. Cancel only while ISSUED (ErrCancelAfterAcknowledgement for an order past acknowledgement, ErrIllegalTransition for an EXPIRED or CANCELLED one; policy CancelOnSourcingCancel).

Assumptions​

  • order-sourcing releases to a vendor node early enough that ackBy is in the future (its VirtualQueue policy subtracts a vendor ack budget).
  • The node's handling time is known to this context when it issues a purchase order (see Open Questions: the model does not feed it here).
  • Vendors poll often enough to see a purchase order well before ackBy.
  • The four simulation knobs default to well-behaved; a non-default value is a test setting, not production behaviour.
  • One vendor per node: a node's vendorId comes from NodeRegistered.

Verification Metrics​

MetricSourceTarget (proposed)
Share of purchase orders acknowledged before ackByPurchaseOrderAccepted + PurchaseOrderRejected vs PurchaseOrderExpiredExpiry rate tracked per node by node-performance (expiryRate)
Acknowledgement latency (issue to accepted or rejected)PurchaseOrderIssued.time to PurchaseOrderAccepted.acceptedAt / PurchaseOrderRejected.rejectedAtp95 well inside the vendor's ack window
Transaction failure share by kindSubmissionProcessed (kind, status, errorCount)Equals TX_FAILURE_RATE in simulation; near 0 otherwise
Processing lagprocessedAt - notBefore per submissionp95 under one processor tick
429 responses per vendorAPI metricsLow and stable; a spike means a vendor is not honouring Retry-After
Shipments confirmed on timeVendorShipmentConfirmed (shippedAt vs requiredShipBy)Feeds node-performance's on-time handover
Ship-to PII in the Vendor APIContract review of openapi.yamlZero fields, always

Open Questions​

  • Where does ackBy get handlingTime? (resolved, service ADR 0003). From NodeOperationalProfileDeclared, which this context consumes into VendorNodeView.handlingTimeMinutes; a node with no declared profile has handling time 0.
  • Cancellation after acknowledgement (resolved, G12; one race stays open). order-sourcing may cancel a RELEASED assignment while its purchase order is ACK_PROCESSING or ACCEPTED; here cancel is refused (ErrCancelAfterAcknowledgement), logged, and nothing is published. The decision lives in order-sourcing, which refuses a cancel after the lock (FulfillmentCancelRefused). An acceptance that arrives after order-sourcing cancelled a RELEASED assignment is only logged there, so the vendor may still ship a cancelled group.
  • Vendor suspension (resolved, service ADR 0002 A9, A14). SuspendVendor and ReinstateVendor are POST /vendors/{vendorId}/suspensions and /reinstatements, raise VendorSuspended and VendorReinstated on the events topic, and a SUSPENDED vendor's writes are refused with 409 vendor-suspended.
  • The label request is synchronous. The model says every write returns 202, but SubmissionKind has no label kind and IssueLabel is a synchronous call. The proposed contract returns labels in the response. Raised as a model gap.
  • How does a vendor learn its nodeId? A NODE_REGISTRATION transaction reports only status and errors. Raised as a model gap.
  • Who is calling? With no auth, the vendor names itself with vendorId in each write; reads have no vendor parameter, so ErrNodeNotOwnedByVendor cannot be checked on them. Raised as a model gap.
  • Synchronous refusal or failed transaction? The proposed contract refuses invariant breaches it can detect at receipt synchronously (4xx, no transaction) and reports downstream refusals as FAILURE with errors. The model does not say which; confirm.