CRM 0.7.1: Manufacturer role and a Catalogue tab on companies
CRM 0.7.1 adds manufacturer as a fourth party role next to supplier, customer and partner, and gives the company page a Catalogue tab that lists the items the company supplies or manufactures. A company can hold supplier and manufacturer at once.
The tab shows when the Catalogue module is installed and enabled. It has a column picker and a warning when items still point at a role the company no longer holds. The company form gets Description and Logo URL fields, and the logo reaches the Catalogue’s manufacturer pickers.
A role’s validity dates now count: a role whose end date has passed stops applying, and granting it again starts a new period. A company or person can hold each role only once at a time. Old client roles become customer.
The supplier import task no longer fails on rows that were already linked.
Upgrading
Run mix phoenix_kit.update: migrations V02 to V04 add the company description and logo and the role rules.
Full release notes: CRM 0.7.1
0.7.1 · 21 August 2026
Added
manufacturerparty role, alongsidesupplier/customer/partner(#23). Granted the same way as the others; a company or contact can holdsupplierandmanufacturerat once — the case the shared role table exists for.- Roles now carry a validity window.
valid_from/valid_toused to be decorative — every query filtered onis_activealone, so a role stamped with an expiredvalid_tostill resolved as live forever. Every role query now goes throughPartyRoles.in_force/1, so an out-of-window role stops resolving even whileis_activestays true, and re-granting a lapsed role starts a fresh tenure instead of silently returning the stale row. - Batch party resolution:
get_suppliers/1,get_manufacturers/1, andlist_parties_with_role/2(withlist_suppliers/1,list_manufacturers/1,list_customers/1wrappers) resolve many party uuids in one pair of queries instead of one call per row — the N+1 a catalogue page rendering 100 items would otherwise hit. - A Catalogue tab on the company page (#23), shown when the catalogue
module is installed and enabled. Lists items this company supplies or
manufactures, with a column picker and a warning banner when items still
reference a role the company no longer holds. Soft-dependency guarded
(
Code.ensure_loaded?+apply/3) — the CRM has no compile-time dependency on the catalogue. Companygaineddescriptionandlogo_url— the fields the catalogue’s own supplier/manufacturer rows used to carry, now that those parties are managed here.- A V04 migration adds a
CHECKconstraint on the role vocabulary and a partial unique index (roleable_uuid,role)WHERE is_active, so a party can hold at most one active row per role — closing a stateget_supplier/1previously had to defend against withlimit(1). Legacyclientrows (pre-rename) are normalized tocustomerfirst, sinceADD CONSTRAINTvalidates existing rows.
Fixed
get_manufacturer/1and its batch/list counterparts now returnlogo_url. V04’s owndescription/logo_urladdition toCompanywas meant to let the catalogue read a manufacturer’s brand mark from CRM, but none of the federation resolvers included the field — it was captured on the company form and reachable by nothing.- Removed seven
priv/gettextcatalog entries ("Item","Their code","Unit cost","Lead time","primary","%{n} d","SKU", with real Estonian and Russian translations) that nogettext/1call in this repo produces. phoenix_kit_crm.import_suppliers_from_catalogue: raw-SQL uuid parameters are now dumped to their 16-byte binary form before use (Ecto.UUID.dump/1) and uuid columns read back from raw SQL are loaded to text before display (Ecto.UUID.load/1) — both directions previously raised on a row that had actually been linked.
Changed
- Dependency updates (
mix.lock):phoenix_kit2.13.4,phoenix1.8.12,phoenix_live_view1.2.10, and routine bumps toecto,bandit,swoosh,req,tesla, and others.
CRM 0.7.1. Install or update: {:phoenix_kit_crm, "~> 0.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.