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

stg_postgres__product_inventory_snapshots

staging view

Inventory snapshots with derived availability.

Definition

Per-day stock position by product × warehouse. The unique constraint on the source means reseeds are deterministic; downstream marts can join freely on (product_id, warehouse_code, snapshot_date) without dedup. `available_qty` is materialised so stockout queries don't recompute.

11 of 11
Column
Description
Tests · PII
snapshot_id
Primary key — UInt64.
2 tests
product_id
FK to `stg_postgres__products.product_id`. NOT NULL.
2 tests
warehouse_code
Warehouse — `us-west`, `us-east`, or `eu-central`.
1 test
snapshot_date
Date the snapshot was taken.
1 test
on_hand_qty
Units physically on hand.
2 tests
reserved_qty
Units allocated to in-flight orders.
2 tests
reorder_point
Threshold below which a reorder fires. Procurement target.
available_qty
Derived — `on_hand_qty - reserved_qty`. May go negative on overcommit; surface but don't clamp.
under_reorder
Derived — `on_hand_qty <= reorder_point`. True ⇒ reorder pending.
source_created_at
Row insert timestamp from the source DB. DateTime64(6).
airbyte_extracted_at
When Airbyte extracted this row from postgres-source.