NVIC mappings

There's no NVIC model in this project — just a seed file this project publishes, that the Stock pipeline consumes.

The seed

src/redbook/dbt/seeds/redbook_vehicle_key_nvic_mappings.csv — 113,458 rows, 6 columns:

snippet.txttext
id, vehicle_key, glass_code, nvic, created_at, updated_at

A sample row:

snippet.txttext
"1","AUVALFA2018AEAK","ALFSTE--1820029W2018","029W18","29/5/2023 21:42:10","29/1/2026 10:34:48"

vehicle_key is a standard Redbook Vehicle Key. glass_code looks like a Glass's Guide reference code. nvic is the short NVIC (National Vehicle Identification Code) — the code this table exists to map.

There is no model anywhere in src/redbook/dbt that transforms, validates, or joins against this seed — it's loaded as-is and read directly from elsewhere.

Who actually uses it

Stock's key-resolution logic, not anything in this project. Two models in src/stock/dbt reference it directly via source('redbook', 'redbook_vehicle_key_nvic_mappings'):

  • stock_redbook_enrichment_ref.sql — the main enrichment model, where NVIC is the fourth of five resolution tiers: if a listing's redbook_vehicle_key is null, empty, or one of a couple of known-bad sentinel values, but an nvic_code is present, this seed resolves a vehicle_key from it.
  • stock_nvic_ref.sql — a narrower model that stores only the records that actually needed the NVIC fallback, seemingly for tracking which listings depend on it rather than a resolved key from anywhere more direct.

See Redbook key resolution hierarchy (once written) for the full five-tier resolution logic this seed is one part of.

Why this lives here instead of in Stock

The seed is versioned under src/redbook/dbt/seeds/, so it deploys with the Redbook project, but its only consumer is the Stock project. This is a cross-project dependency worth knowing about if you're ever tempted to move or rename it — a change here has no visible effect until you check what Stock does with it.

See also

Esc