Skip to content

Add the manufacturers backfill the supplier import shipped without - #31

Open
mdon wants to merge 1 commit into
BeamLabEU:mainfrom
mdon:main
Open

Add the manufacturers backfill the supplier import shipped without#31
mdon wants to merge 1 commit into
BeamLabEU:mainfrom
mdon:main

Conversation

@mdon

@mdon mdon commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What this does

Client report (2026-08-31): manufacturers were never migrated into CRM the way suppliers were — the catalogue's local phoenix_kit_cat_manufacturers rows kept feeding the item form's dropdown as the "old list", while the CRM Companies page's Manufacturers filter showed nothing. The read-side federation (catalogue's Manufacturers.list_all/1, core V178's crm_company_uuid xref) was ready and waiting; only the data promotion was missing.

mix phoenix_kit_crm.import_manufacturers_from_catalogue is the twin of the supplier task: dry-run by default, --apply writes, idempotent via the stamped xref, match by extracted email → normalized website → create, granting the manufacturer role. The manufacturer rows' description rides into the created company's metadata.

Rather than copy the 449-line supplier task, its machinery moved to PhoenixKitCRM.CatalogueImport, parameterized per flow — both mix tasks are thin wrappers, and the supplier task keeps its tested public surface as delegators (its 28 existing tests pass unchanged). New tests pin the manufacturer config, the create+grant+stamp path with description carry-over, idempotency, and the dry-run.

Also one alias reorder in test_helper.exs that credo --strict flagged from the recent upstream merge.

Gate

683 tests, 0 failures; mix precommit clean (both via PHOENIX_KIT_PATH against local core).

Operator note

The task has NOT been run anywhere yet — dry-run first on each box (mix phoenix_kit_crm.import_manufacturers_from_catalogue), review the report, then --apply.

🤖 Generated with Claude Code

https://claude.ai/code/session_018bbQqpwP4bRCYWNtsJAksH

Client report (2026-08-31): manufacturers were never promoted into CRM
the way suppliers were — the catalogue's local
phoenix_kit_cat_manufacturers rows kept feeding the item form's
dropdown as the old list, while the CRM Companies page's Manufacturers
filter showed nothing. The read-side federation (catalogue's
Manufacturers.list_all/1, core V178's crm_company_uuid xref) was ready
and waiting; only the data migration was missing.

mix phoenix_kit_crm.import_manufacturers_from_catalogue is the twin of
the supplier task: dry-run by default, --apply writes, idempotent via
the stamped xref, match by extracted email then normalized website,
otherwise create — granting the manufacturer role. The manufacturer
rows' description rides into the created company's metadata (a CRM
company has no such column).

Rather than copy the 449-line supplier task, its machinery moved to
PhoenixKitCRM.CatalogueImport, parameterized per flow; both mix tasks
are thin wrappers, and the supplier task keeps its tested public
surface (process_supplier_row/4 & co) as delegators — its 28 existing
tests pass unchanged. New tests pin the manufacturer config (table,
role, metadata keys, the V178 guard hint), the create+grant+stamp
path with description carry-over, idempotency, and the dry-run.

Also: one alias reorder in test_helper.exs that credo --strict flagged
from the upstream merge.

Gate: 683 tests, 0 failures; mix precommit clean (both against local
core via PHOENIX_KIT_PATH).
@mdon

mdon commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Applied on tim-dev with Max's go: 9 created, 5 matched-by-website, 14 xrefs stamped, 0 errors; a re-run reports 14 already-linked (idempotency proven live). One operator note for the runbook: the earlier supplier import had created a Blum company without email/website, so the matcher couldn't see it and created a second Blum — merged by hand (re-point xref, drop the duplicate's role, carry website/metadata, trash the dup; the original already held a manufacturer role from the UI). Rows imported without match keys are invisible to the matcher, so a quick name-collision review after each --apply belongs in the routine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant