feat(catalog) : single CLIENT category type + corrective migration

Migration corrective Version20260602100000 (namespace racine) : ajoute
Category.code, cree le type unique CLIENT, reporte Distributeur/Courtier/
Secteur/Autre en Category codees sous CLIENT, supprime les anciens types.
Fixtures alignees (type unique CLIENT, categories codees). Index partiel
uq_category_code recree dans test-db-setup.
This commit is contained in:
Matthieu
2026-06-02 09:20:58 +02:00
parent 13bb51ee9a
commit 636f2ccb8e
4 changed files with 256 additions and 73 deletions
+3
View File
@@ -208,6 +208,8 @@ migration-migrate:
# exprimables via les attributs Doctrine ORM (fonctionnel + partiel), donc
# ils disparaissent apres schema:update. On les recree par dbal:run-sql :
# - `uq_category_name_type_active` (M0 Catalog) : tests RG-1.07.
# - `uq_category_code` (Catalog ERP-78) : unicite du code categorie parmi
# les actifs (slug du nom), pilote RG-1.03/1.29.
# - `uq_client_company_name_active` (M1 Commercial) : unicite nom societe
# parmi actifs non archives/non supprimes (RG-1.16), tests ERP-55.
# Sans ces restores, les POST doublons remontent 201 au lieu de 409.
@@ -225,6 +227,7 @@ test-db-setup:
$(SYMFONY_CONSOLE) --env=test --no-interaction app:sync-permissions
$(SYMFONY_CONSOLE) --env=test --no-interaction app:seed-rbac
$(SYMFONY_CONSOLE) --env=test dbal:run-sql "CREATE UNIQUE INDEX IF NOT EXISTS uq_category_name_type_active ON category (LOWER(name), category_type_id) WHERE deleted_at IS NULL"
$(SYMFONY_CONSOLE) --env=test dbal:run-sql "CREATE UNIQUE INDEX IF NOT EXISTS uq_category_code ON category (code) WHERE deleted_at IS NULL"
$(SYMFONY_CONSOLE) --env=test dbal:run-sql "CREATE UNIQUE INDEX IF NOT EXISTS uq_client_company_name_active ON client (LOWER(company_name)) WHERE is_archived = FALSE AND deleted_at IS NULL"
fixtures: