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

stg_postgres__order_promotions

staging view

Order ↔ promo bridge with captured discount.

Definition

Per-order promotion applications. `discount_amount` is the money taken off this order (computed from the promotion's discount_type / value at apply-time). One order may have multiple promos; (order_id, promotion_id) is unique. Drives `mart_promotion_performance`.

7 of 7
Column
Description
Tests · PII
order_promotion_id
Primary key — UInt64.
2 tests
order_id
FK to `stg_postgres__orders.order_id`. NOT NULL.
promotion_id
FK to `stg_postgres__promotions.promotion_id`. NOT NULL.
2 tests
discount_amount
Money taken off this order. Decimal(12,2).
2 tests
applied_at
When the promo was applied to the order. DateTime64(6).
applied_day
`toDate(applied_at)`. Convenience for daily marts.
airbyte_extracted_at
When Airbyte extracted this row from postgres-source.