Entity Relationship
Derived from model/model.yaml. The pricing service is built on develop (IQVO/pricing at 5a18326, checked 2026-10-27) and not deployed (no warehouse-infra entry). 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_pricing_schema.up.sql on develop (5a18326), applied at boot with golang-migrate (which adds its own schema_migrations table). Pricing owns its database and shares no table with another context.
13 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
| Table | Columns | Primary key | Role |
|---|---|---|---|
item_prices | 10 | catalog_item_id | aggregate or read-model state |
sale_windows | 5 | catalog_item_id, sale_id | aggregate or read-model state; FK to item_prices |
delivery_charge_schedules | 4 | schedule_id | aggregate or read-model state |
tier_charges | 5 | schedule_id, tier | aggregate or read-model state; FK to delivery_charge_schedules |
tax_tables | 4 | tax_table_id | aggregate or read-model state |
tax_bands | 4 | tax_table_id, postal_prefix_from | aggregate or read-model state; FK to tax_tables |
price_quotes | 11 | quote_id | aggregate or read-model state |
quote_lines | 7 | quote_id, line_no | aggregate or read-model state; FK to price_quotes |
quote_groups | 4 | quote_id, group_no | aggregate or read-model state; FK to price_quotes |
catalog_items | 3 | catalog_item_id | aggregate or read-model state |
processed_events | 3 | event_id | inbox: one row per consumed CloudEvents id (dedupe) |
idempotency_keys | 7 | route, key | stored REST answers per Idempotency-Key and route |
outbox_events | 13 | id | transactional 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 table | As built |
|---|---|
item_price_sale_windows | sale_windows (renamed) |
delivery_charge_tiers | tier_charges (renamed) |
price_quote_lines | quote_lines (renamed) |
price_quote_groups | quote_groups (renamed) |
rm_catalog_items | catalog_items (renamed; the CatalogItemView read model) |
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.