Catalogue 0.11.0: Several suppliers per item, each with its own terms
Catalogue 0.11.0 lets an item come from several suppliers, each with its own SKU, unit cost, lead time and minimum order quantity, and one of them marked as primary. The new Suppliers card on the item form can’t save yet; see Upgrading.
Suppliers per item
The item form’s single primary supplier dropdown is replaced by a Suppliers card. Add Supplier links a supplier with its Supplier SKU, unit cost and currency, Lead Time (days) and Min. Order Qty. Make primary marks the main one, and a link can be removed. Suppliers can come from the catalogue’s own list or from the CRM module. The catalogue still runs without CRM.
Adding, promoting and removing a supplier link is recorded in the activity log with the admin who did it. A new mix phoenix_kit_catalogue.audit_supplier_refs task reports supplier references that point at nothing.
Fixes
- Suppliers from CRM never appeared in the supplier picker, because the catalogue called a CRM function that does not exist. It now lists CRM companies and contacts with the supplier role.
- CRM contacts were labelled as companies.
Upgrading
Catalogue 0.11 needs PhoenixKit 1.7.189 or later. Do not rely on the Suppliers card in production yet: the table it saves to comes from PhoenixKit core’s V149 migration (PhoenixKit 1.7.194), which lacks two columns and an index the card needs, so every Add Supplier fails with a database error. This waits for a core migration that adds them.
Full release notes: Catalogue 0.11.0
0.11.0 · 16 July 2026
Added
- Supplier×item info layer (#44) — a new
phoenix_kit_cat_item_supplier_infojunction table lets an item be sourced from several suppliers (local or CRM), each with its own SKU, unit cost/currency, lead time, and MOQ, plus a per-item “primary supplier” flag. The item edit form gained a Suppliers card (add/remove, make-primary) replacing the old singleprimary_supplier_uuiddropdown.Catalogue.Suppliers.resolve/1and.list_all/1provide a unified local+CRM supplier view, guarded so the catalogue module compiles and runs withoutphoenix_kit_crmpresent.mix phoenix_kit_catalogue.audit_supplier_refsreports unresolvable supplier UUIDs. See ADRdev_docs/adr/0001-cross-module-references.mdfor the soft-UUID-reference pattern this introduces for cross-module data.
⚠ Known blocker — Suppliers card does not work yet
- The new Suppliers card cannot save. The core
phoenix_kitmigration this feature depends on (V149, shipped inphoenix_kit1.7.194) createsphoenix_kit_cat_item_supplier_infowithout thesupplier_source/is_primarycolumns or the partial unique index the new Ecto schema requires — every “Add Supplier” click fails with a Postgresundefined_columnerror. Confirmed still present throughphoenix_kit1.7.196 (latest at release time); no follow-up migration has shipped. Do not rely on this feature in production until aphoenix_kitmigration adds the missing columns/index and this repo’smix.lockis bumped to depend on it. Full detail:dev_docs/pull_requests/2026/44-parties-supplier-info/CLAUDE_REVIEW.md.
Fixed
- CRM suppliers never appeared in the item form’s supplier picker —
Suppliers.list_all/1called aPhoenixKitCRM.PartyRoles.list_suppliers/0function that doesn’t exist anywhere inphoenix_kit_crm; the guarded lookup silently and permanently returned[]. Now backed by the role-scopedlist_companies_with_role/2/list_contacts_with_role/2functions that actually exist. - CRM contacts were always mislabeled
crm_company— the source-type heuristic checked for a:company_uuidkey thatPhoenixKitCRM.PartyRoles.get_supplier/1never returns for either party type. Company/contact entries fromlist_all/1are now tagged correctly at the source;resolve/1’s single-party lookup reports the honest generic:crmtag instead of guessing. - Adding/promoting/removing a supplier link never recorded who did it — the three new
ItemFormLivehandlers didn’t threadactor_opts(socket)into theItemSupplierInfoscalls, unlike every other mutating call in that LiveView, soitem_supplier_info.*activity rows always hadactor_uuid: nil. Catalogue.PubSub’skind()typespec was never extended for the new:item_supplier_infobroadcast — no runtime crash (every subscriber matcheskindloosely), but it broke the type contract badly enough that a from-scratchmix dialyzerrun flagged 7 of its 8 total warnings from this one gap (cascading into false “unreachable{:ok, _}branch” warnings on the three newItemFormLivehandlers).mix dialyzeris now a clean pass.- New context functions bypassed the
Cataloguefacade —ItemSupplierInfosand the newSuppliers.resolve/1/.list_all/1had nodefdelegateonPhoenixKitCatalogue.Catalogue, contradicting the module’s own documented “one-stop facade” convention. Addedresolve_supplier/1,list_all_suppliers/1, and the full*_supplier_infoCRUD surface.
Notes
- Dependency lockfile advances (no
mix.exsconstraint changes):phoenix_kit1.7.189 → 1.7.194 (this is the version that first pulls in core’sV149migration — see the known blocker above),phoenix_kit_ai0.11.0 → 0.12.2 (adds a transitivexai/grpc/protobuf/googleapischain),ex_ast0.12.9 → 0.12.10,phoenix_live_view1.2.6 → 1.2.7.mintbumped to 1.9.3, patchingEEF-CVE-2026-59249(chunk-size parser response-smuggling advisory) flagged bymix hex.audit. Constraints stay loose. - Verification:
mix format,mix compile --warnings-as-errors,mix dialyzerare clean.mix credo --strictis at parity with the pre-existing baseline (see the review doc).mix testcould not be run in this environment (no local Postgres) — the same condition that let the migration gap above ship unnoticed in #44; the new/updated tests were reviewed by manual trace and should get a real CI/Postgres run before this release is considered fully verified.
Catalogue 0.11.0. Install or update: {:phoenix_kit_catalogue, "~> 0.11"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.