Skip to main content

Shipping & Tracking

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. It also has an analytics read side (shipping-and-tracking ADR 0012): cmd/st-projector projects this context's own topics into a separate analytical database, and cmd/st-reports serves the read-only /reports/... routes on :8092.

Generic Subdomain

Shipping & Tracking (shipping-and-tracking, code ST, tier logistics) issues the shipping label for every package and owns the package's journey. A label is issued in-organization when vendor-connectivity asks for one on behalf of a vendor node (POST /labels). At that moment this context reads the ship-to address from customer-ordering (GET /orders/{orderId}/ship-to, restricted) and keeps only an encrypted snapshot needed to print it. It is the only context outside customer-ordering that ever sees an address, and it never publishes one. After the label, it folds facts from three other contexts into one customer-visible, forward-only timeline: the vendor's VendorShipmentConfirmed and the first pickup scan, linehaul LoadDeparted and LoadArrived, and last-mile PackageOutForDelivery, DeliveryAttempted, the stop ETA windows and the delivery-point flags. The timeline ends in delivered, returned or lost. The day-of ETA window and the delivery-point flag are stored on the journey but are not scans: they never move the state, and each is republished per package with its orderId so customer-ordering can show it to the shopper. PackageHandedOver feeds node-performance. PackageDelivered feeds the promise judgement in delivery-promise. A package that goes silent is raised as an exception (ExceptionOnSilence).

What its pages describe
  • Inbound: IssueLabel from vendor-connectivity (REST, in-org); events from vendor-connectivity, linehaul-transportation, last-mile-delivery and offer-availability; GetJourney from shoppers and customer-ordering.
  • Outbound: one synchronous query, GetShipTo, to customer-ordering; ten CloudEvents types on retailnetwork.shipping-and-tracking.events.
  • Aggregates: ShippingLabel (labelRef) and PackageJourney (trackingNumber).

This context's pages​

PageWhat it holdsddd-crew tool it follows
Business ContextThe business problem, actors, decisions, out of scopeDDD Starter Modelling Process (Understand, Discover)
Ubiquitous LanguageEvery term, its code identifier and its false friendsBounded Context Canvas (Ubiquitous Language section)
Core Domain ChartWhy this context is GenericCore Domain Charts
Bounded Context CanvasPurpose, roles, every inbound and outbound messageBounded Context Canvas v5
Context MapEvery neighbour, direction and patternContext Mapping
Aggregate Design CanvasShippingLabel and PackageJourney: states, invariants, commands, eventsAggregate Design Canvas v1.1
Domain EventsTen published and eight consumed events, with full CloudEvents typesEventStorming glossary (domain event)
Domain Message FlowLabel issue, journey to delivery, failure pathsDomain Message Flow Modelling
EventStormingProcess-level boards with hotspotsEventStorming glossary & cheat sheet
Use CasesOne section per command, errors mapped to HTTPnone (application layer)
Class DiagramProposed domain types and the hexagonal layoutnone (UML)
Entity RelationshipProposed Postgres schemanone
Sequence DiagramsAdapter to Kafka for every command use casenone (UML)

Service and operations​

  • Service: IQVO/shipping-and-tracking on develop (fc7e530, 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: shipping_mfe) and helm-values/shipping-and-tracking.yaml (MCP enabled, gateway path /api/mcp/shipping-and-tracking). The cluster itself was not checked in this refresh.
  • Observability: service ADR 0008, Adopt the fleet observability standard, Accepted 2026-10-26. 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 shipping.labels.issued (unit {label}, in internal/adapters/outbound/telemetry/label_metrics.go), with attribute outcome = issued or rejected and reason on the outcomes that are not a success. The dashboard queries it as shipping_labels_issued_total in warehouse-infra's terraform/dashboards/contexts/shipping-and-tracking.json, by outcome.

Elsewhere​

  • Read-only MCP server (service ADR 0006): cmd/mcp, a second binary serving Streamable HTTP on :8090 with no auth; it sources this context's own reads and nothing that writes. One tool: get_journey. The gateway (Kong) exposes it at /api/mcp/shipping-and-tracking, rewritten to the server's /mcp mount.
  • Console remote (service ADR 0007): web/, a Vite + React Module Federation remote — federation container shipping_mfe, gateway mount /mfes/shipping-and-tracking/, dev/preview port 4020 — read-only screens over the existing REST reads, calling only this context's API.
  • REST contract (as built, from the service repository): apis/shipping-and-tracking/openapi.yaml, rendered under the API reference.
  • ADR 0006: PII confinement: why the ship-to address lives only in customer-ordering and here.
  • ADR 0007: CloudEvents namespace and the event standard.
  • The domain-wide Context Map and Subdomain Classification.