Compare commits
merge into: MALIO-DEV/Starseed:feature/ERP-58-export-xlsx-clients
MALIO-DEV/Starseed:develop
MALIO-DEV/Starseed:feature/ERP-55-impl-provider-processor-client
MALIO-DEV/Starseed:feature/ERP-60-tests-phpunit-rg-clients
MALIO-DEV/Starseed:feature/ERP-56-referentiels-comptables-lecture-seule
MALIO-DEV/Starseed:feature/ERP-57-sous-ressources-contacts-adresses-rib
MALIO-DEV/Starseed:feature/ERP-58-export-xlsx-clients
MALIO-DEV/Starseed:feature/ERP-59-declarer-permissions-commercial-clients-rbac
MALIO-DEV/Starseed:feat/admin-tables-filter-pagination
MALIO-DEV/Starseed:main
MALIO-DEV/Starseed:v0.1.58
MALIO-DEV/Starseed:v0.1.57
MALIO-DEV/Starseed:v0.1.56
MALIO-DEV/Starseed:v0.1.55
MALIO-DEV/Starseed:v0.1.54
MALIO-DEV/Starseed:v0.1.53
MALIO-DEV/Starseed:v0.1.52
MALIO-DEV/Starseed:v0.1.51
MALIO-DEV/Starseed:v0.1.50
MALIO-DEV/Starseed:v0.1.49
MALIO-DEV/Starseed:v0.1.48
MALIO-DEV/Starseed:v0.1.47
MALIO-DEV/Starseed:v0.1.46
MALIO-DEV/Starseed:v0.1.45
MALIO-DEV/Starseed:v0.1.44
MALIO-DEV/Starseed:v0.1.43
MALIO-DEV/Starseed:v0.1.42
MALIO-DEV/Starseed:v0.1.41
MALIO-DEV/Starseed:v0.1.40
MALIO-DEV/Starseed:v0.1.39
MALIO-DEV/Starseed:v0.1.38
MALIO-DEV/Starseed:v0.1.37
MALIO-DEV/Starseed:v0.1.36
MALIO-DEV/Starseed:v0.1.35
MALIO-DEV/Starseed:v0.1.34
MALIO-DEV/Starseed:v0.1.33
MALIO-DEV/Starseed:v0.1.32
MALIO-DEV/Starseed:v0.1.31
MALIO-DEV/Starseed:v0.1.30
MALIO-DEV/Starseed:v0.1.29
MALIO-DEV/Starseed:v0.1.28
MALIO-DEV/Starseed:v0.1.27
MALIO-DEV/Starseed:v0.1.26
MALIO-DEV/Starseed:v0.1.25
MALIO-DEV/Starseed:v0.1.24
MALIO-DEV/Starseed:v0.1.23
MALIO-DEV/Starseed:v0.1.22
MALIO-DEV/Starseed:v0.1.21
MALIO-DEV/Starseed:v0.1.20
MALIO-DEV/Starseed:v0.1.19
MALIO-DEV/Starseed:v0.1.18
MALIO-DEV/Starseed:v0.1.17
MALIO-DEV/Starseed:v0.1.16
MALIO-DEV/Starseed:v0.1.15
MALIO-DEV/Starseed:v0.1.14
MALIO-DEV/Starseed:v0.1.13
MALIO-DEV/Starseed:v0.1.12
MALIO-DEV/Starseed:v0.1.11
MALIO-DEV/Starseed:v0.1.10
MALIO-DEV/Starseed:v0.1.9
MALIO-DEV/Starseed:v0.1.8
MALIO-DEV/Starseed:v0.1.7
MALIO-DEV/Starseed:v0.1.6
MALIO-DEV/Starseed:v0.1.5
MALIO-DEV/Starseed:v0.1.4
MALIO-DEV/Starseed:v0.1.3
MALIO-DEV/Starseed:v0.1.2
MALIO-DEV/Starseed:v0.1.1
MALIO-DEV/Starseed:v0.1.0
...
pull from: MALIO-DEV/Starseed:feature/ERP-55-impl-provider-processor-client
MALIO-DEV/Starseed:feature/ERP-55-impl-provider-processor-client
MALIO-DEV/Starseed:develop
MALIO-DEV/Starseed:feature/ERP-60-tests-phpunit-rg-clients
MALIO-DEV/Starseed:feature/ERP-56-referentiels-comptables-lecture-seule
MALIO-DEV/Starseed:feature/ERP-57-sous-ressources-contacts-adresses-rib
MALIO-DEV/Starseed:feature/ERP-58-export-xlsx-clients
MALIO-DEV/Starseed:feature/ERP-59-declarer-permissions-commercial-clients-rbac
MALIO-DEV/Starseed:feat/admin-tables-filter-pagination
MALIO-DEV/Starseed:main
MALIO-DEV/Starseed:v0.1.58
MALIO-DEV/Starseed:v0.1.57
MALIO-DEV/Starseed:v0.1.56
MALIO-DEV/Starseed:v0.1.55
MALIO-DEV/Starseed:v0.1.54
MALIO-DEV/Starseed:v0.1.53
MALIO-DEV/Starseed:v0.1.52
MALIO-DEV/Starseed:v0.1.51
MALIO-DEV/Starseed:v0.1.50
MALIO-DEV/Starseed:v0.1.49
MALIO-DEV/Starseed:v0.1.48
MALIO-DEV/Starseed:v0.1.47
MALIO-DEV/Starseed:v0.1.46
MALIO-DEV/Starseed:v0.1.45
MALIO-DEV/Starseed:v0.1.44
MALIO-DEV/Starseed:v0.1.43
MALIO-DEV/Starseed:v0.1.42
MALIO-DEV/Starseed:v0.1.41
MALIO-DEV/Starseed:v0.1.40
MALIO-DEV/Starseed:v0.1.39
MALIO-DEV/Starseed:v0.1.38
MALIO-DEV/Starseed:v0.1.37
MALIO-DEV/Starseed:v0.1.36
MALIO-DEV/Starseed:v0.1.35
MALIO-DEV/Starseed:v0.1.34
MALIO-DEV/Starseed:v0.1.33
MALIO-DEV/Starseed:v0.1.32
MALIO-DEV/Starseed:v0.1.31
MALIO-DEV/Starseed:v0.1.30
MALIO-DEV/Starseed:v0.1.29
MALIO-DEV/Starseed:v0.1.28
MALIO-DEV/Starseed:v0.1.27
MALIO-DEV/Starseed:v0.1.26
MALIO-DEV/Starseed:v0.1.25
MALIO-DEV/Starseed:v0.1.24
MALIO-DEV/Starseed:v0.1.23
MALIO-DEV/Starseed:v0.1.22
MALIO-DEV/Starseed:v0.1.21
MALIO-DEV/Starseed:v0.1.20
MALIO-DEV/Starseed:v0.1.19
MALIO-DEV/Starseed:v0.1.18
MALIO-DEV/Starseed:v0.1.17
MALIO-DEV/Starseed:v0.1.16
MALIO-DEV/Starseed:v0.1.15
MALIO-DEV/Starseed:v0.1.14
MALIO-DEV/Starseed:v0.1.13
MALIO-DEV/Starseed:v0.1.12
MALIO-DEV/Starseed:v0.1.11
MALIO-DEV/Starseed:v0.1.10
MALIO-DEV/Starseed:v0.1.9
MALIO-DEV/Starseed:v0.1.8
MALIO-DEV/Starseed:v0.1.7
MALIO-DEV/Starseed:v0.1.6
MALIO-DEV/Starseed:v0.1.5
MALIO-DEV/Starseed:v0.1.4
MALIO-DEV/Starseed:v0.1.3
MALIO-DEV/Starseed:v0.1.2
MALIO-DEV/Starseed:v0.1.1
MALIO-DEV/Starseed:v0.1.0
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8222c63315 |
Merge remote-tracking branch 'origin/develop' into feature/ERP-55-impl-provider-processor-client
# Conflicts: # src/Module/Commercial/Domain/Entity/Client.php # src/Shared/Domain/Contract/CategoryInterface.php |
||
|
|
b495e4030a |
[ERP-54] Créer les entités Client + sous-entités + référentiels (#29)
Auto Tag Develop / tag (push) Failing after 28s
## Contexte Ticket Lesstime **#54** (1.1 / Backend / M) — spec `docs/specs/M1-clients/spec-back.md` § 3.4 / § 3.5. > 🔗 **MR stackée sur ERP-53** — cible `feature/ERP-53-migrer-tables-client-m1`, **pas** `develop`. À repointer vers `develop` quand ERP-53 sera mergé (cf. `STACK-BRANCHES-PROCEDURE.md`). Le diff ne montre que les fichiers d'ERP-54. ## Contenu **9 entités** (`src/Module/Commercial/Domain/Entity/`) : - Métier : `Client`, `ClientContact`, `ClientAddress`, `ClientRib` — `#[Auditable]` + Timestampable/Blamable. - Référentiels statiques lecture seule : `TvaMode`, `PaymentDelay`, `PaymentType`, `Bank` — whitelistés dans `EntitiesAreTimestampableBlamableTest::EXCLUDED`. **8 repositories** interfaces (`Domain/Repository/`) + impl Doctrine (`Infrastructure/Doctrine/`). > La spec § 3.5 ne définit que 8 entités (4 métier + 4 référentiels) ; pas de 9ᵉ entité malgré la formulation « 9 paires » du ticket. ## Décisions - **Aucun `#[ApiResource]` dans ce ticket** : le bloc ApiResource du `Client` (§ 3.4) référence `ClientProvider`/`ClientProcessor` = périmètre **ERP-55**. L'inclure casserait `cache:clear`/`make test`/`schema:validate`. Les entités sont des entités Doctrine pures (ORM + Assert + Groups). Endpoints lecture seule des référentiels → ticket dédié. - **Q4** : `Client` sans `#[ORM\UniqueConstraint]` — unicité du nom de société portée par l'index partiel Postgres `uq_client_company_name_active` (inexprimable en attribut ORM). - **Audit RIB (29/05)** : aucun `#[AuditIgnore]` sur `ClientRib.iban`/`bic` (tous champs audités, audit admin-only). - **Cross-module (règle n°1)** : M2M `Category` via le contrat `Shared\Domain\Contract\CategoryInterface` + `resolve_target_entities` (pas d'import direct Catalog→Commercial) ; `ClientAddress.sites` via `SiteInterface` existant. ## Infra nécessaire (découvert pendant le dev) - `doctrine.yaml` : mapping ORM du module `Commercial` (mappings explicites par module) + résolution `CategoryInterface → Category`. - `CommercialReferentialFixtures` **créée** (n'existait pas — ERP-53 avait seedé les CategoryType côté Catalog) : re-seed idempotent des 4 référentiels, sinon vidés au `db-reset` (désormais tables mappées). - `ColumnCommentsCatalog` étendu (colonnes M1) pour le chemin `schema:update`/test — sinon `ColumnsHaveSqlCommentTest` (garde-fou n°12) échoue. - Migration retrofit `Version20260528120000` (ERP-67) rendue résiliente (`$schema->hasTable()`) : elle rejouait tout le catalogue mais s'exécute avant la création des tables M1 → `relation tva_mode does not exist`. Conforme à son docblock (« les futures migrations posent leurs propres COMMENT »). - `makefile test-db-setup` : recréation de l'index partiel `uq_client_company_name_active` (analogue de la ligne existante pour `category`). ## Vérifications - `make php-cs-fixer-allow-risky` ✓ - `make db-reset` ✓ (bout en bout ; 4 référentiels + 4 CategoryType présents, 2 index partiels créés) - `make test` ✓ **312/312** (Architecture vert, 0 régression M0) - `doctrine:schema:validate` : Mapping **OK** ; « not in sync » = bruit cosmétique pré-existant du projet (clear COMMENT hors-ORM, drop index partiels, renommages d'index). Seul diff introduit : renommage cosmétique de l'index M2M `idx_client_category_category` (même colonne) — aucun écart de type/colonne/FK vs migration ERP-53. --------- Co-authored-by: admin malio <malio@yuno.malio.fr> Co-authored-by: Matthieu <contact@malio.fr> Co-authored-by: Matthieu <mtholot19@gmail.com> Reviewed-on: #29 Co-authored-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr> Co-committed-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr> |
||
|
|
56cf492dcc |
[ERP-53] Migrer les tables Client + sous-collections + référentiels comptables (#27)
Auto Tag Develop / tag (push) Failing after 20s
## Contexte Ticket Lesstime : **#53** (ERP-53) — premier ticket back du M1 (Répertoire clients). Spec back : `docs/specs/M1-clients/spec-back.md` § 3.2 + § 3.3. ## Implémentation - Migration Doctrine `migrations/Version20260601000000.php` (12 tables) + fixture `CategoryTypeFixtures`. - **4 référentiels comptables** seedés : `tva_mode` (3), `payment_delay` (3), `payment_type` (4), `bank` (3). - **Table `client`** : 31 colonnes (formulaire + Information + Comptabilité + archive + soft-delete + Timestampable/Blamable). - **4 sous-collections** : `client_category` (M2M), `client_contact`, `client_address`, `client_rib` + **3 jointures** d'adresse (`client_address_site`, `client_address_contact`, `client_address_category`). - **4 CHECK** : mutex distributor/broker, contact name, address prospect exclusif, billing email conditionnel. - **1 index partiel unique** : `uq_client_company_name_active` sur `LOWER(company_name) WHERE is_archived=false AND deleted_at IS NULL` (décision Q4 — **pas** d'unicité siren/email). - **Seed `category_type`** : DISTRIBUTEUR / COURTIER / SECTEUR / AUTRE (`ON CONFLICT (code) DO NOTHING` en migration pour la prod, + fixture idempotente pour dev/test purgés). - `COMMENT ON COLUMN` sur **chaque** colonne (convention ERP-67, garde-fou vert). ## RG couvertes (niveau BDD) RG-1.03 (mutex distrib/broker), RG-1.05 (contact name), RG-1.06/07/08 (adresse prospect exclusif), RG-1.11 (billing email), RG-1.16 (unicité company_name — RG-1.15/1.17 supprimées par Q4), RG-1.22 (is_archived + archived_at). ## Écarts assumés vs spec (cf. docblock migration + cahier de test du ticket) 1. **Namespace `migrations/` racine** au lieu de `App\Module\Commercial\…` : vérifié empiriquement que Doctrine 3.9.6 (AlphabeticalComparator → strcmp FQCN) trierait le namespace Commercial **avant** `DoctrineMigrations` → migration client exécutée avant user/category/site → échec FK sur base vide. Le namespace racine garantit l'ordre par timestamp. 2. **DDL aligné Doctrine** : `INT GENERATED BY DEFAULT AS IDENTITY` + `TIMESTAMP(0) WITHOUT TIME ZONE` (et non SERIAL/TIMESTAMPTZ) → forward-compatible avec les entités du ticket 1.1 (schema:update no-op). 3. **Seed `category_type (code, label)` sans `position`** : la table M0 n'a pas de colonne `position` (coquille du pseudo-SQL § 3.3). > **Note ERP-54** : à l'arrivée des entités Client*, `schema:update` droppera leurs COMMENT + l'index partiel. Prévoir l'ajout au `ColumnCommentsCatalog` + recréation de l'index dans `test-db-setup` (pattern `uq_category_name_type_active`). ## Tests - `make php-cs-fixer-allow-risky` ✓ - `make db-reset` ✓ + vérifications psql manuelles (8 cas : CHECK, unicité partielle, archivage, siren/email dupliqués, seeds) - `make test` ✓ — **312 tests OK, 0 régression** --------- Co-authored-by: Matthieu <contact@malio.fr> Co-authored-by: Matthieu <mtholot19@gmail.com> Reviewed-on: #27 Co-authored-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr> Co-committed-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr> |