Skip to main content

Entity Relationship

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 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.

The schema as built: 0001_checkout_schema.up.sql on develop (ab4f0e9), applied at boot with golang-migrate (which adds its own schema_migrations table). Checkout owns its database and shares no table with another context.

3 tables. Key markers: PK primary key, FK foreign key, UK unique. Types are the column types of the migration; constraints (CHECK, defaults, partial indexes) are in the file.

Tables​

TableColumnsPrimary keyRole
checkout_sessions31session_idaggregate or read-model state
idempotency_keys7route, keystored REST answers per Idempotency-Key and route
outbox_events13idtransactional outbox the relay publishes to Kafka

Design-time schema versus as built​

The pack was first written with a proposed, fully normalised schema. The service kept the aggregate boundaries and changed the storage shape:

Design-time tableAs built
session_linescheckout_sessions.lines (jsonb column)
session_groupscheckout_sessions.groups (jsonb column)
session_requoted_offerscheckout_sessions.requoted_offers (jsonb column)

Every other design-time table exists under the same name. The invariants are enforced by the aggregate in internal/domain before a row is written; the migration adds CHECK constraints on scalar columns and the indexes listed in the file.