Skip to main content

Customer Ordering

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.

Generic

Customer Ordering (customer-ordering, code CO, tier commerce) turns a shopper's cart into a customer order. At checkout it calls delivery-promise synchronously to obtain one promise per shipment group, then records the order with the shopper and the ship-to address. That address is synthetic PII and is held only here. The context publishes CustomerOrderPlaced, which carries the promise snapshot of every group, so order-sourcing can queue the work from one event without correlating it with the promise stream. Afterwards it follows fulfilment, promise and package events into a customer-facing status and tracking view; on the day of delivery the view also shows each package's day-of delivery window (at most two hours, current only while the package is out for delivery) and, when the delivery point has been flagged, a delivery-point advisory — a reason code for the storefront to word, never driver prose. It also derives the opaque consolidation key that lets order-sourcing merge the groups of one shopper and one address, stores the shopper's chosen delivery day for the opt-in CONSOLIDATED tier, and lets one tracking number close several groups. It handles customer cancellation only while no shipment group is locked. The same storefront API is what the e2e-tests and the console remote (/mfes/customer-ordering/) drive. shipping-and-tracking is the only other context that ever reads the ship-to address: it calls the restricted, in-organization route GET /orders/{orderId}/ship-to to print a label.

This context's pages​

PageWhat it holdsddd-crew tool it follows
Business ContextThe problem, actors, decisions, relation to the real fulfillment networks, out of scope(narrative)
Ubiquitous LanguageTerms, code identifiers, terms not to confuseBounded Context Canvas (UL section)
Core Domain ChartWhy this context is GenericCore 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 CanvasCustomerOrder and Shopper, states, invariants, commandsAggregate Design Canvas v1.1
Domain EventsPublished and consumed CloudEvents, with an example envelopeDomain Message Flow Modelling (message catalogue)
Domain Message FlowCheckout, expired offer, fulfilment to delivery, cancellationDomain 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 DiagramProposed domain model and hexagonal ports and adapters(UML, fleet convention)
Entity RelationshipProposed Postgres schema(fleet convention)
Sequence DiagramsAdapter to Kafka for every command use case(UML, fleet convention)

Service and operations​

  • Service: IQVO/customer-ordering on develop (03a2d27, 2026-10-26): binaries cmd/api (REST) and cmd/mcp (read-only MCP), and the console remote in web/.
  • Deployment: wired in warehouse-infra develop: a terraform/apps.yaml entry (database: true, frontend_remote: customer_ordering_mfe) and helm-values/customer-ordering.yaml (MCP enabled, gateway path /api/mcp/customer-ordering). The cluster itself was not checked in this refresh.
  • Observability: service ADR 0007, Adopt the fleet observability standard, Accepted 2026-10-25. Logs, metrics and traces leave over OTLP to the otel-collector (OTEL_EXPORTER_OTLP_ENDPOINT, chart default otel-collector.observability.svc.cluster.local:4317; OTEL_SERVICE_NAME). The Tier-2 business counter is ordering.orders.placed (unit {order}, in internal/adapters/outbound/telemetry/order_metrics.go), with attribute outcome = placed or rejected and reason on the outcomes that are not a success. The dashboard queries it as ordering_orders_placed_total in warehouse-infra's terraform/dashboards/contexts/customer-ordering.json, by outcome.

Elsewhere​

  • Read-only MCP server (service ADR 0005): cmd/mcp, a second binary serving Streamable HTTP on :8090 with no auth; it sources this context's own reads and nothing that writes. Three tools: get_order, get_order_tracking, get_ship_to. The gateway (Kong) exposes it at /api/mcp/customer-ordering, rewritten to the server's /mcp mount.
  • Console remote (service ADR 0006): web/, a Vite + React Module Federation remote — federation container customer_ordering_mfe, gateway mount /mfes/customer-ordering/, dev/preview port 4012 — read-only screens over the existing REST reads, calling only this context's API.
  • REST contract (as built, from the service repository): apis/customer-ordering/openapi.yaml, rendered under the API reference.
  • ADR 0006: PII confinement explains why the ship-to address lives here and is read by shipping-and-tracking only.
  • ADR 0002: promise and assignment are separate explains why checkout talks to delivery-promise and never to order-sourcing.
  • The network-wide Context Map and Subdomain Classification.