Context for managing the phoenix_kit_cat_item_supplier_info junction table.
Each row links a catalogue item to a supplier (local or CRM-sourced) and
carries a snapshot of the supplier's name at write time so the record stays
readable even after renaming or deletion.
At most one row per item may have is_primary: true — enforced by a partial
unique index and by set_primary/1, which uses a transaction to clear any
existing primary before promoting the target row.
Price history via validity windows
The schema carries valid_from/valid_to date fields. A row is considered
current when valid_to is nil. revise_unit_cost/3 implements a
non-destructive price revision: the current row is closed (valid_to: today,
is_primary: false) and a successor row is inserted with the new cost,
valid_from: today, and valid_to: nil. This produces an append-only price
history ordered by valid_from descending. The canonical "current" predicate
is is_nil(valid_to).