maiven gateway · online··
manifest · 2d ago
Sign in
Back to catalog
MAIVENmodelmarts

mart_inventory_health

beta
mart table

Per-lot stock health — quantity, days of cover, turnover, and near-expiry, per client.

Definition

One row per inventory lot (grain lot_id), sourced from int_whse__inventory_valued. Carries qty_on_hand, derived days_of_cover and turnover_ratio, a near_expiry_flag (computed against the fixed logistics_as_of horizon), storage zone/bin/status, temp_class/ hazard_class, and the client_id / sku / site_id FKs. status ∈ {available, allocated, quarantine, damaged, expired}. This is the per-lot table the inventory_turnover metric aggregates over; read rows to name which lots are slow-moving or near expiry. Client-scoped via the client_account_manager row policy on client_id.

Watch out for
  • highTreating NULL days_of_cover as zero cover

    NULL means no outbound velocity to divide by (dead/new stock), not "sells out today". Treat NULL as "cover undefined", filter explicitly.

  • highAssuming full visibility

    Row policy scopes to the caller's client_id — a client manager sees only their lots.

  • mediumComparing turnover_ratio across temp classes naively

    Frozen vs ambient velocities differ structurally; slice by temp_class before ranking.

Questions this answers
  • “Which lots for this client are near expiry?”
  • “Show slow-moving frozen stock over 90 days of cover.”
  • “List quarantined lots at a site.”
17 of 17
Column
Type
Description
Tests · PII
lot_id
String
PK — grain of this mart.
2 tests
client_id
String
Multi-tenant key. The client_account_manager row policy filters on this.
sku
Nullable(String)
Product FK.
site_id
Nullable(String)
Storing site FK.
client_segment
String
Owning-client segment; unknown when unmapped.
site_region
String
EU / UK / NA / APAC / unknown.
temp_class
Nullable(String)
ambient / chilled / frozen.
hazard_class
Nullable(String)
ADR class or none.
zone
Nullable(String)
Storage zone.
bin
Nullable(String)
Bin location.
qty_on_hand
Nullable(Int32)
Units on hand.
days_of_cover
Nullable(Float64)
qty_on_hand / avg daily units out; NULL when no velocity.
turnover_ratio
Nullable(Float64)
units_out_window / avg_qty_on_hand.
near_expiry_flag
Nullable(UInt8)
lot_expiry within 30 days of logistics_as_of (1/0) — single-sourced from the fixed anchor.
lot_expiry
Nullable(Date)
Lot expiry date.
status
Nullable(String)
available / allocated / quarantine / damaged / expired (the full inventory_status enum).
inv_month
Nullable(Date)
toStartOfMonth(received_date) — the receipt-month cohort key the inventory_turnover metric (§4.3/§0.6/INC-12) aggregates over. Carried from int_whse__inventory_valued; not part of the row_detail projection.