Skip to content

Warehouse 0.2.3: Supplier orders can use the catalogue's primary supplier

Warehouse 0.2.3 prepares supplier order generation for per-item primary suppliers in the catalogue: when the installed catalogue can name an item’s primary supplier, the warehouse orders from that supplier.

When an internal order is turned into supplier orders, each line needs a supplier. The warehouse now first asks the catalogue for the item’s primary supplier, if the catalogue release in use offers that lookup. If it does not, or if that supplier is not a local supplier record, the warehouse falls back to the suppliers linked to the item’s manufacturer, as before, and logs a warning in the second case.

Catalogue 0.10.0, the release the warehouse was built against, has no such lookup, so with it suppliers are still found through the manufacturer. Nothing else changes for a running site.

Full release notes: Warehouse 0.2.3

0.2.3 · 16 July 2026

Changed

  • resolve_suppliers/1 gained a guarded junction-primary fallback clause (PR #6), sitting between the primary_supplier_uuid scalar check and manufacturer resolution: a Code.ensure_loaded?/function_exported?-guarded call to PhoenixKitCatalogue.Catalogue.Suppliers.primary_for_item/1 (the catalogue V151 junction is_primary row), falling back to manufacturer resolution (with a warning) when the primary row’s supplier isn’t locally resolvable. The guard is correctly written — no crash risk against a dependency that doesn’t export the function.

Fixed (review of PR #6)

  • Neither resolve_suppliers/1 non-manufacturer clause is actually reachable against the currently pinned phoenix_kit_catalogue ~> 0.10 dependency — corrected during review, not a new bug from this PR. phoenix_kit_catalogue 0.10.0 (still Hex’s latest as of this release) never shipped primary_supplier_uuid or Suppliers.primary_for_item/1: both were added and (in the scalar’s case) removed entirely in catalogue commits after 0.10.0 was tagged, and remain unpublished. This also means the 0.2.2 changelog entry below and PR #5’s review overstated the scalar’s status — it was never live in any published catalogue release, not just removed by a later one. resolve_suppliers/1 today is functionally equivalent to manufacturer-only resolution for every item. Rewrote the misleading code comments to state this plainly (with the mechanism activating automatically, no code change needed, once catalogue publishes the junction release and this repo’s mix.lock picks it up), and replaced two pre-existing tests that asserted unreachable scalar-based behavior (and would have failed against the real dependency) with tests that lock in the real, currently-shipping fallback behavior. Full findings: dev_docs/pull_requests/2026/6-junction-primary-fallback/CLAUDE_REVIEW.md.

Notes

  • Dependency lockfile advance (no mix.exs constraint change): hackney 4.5.2 → 4.6.0.

Warehouse 0.2.3. Install or update: {:phoenix_kit_warehouse, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.