Skip to main content

Bounded Context Canvas

As built

Derived from network/model/model.yaml. This context's service is built (IQVO/customer-returns, decided by ADR 0012); the model carries its as-built contracts, and identifiers (Err... names, routes, CloudEvents types) are the names the service uses. Where the model left a choice open, the service's own ADRs 0001 to 0005 record what it does.

Following the ddd-crew Bounded Context Canvas.

Derived from: model.yaml → contexts[customer-returns].inbound, .publishes, .consumes; contexts[offer-availability].consumes. The agent client is not in the model: that edge is the service's MCP and A2A adapters (service ADRs 0006, 0009 and 0011), read on develop 5f2d5e6 on 2026-12-02.

Omitted from the diagram only (not redrawn): shipping-and-tracking and vendor-connectivity. Their side of the reverse-label call and of the vendor seam is in their develop contracts, so both are rows of the model and of sections 5 and 6 (policies ReverseLabelCall and FirstFittingOutcomeCompletes).

1. Name​

Customer Returns (customer-returns, CR), tier commerce, Supporting.

2. Purpose​

Let a shopper return a shipped or delivered order group: authorize the return, decide what happens to the goods, link the reverse labels and close the authorization on the graded outcome, holding no money, no address and no free text.

3. Strategic classification​

AxisValue
DomainSupporting
Business modelExperience protector and stock recoverer
EvolutionCustom-built

4. Domain roles​

Execution (return authorizations), Gateway for the storefront (Open Host Service), Specification (the disposition decision).

5. Inbound communication​

SenderTypeMessageChannelRelationship
shopper / storefrontcommandAuthorizeReturn, IssueLabel, CancelReturnREST POST /return-authorizations, POST /return-authorizations/{authorizationId}/labels, POST /return-authorizations/{authorizationId}/cancellationsOHS
shopper / storefrontqueryListReturnAuthorizations, GetReturnAuthorizationREST GET /return-authorizations?orderId=, GET /return-authorizations/{authorizationId}OHS
an agent client (MCP)queryGetReturnAuthorization, ListReturnAuthorizationsMCP tools get_return_authorization, list_return_authorizations (Streamable HTTP, Agent Router /api/mcp/customer-returns, both L1)OHS
a delegating agent (A2A)queryGetReturnAuthorizationA2A skill get_return_authorization (JSON-RPC 2.0, Agent Router /api/a2a/customer-returns, tag authority:L1)OHS
customer-orderingeventCustomerOrderPlaced, ShopperNoticeDecidedKafka retailnetwork.customer-ordering.eventsConformist
node-topologyeventNodeRegistered, NodeActivated, NodeSuspended, NodeRetired, ServiceAreaAssignedKafka retailnetwork.node-topology.eventsConformist
order-sourcingeventFulfillmentReleasedToNode, FulfillmentLockedKafka retailnetwork.order-sourcing.eventsConformist
vendor-connectivityeventVendorReturnOutcomeSubmittedKafka retailnetwork.vendor-connectivity.eventsCustomer/Supplier

All write routes take an Idempotency-Key. No authentication on REST, MCP or A2A, as in every other context (conventions.no_auth): the in-cluster boundary is the access control. The MCP tools and the A2A skill call the same two read use cases as the REST GETs, and no tool or skill writes (service ADRs 0006 and 0009).

The consumer of the vendor's graded outcome (VendorReturnOutcomeSubmitted) completes the first fitting open authorization; vendor-connectivity publishes the event since its ADR 0014 shipped.

6. Outbound communication​

MessageTypeConsumers
ReturnAuthorizedeventvendor-connectivity (its ReturnAdviceView)
ReturnLabelIssuedeventvendor-connectivity (its ReturnAdviceView)
ReturnCompletedeventoffer-availability
ReturnCancelledeventvendor-connectivity (its ReturnAdviceView)
IssueReturnLabelcommand (synchronous)shipping-and-tracking, REST POST /return-labels

The model lists one synchronous call (sync_calls): the reverse-label call of IssueLabel to shipping-and-tracking's POST /return-labels. It is config-gated and off by default (policy ReverseLabelCall).

7. Ubiquitous language​

See Ubiquitous Language.

8. Business decisions​

See Business Context. The rules as policies: DispositionDecidedAtAuthorization, ReturnlessKeep, PricesAreCallerFacts, LazyExpiry, ReverseLabelCall, OneLabelPerPackage, FirstFittingOutcomeCompletes, UnexpectedLinesStayFacts, RestockIsAFact, PickupIsRecordedNotRun, OutboxVersionedSchema.

9. Assumptions​

  • A group's placed and shipped facts, the returns centres and the sourcing lock reach this context as events before the shopper asks. A view that lags refuses (ErrGroupNotShipped, ErrNoReturnDestination) rather than guesses, and the shopper retries with the same Idempotency-Key.
  • The two order-group events have no ordering guarantee: a notice may arrive before its placed event, and the view tolerates both orders.
  • Two authorizations of one group are distinct aggregates; nothing stops a second authorization of a group that already has one.

10. Verification metrics​

As built: the Tier-2 counter customer_returns.return.authorized (attribute outcome authorized or rejected; service ADR 0008). Not built: share of returns decided KEEP; time from AUTHORIZED to RECEIVED; share of outcome lines flagged unexpected.

11. Open questions​

  • When do the reverse-label route and the vendor seam reach their owners' develop contracts? Until then no label is issued and no return is completed.
  • Network ADR 0012 names the promise witness as the fallback origin and speaks of fees as facts. Neither is built: the decision uses the sourcing lock only, and no fee field exists.
  • The returnless threshold is a constant (1500 cents). Whether it becomes a policy is not decided.
  • Nothing sets IN_TRANSIT or PICKUP_FAILED yet.