Skip to main content

Customer Returns

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.

Supporting

Customer Returns (customer-returns, code CR, tier commerce) is the shopper-facing returns front door of the network. After an order group has shipped or been delivered, the shopper asks to return it. The context creates a return authorization, decides the disposition itself (keep the goods, bring them to the nearest returns centre of the region, or send them back to the node that fulfilled the group), links the reverse labels and closes the authorization when a returns centre grades what came back. It holds no money, no address and no free text: the reason is an enum, unit prices are the caller's facts and never leave the context, and only the postal prefix of the group's destination is kept.

Two seams reach other contexts, and both are built on both sides. The reverse-label route of shipping-and-tracking (POST /return-labels) and the return advices and outcomes of vendor-connectivity are in those services' develop contracts, so the model draws both. The label call stays config-gated and off by default: unset, a label request answers label-unavailable. See Context Map.

Pages​

PageWhat it coversddd-crew tool
Business ContextThe problem, the actors, the decisions, what is out of scope—
Ubiquitous LanguageTerms (return authorization, disposition, returnless return, graded outcome...) and code identifiers—
Core Domain ChartWhy this context is Supportingcore-domain-charts
Bounded Context CanvasPurpose, roles, inbound and outbound messages, decisionsbounded-context-canvas
Context MapEvery neighbour with direction and pattern, and the two returns seamscontext-mapping
Aggregate Design CanvasReturnAuthorization and the three read modelsaggregate-design-canvas
Domain EventsFour published events, ten consumed—
Domain Message FlowA physical return, a returnless return, cancellation and expiry, and an agent read over MCP or A2Adomain-message-flow-modelling
EventStormingProcess-level boards with hotspotseventstorming-glossary-cheat-sheet
Use CasesOne section per command, errors mapped to HTTP—
Class DiagramDomain types and the hexagonal layout—
Entity RelationshipThe tables the service's ADRs name, as a logical view—
Sequence DiagramsOne runtime sequence per key command—

Service and operations​

  • Service: IQVO/customer-returns on develop (5f2d5e6, checked 2026-12-02): binaries cmd/api (REST, the outbox relay and the four consumers), cmd/mcp (read-only MCP server), cmd/a2a (read-only A2A agent), cmd/projector and cmd/reports (the analytics read side, switched off in warehouse-infra). The repository carries no console remote.
  • Release: the MCP server and the A2A agent are released at v0.1.10 (tag 1740c60, 2026-12-02), with the same two tools, one resource, one prompt and one skill as develop. The chart's routes through the Agent Router (no Kong plugins, no route timeout) are built on develop after that tag.
  • Deployment: applied to the k3s cluster (api and agents pods checked 2026-12-02). Wired in warehouse-infra develop (d12d05f): a terraform/apps.yaml entry and helm-values/customer-returns.yaml with mcp.enabled: true, a2a.enabled: true and agents.colocate: true, so cmd/mcp and cmd/a2a run as the two containers of one customer-returns-agents Deployment (container ports 8090 and 8093, both probed on /healthz). The edge routes are REST through Kong at /api/customer-returns, and MCP and A2A through the Agent Router (Envoy Gateway agent-router in envoy-gateway-system, warehouse-infra ADR 0014 and 0015) at /api/mcp/customer-returns (rewritten to /mcp) and /api/a2a/customer-returns (rewritten to /); the host edge of the Agent Router is http://localhost:8010. No auth on REST, MCP or A2A: the in-cluster boundary is the access control.
  • MCP (service ADR 0006, authority levels per ADR 0011): cmd/mcp, Streamable HTTP (stateless, no session id) on the official Go SDK, port 8090, open /healthz, no auth. Two tools, both L1 (_meta com.warehouse/authority: L1, readOnlyHint, idempotent, closed-world): get_return_authorization and list_return_authorizations, over the same read use cases as the two REST GETs. One resource template warehouse://customer-returns/return-authorizations/{authorizationId} and one prompt, review_return_authorization (the operator SOP; it names tools and never calls them). Authorizing, labelling and cancelling stay REST-only.
  • A2A (service ADR 0009, authority per ADR 0011): cmd/a2a, JSON-RPC 2.0 over HTTP on the official A2A Go SDK (a2a-go/v2), port 8093, open /healthz, no auth. The agent card is at /.well-known/agent-card.json (name customer-returns, provider IQVO, JSON-RPC transport, no streaming). One skill, get_return_authorization ("Read one return authorization", tag authority:L1, one required argument authorizationId): a message-only agent, one request and one answer, nothing persisted. A2A is delegation only: facts still travel as CloudEvents on Kafka, and the skill never proxies another context's data.
  • Observability: service ADR 0008, Adopt the fleet observability standard. The Tier-2 business counter is customer_returns.return.authorized (unit {return}), with attribute outcome = authorized or rejected.

Elsewhere​