maiven gateway · online··
manifest · 1d ago
Sign in
Back to catalog
MAIVENmodelstaging

stg_postgres__order_items

staging view

Line-level detail behind every order, typed.

Definition

Per-line basket items staged from the operational DB. `unit_price` and `line_amount` are captured at order time (stable even when the catalog price changes later), so the model is the grain to use for a product-mix revenue breakdown rather than the order-total grain in `stg_postgres__orders`.

8 of 8
Column
Description
Tests · PII
order_item_id
Primary key — UInt64.
2 tests
order_id
FK to `stg_postgres__orders.order_id`. NOT NULL.
product_id
FK to `stg_postgres__products.product_id`. NOT NULL.
2 tests
quantity
Units purchased on this line. UInt32.
2 tests
unit_price
Per-unit price captured at order time. Decimal(10,2). Source-of-truth for revenue (may differ from current catalog price).
2 tests
line_amount
Line subtotal — `quantity * unit_price` materialised at write time. Decimal(12,2).
2 tests
source_created_at
Row insert timestamp from the source DB. DateTime64(6).
airbyte_extracted_at
When Airbyte extracted this row from postgres-source.