Add the manufacturers backfill the supplier import shipped without - #31
Open
mdon wants to merge 1 commit into
Open
Add the manufacturers backfill the supplier import shipped without#31mdon wants to merge 1 commit into
mdon wants to merge 1 commit into
Conversation
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).
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_manufacturersrows 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'sManufacturers.list_all/1, core V178'scrm_company_uuidxref) was ready and waiting; only the data promotion was missing.mix phoenix_kit_crm.import_manufacturers_from_catalogueis the twin of the supplier task: dry-run by default,--applywrites, idempotent via the stamped xref, match by extracted email → normalized website → create, granting themanufacturerrole. The manufacturer rows'descriptionrides 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.exsthatcredo --strictflagged from the recent upstream merge.Gate
683 tests, 0 failures;
mix precommitclean (both viaPHOENIX_KIT_PATHagainst 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