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.
- 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.
- “Which lots for this client are near expiry?”
- “Show slow-moving frozen stock over 90 days of cover.”
- “List quarantined lots at a site.”