Skip to main content

Checkout

Released at v0.1.4, applied to the k3s cluster

Derived from model/model.yaml. The checkout service is built on develop (IQVO/checkout at 51e0379, checked 2026-12-02), released at v0.1.4 and applied to the k3s cluster: the api and the A2A agent are deployed, the MCP server is registered in warehouse-infra and switched off. Every Err... name, REST route and CloudEvents type of this context named on this page exists in the service; where the built service differs from the model's design, the page says so (As built) or the context's Service and operations section lists it.

Supporting

Checkout (checkout, code CK, tier storefront) is the purchase saga: one transaction across price, payment and the network's promise confirmation. Its single aggregate, CheckoutSession, walks from review to placed order. The saga authorizes the payment first (compensatable: it can be voided), then places the order (the pivot), then leaves the retriable steps to events. While the place-order outcome is unknown the session sits in PLACING, the semantic lock: there is no void and no new attempt until a definitive answer arrives. The place-order step reaches the network's customer-ordering through an Anti-Corruption Layer, the only place that knows the network's wire names. The context holds a shopperId and a shipToAddressId reference and never PII; its stored placement request is PII-free, so it can be replayed byte for byte with the same Idempotency-Key.

This context's pages​

PageWhat it holdsddd-crew tool it follows
Business ContextThe problem, actors, decisions, relation to real storefronts, out of scope(narrative)
Ubiquitous LanguageTerms, code identifiers, terms not to confuseBounded Context Canvas (UL section)
Core Domain ChartWhy this context is SupportingCore Domain Charts
Bounded Context CanvasPurpose, classification, roles, inbound and outbound messages, decisions, metricsBounded Context Canvas v5
Context MapEvery neighbour, direction and patternContext Mapping
Aggregate Design CanvasCheckoutSession: states, invariants, commandsAggregate Design Canvas v1.1
Domain EventsPublished CloudEvents, with an example envelopeDomain Message Flow Modelling (message catalogue)
Domain Message FlowThe happy path, a decline, a requote, an in-doubt placementDomain Message Flow Modelling
EventStormingProcess-level boards with hotspotsEventStorming glossary & cheat sheet
Use CasesOne section per command: trigger, flow, errors, events, idempotency(application layer, fleet convention)
Class DiagramDomain model and hexagonal ports and adapters (the model's design, with the as-built packages)(UML, fleet convention)
Entity RelationshipPostgres schema as built (migration 0001)(fleet convention)
Sequence DiagramsAdapter to Kafka for every command use case(UML, fleet convention)

Service and operations​

  • Service: IQVO/checkout on develop (51e0379, checked 2026-12-02): binaries cmd/api, cmd/mcp, cmd/a2a; REST contract apis/openapi.yaml, event contract apis/asyncapi.yaml, schema in internal/adapters/outbound/postgres/migrations/ (see Entity Relationship). 11 ADRs (0001 to 0011), listed in the ADR index.
  • Configuration: mandatory at boot (the service exits naming the missing variable): DATABASE_URL, KAFKA_BROKERS, SHOPPING_CART_URL, DELIVERY_PROMISE_URL, PRICING_URL, CUSTOMER_PAYMENTS_URL, CUSTOMER_ORDERING_URL. There is no in-memory mode. Packaging: the Helm chart charts/checkout (on develop and in v0.1.4) renders the api and, both default off, an mcp and an a2a component with their own Services, routes and probes.
  • Deployment: released at v0.1.4 (tag commit 74b552b, which carries cmd/api, cmd/mcp, cmd/a2a and the chart) and applied to the k3s cluster: warehouse-infra develop (d12d05f, checked 2026-12-02) registers checkout in terraform/apps.yaml (with a database) and configures it in helm-values/checkout.yaml, with a dashboard and alert rules. REST goes through Kong at /api/checkout; the five sibling URLs point at the in-cluster services. The A2A agent is switched on (a2a.enabled: true) behind the route /api/a2a/checkout through the Agent Router (Envoy Gateway agent-router, warehouse-infra ADR 0014). The api and a2a pods were checked 2026-12-02 (1/1 each). The MCP server is not deployed: see MCP.
  • Observability: service ADR 0006, Adopt the fleet observability standard (logs, metrics, traces), Accepted (2026-10-26). Logs, metrics and traces leave over OTLP/gRPC (OTEL_EXPORTER_OTLP_ENDPOINT, code default localhost:4317; OTEL_SERVICE_NAME); a collector that is down only drops telemetry. The Tier-2 business counter is checkout.sessions.confirmed (unit {session}, in internal/adapters/outbound/telemetry/session_metrics.go), with attribute outcome = completed, declined, requote-required, failed, in-doubt or refused and reason on the outcomes that are not a success. The warehouse-infra dashboard terraform/dashboards/contexts/checkout.json shows the gateway, the logs and the Go runtime; it does not query the counter.
  • MCP: cmd/mcp is a read-only MCP server (service ADR 0005, A read-only MCP server, Accepted 2026-10-25): the official Go SDK over Streamable HTTP only, MCP_ADDR (default :8090), /mcp and an open /healthz, no auth (the in-cluster boundary is the access control). One tool, get_checkout_session: L1 inform (reads, changes nothing: the tool declares readOnlyHint, idempotentHint and a closed openWorldHint, and no _meta authority, so its level is read from the hint). It mirrors GET /checkout-sessions/{sessionId} through the same GetSession use case and returns the session's state, lines, shipment groups, binding total, authorizationId, orderId, re-quoted offers and failure code; opening and confirming a session have no tool. The chart's mcp component (port 8090, route /api/mcp/checkout through the Agent Router, rewritten to /mcp) is default off and helm-values/checkout.yaml sets no mcp block: the MCP server is registered in warehouse-infra and switched off, so it is not deployed. The repo pins no tool_registry.golden.json; the tool is read from internal/adapters/inbound/mcp/tools.go.
  • A2A: cmd/a2a is a read-only A2A agent (service ADR 0007, A2A inbound adapter, Accepted 2026-10-30; first commit aa5248c): the official A2A Go SDK, JSON-RPC 2.0 over HTTP, A2A_ADDR (default :8093), A2A_AGENT_URL mandatory (the absolute URL the Agent Card advertises), the card at /.well-known/agent-card.json with name checkout, version from SERVICE_VERSION, provider IQVO, streaming: false and no security schemes; no auth. One skill, checkout_session_status (Where does a checkout session stand, L1 inform): the goal-shaped form of get_checkout_session, answering a session's state and references through the same GetSession use case; it persists nothing, and an unknown sessionId answers a 404 problem. A2A is delegation only: facts still travel as CloudEvents on Kafka, and the agent holds no write use case and no outbound client. Route /api/a2a/checkout through the Agent Router (rewritten to /), a2a.enabled: true in warehouse-infra; applied to the k3s cluster, the checkout-a2a pod checked 2026-12-02.

Elsewhere​

  • REST contract: storefront/apis/checkout/openapi.yaml (a copy of the service's spec on develop), rendered under the API reference.
  • The storefront-wide Context Map, Subdomain Classification and Ubiquitous Language.
  • The Model Gap Register tracks gap S1 (checkout numbers lines 1..n and groups by the quote's groupNo), gap S2 (the binding total is the session's PriceQuote), gap S3 (requote after authorization: pre-check, then void and REQUOTE_REQUIRED) and gap S4 (event order across topics, which customer-payments parks and applies on CheckoutCompleted).
  • customer-ordering is the network context behind the place-order step; delivery-promise owns the offers the session pre-checks. shopping-cart supplies the cart the session opens from and closes it on CheckoutCompleted; pricing issues the binding quote; customer-payments authorizes, voids and later binds the order.