Commit Graph

351 Commits

Author SHA1 Message Date
gitea-actions a9935fbf97 chore: bump version to v0.1.145
Auto Tag Develop / tag (push) Successful in 7s
Build & Push Docker Image / build (push) Successful in 24s
v0.1.145
2026-06-18 13:33:48 +00:00
matthieu 36e947fd8e test(logistique) : tests PHPUnit RG-5.01→5.10 + capture contrat JSON (ERP-187) (#137)
Auto Tag Develop / tag (push) Successful in 8s
## ERP-187 (1.7) — Tests PHPUnit RG-5.01→5.10 + capture contrat JSON

Couvre les règles de gestion du M5 (tickets de pesée) par des tests PHPUnit et capture la **réponse JSON réelle** (DoD § 4.0.bis) collée dans `spec-back.md` avant les écrans front.

### Tests unitaires (Processor / Normalizer / Callback — sans BDD ni HTTP)
- **NetWeightTest** (RG-5.05) : net = plein − vide, `null` si une pesée manque, recalcul au PATCH.
- **CounterpartyValidationTest** (RG-5.03) : présence du champ requis par branche (propertyPath `client`/`supplier`/`otherLabel`) + exclusivité (null-ification hors-branche).
- **ImmatriculationNormalizationTest** (RG-5.01/5.10) : masque `XX-000-XX`, « Tout format », mapping 422 sur `immatriculation`.

### Tests fonctionnels (API réelle)
- **WeighingTicketNumberingTest** (RG-5.02/5.09) : format `{siteCode}-TP-{NNNN}`, séquence par site, isolation inter-sites, immuabilité numéro/site au PATCH.
- **WeighingTicketSerializationContractTest** (DoD § 4.0.bis) : 4 pièges verts (client embarqué, `plateFreeFormat` présent, `number` formaté, `netWeight` = full − empty) + dump JSON via `WEIGHING_TICKET_DOD_DUMP`.
- **WeighingTicketRBACMatrixTest** (§ 5.2) : admin/bureau/usine OK, compta/commerciale 403, anonyme 401.

> DSD / stub pont bascule / endpoint pesée déjà couverts (ERP-184/185).

### DoD
- `spec-back.md § 4.0.bis` : **JSON réel** (liste + détail) collé, 4 pièges marqués  — feu vert front.

### Vérifications
- `make test` complet **vert** : 848 tests, 6302 assertions (0 échec ; deprecations/notices PHPUnit seuls).
- `make php-cs-fixer-allow-risky` : 0 correction.

Empilée sur ERP-186 (stack M5).

---------

Co-authored-by: Matthieu <contact@malio.fr>
Reviewed-on: #137
2026-06-18 13:33:39 +00:00
gitea-actions b4e550b5de chore: bump version to v0.1.144
Auto Tag Develop / tag (push) Successful in 6s
Build & Push Docker Image / build (push) Successful in 20s
v0.1.144
2026-06-18 12:51:24 +00:00
matthieu 10c113dbad Merge pull request 'feat(logistique) : export XLSX des tickets de pesée (ERP-186)' (#136) from feat/erp-186-export-xlsx-tickets-pesee into develop
Auto Tag Develop / tag (push) Successful in 8s
2026-06-18 12:47:16 +00:00
matthieu c0dadd79ff Merge pull request 'feat(logistique) : WeighingTicketProvider + Processor — numérotation, contrepartie, net, normalisation (ERP-185)' (#135) from feat/erp-185-provider-processor-weighingticket into develop
Auto Tag Develop / tag (push) Successful in 7s
2026-06-18 12:47:11 +00:00
matthieu 1ffa38282a Merge pull request 'feat(logistique) : pesée pont bascule stub + DSD + endpoint (ERP-184)' (#134) from feat/erp-184-pesee-pont-bascule into develop
Auto Tag Develop / tag (push) Successful in 6s
2026-06-18 12:47:06 +00:00
matthieu 036b075d5e Merge pull request 'feat(logistique) : entité WeighingTicket + dette site.code (ERP-183)' (#133) from feat/erp-183-entite-weighingticket into develop
Auto Tag Develop / tag (push) Successful in 7s
2026-06-18 12:47:04 +00:00
matthieu 25466b18d8 Merge pull request 'feat(logistique) : migration schéma M5 tickets de pesée (ERP-182)' (#132) from feat/erp-182-migration-m5 into develop
Auto Tag Develop / tag (push) Successful in 8s
2026-06-18 12:47:02 +00:00
matthieu 2fde5844e5 Merge pull request 'feat(logistique) : scaffold module + socle RBAC tickets de pesée (ERP-181)' (#131) from feat/erp-181-logistique-module into develop
Auto Tag Develop / tag (push) Successful in 8s
2026-06-18 12:46:58 +00:00
Matthieu 02a22597b3 feat(logistique) : export XLSX des tickets de pesée (ERP-186)
Endpoint GET /api/weighing_tickets/export.xlsx — controller custom (priority: 1)
calque sur les exports M2/M3/M4, delegue la generation au SpreadsheetExporter
partage. Rejoue la selection du WeighingTicketProvider (recherche ?search, tri
?order[displayDate], cloisonnement par site courant) SANS pagination : export
complet de la liste (§ 4.5).

Colonnes : Numero, Type contrepartie, Contrepartie (nom Client/Fournisseur/
Autre), Date, Immatriculation, Poids vide, Poids plein, Poids net, DSD vide,
DSD plein. Securite logistique.weighing_tickets.view.

Tests fonctionnels : 200 + en-tetes/Content-Disposition, mapping des colonnes
avec net = plein - vide (RG-5.05), cloisonnement par site (non-admin), 403, 401.
2026-06-18 14:37:16 +02:00
Matthieu 76e7a59ba7 feat(logistique) : WeighingTicketProvider + Processor — numérotation, contrepartie, net, normalisation (ERP-185)
Logique métier d'écriture et de lecture du ticket de pesée (M5).

Processor (POST/PATCH) :
- résolution du site courant (CurrentSiteProvider) + attribution du numéro
  {siteCode}-TP-{NNNN} à la création, immuables ensuite (RG-5.02 / RG-5.09) ;
- exclusivité de la contrepartie CLIENT/FOURNISSEUR/AUTRE — null-ification des
  champs hors-branche (RG-5.03, garde-fou CHECK Postgres) ;
- normalisation immatriculation trim/UPPER + masque XX-000-XX hors « Tout
  format », 422 inline sur le champ si invalide (RG-5.01 / RG-5.10) ;
- DSD autoritaire pour les pesées AUTO via DsdAllocator (verrou), MANUEL conservé
  (RG-5.04) ;
- poids net = plein − vide recalculé (RG-5.05).

Provider (GET) : liste paginée (Paginator ORM, règle n°13), recherche ?search=,
tri ?order[displayDate], cloisonnement par site courant appliqué dans le provider
(le SiteScopedQueryExtension ne traverse pas un provider custom), fetch-join
client/supplier/site anti-N+1, 404 hors périmètre / soft-delete.

Ajouts : WeighingTicketNumberAllocator (compteur weighing_ticket_counter,
SELECT FOR UPDATE), WeighingTicketFieldNormalizer, InvalidImmatriculationException
+ alias DI.

make test vert (811), Architecture vert (CollectionsArePaginatedTest).
2026-06-18 14:37:16 +02:00
Matthieu e88bb059e6 feat(logistique) : pesée pont bascule stub + allocateur DSD + endpoint (ERP-184)
- WeighbridgeReaderInterface (contrat) + RandomWeighbridgeReader (stub,
  poids aléatoire ∈ [10000,50000] kg, RG-5.06) + WeighbridgeUnavailableException
- DsdAllocator : compteur DSD par site (weighbridge_dsd_counter) incrémenté
  sous verrou ligne SELECT ... FOR UPDATE (RG-5.04, § 2.7)
- endpoint POST /api/weighbridge_readings : ressource virtuelle
  WeighbridgeReadingResource + WeighbridgeReadingProcessor (pas de controller)
  - AUTO -> {weight, dsd, mode} ; MANUAL -> {weight, dsd, manualNumber, mode}
  - WeighbridgeUnavailableException -> HTTP 503 explicite (RG-5.06)
  - site courant via CurrentSiteProviderInterface (contrat Sites)
  - is_granted('logistique.weighing_tickets.manage')
- dsd renvoyé prévisionnel : attribution autoritaire refaite à la création
  du ticket (ERP-185)
- tests : WeighbridgeReaderStubTest, DsdAllocatorTest, processor (503/400),
  WeighbridgeReadingApiTest (RBAC + AUTO/MANUAL + 422)
2026-06-18 14:37:16 +02:00
Matthieu 312c119c06 feat(logistique) : entité WeighingTicket + dette site.code (ERP-183)
Entité WeighingTicket
- Entité métier complète (#[Auditable], TimestampableBlamableTrait, relations
  ORM Client/Supplier/Site) + contrat de sérialisation à 3 maillons
  (weighing_ticket:read / :item:read + contextes par opération).
- Getters calculés displayDate et plateFreeFormat (#[SerializedName]),
  sécurité view/manage, pas de Delete/archive.
- Validation #[Assert\*] messages FR + #[Assert\Callback] RG-5.03 (->atPath()),
  libellé i18n audit.entity.logistique_weighingticket.
- Repository : interface Domain + DoctrineWeighingTicketRepository
  (recherche + tri number DESC, deletedAt IS NULL).

Dette site.code
- Site.code mappé VARCHAR(8) (groupes read/write), dérivation auto au
  PrePersist (2 premiers chiffres du CP), UniqueConstraint uq_site_code.
- Migration Version20260617160000 : ALTER COLUMN code SET NOT NULL + COMMENT.
- Fixtures (codes 86/17/82) et SiteApiTest ajustés.

Câblage
- doctrine.yaml : mapping ORM du module Logistique (absent du scaffold ERP-181).
- ColumnCommentsCatalog : site.code + table weighing_ticket.

Specs M5 versionnées (spec-back / spec-front / prompts).
2026-06-18 14:37:16 +02:00
Matthieu 8491f55072 feat(logistique) : migration schéma M5 tickets de pesée (ERP-182)
Crée le schéma BDD du module Logistique (M5) au namespace racine
DoctrineMigrations (FK cross-module user/client/supplier/site, règle n°11) :

- site.code VARCHAR(8) (préfixe de numérotation {siteCode}-TP, RG-5.02) +
  backfill depuis le code postal + index unique uq_site_code. Colonne NULLABLE
  à ce ticket (l'entité Site ne mappe pas encore code) ; mapping ORM,
  peuplement et SET NOT NULL portés par le ticket entité.
- weighing_ticket_counter / weighbridge_dsd_counter : compteurs par site
  (numéro RG-5.02 / DSD pont RG-5.04), gérés en DBAL brut FOR UPDATE, hors ORM
  → exclus du schema_filter (sinon schema:update les droppe) + catalogués.
- weighing_ticket : table principale (contrepartie Client/Fournisseur/Autre
  avec CHECK 3 branches RG-5.03, immatriculation partagée, pesées vide/plein
  en colonnes plates, net_weight dérivé, soft-delete + Timestampable/Blamable).
  Index unique (site_id, number) + index FK. ON DELETE site/client/supplier =
  RESTRICT, created_by/updated_by = SET NULL.

COMMENT ON COLUMN sur chaque colonne créée (règle n°12). make test +
ColumnsHaveSqlCommentTest verts, db-reset OK.
2026-06-18 14:36:05 +02:00
Matthieu c63a5f971f feat(logistique) : scaffold module + socle RBAC tickets de pesée (ERP-181)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m12s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m44s
Nouveau module Logistique (M5), sans entité ni migration (ticket 1.2) :
- LogistiqueModule (ID logistique, permissions weighing_tickets.view/manage)
  enregistré dans config/modules.php
- layer front frontend/modules/logistique (auto-détecté)
- sidebar : section Logistique + item /weighing-tickets (gate ...view)
  + clés i18n sidebar.logistique.*
- 3 miroirs RBAC alignés : sidebar.php, personas.ts (user-full),
  SeedE2ECommand (user-full)
- matrice métier RbacSeeder : Bureau + Usine = view/manage ;
  Compta + Commerciale = aucun accès (spec § 5.2)
2026-06-18 14:36:05 +02:00
gitea-actions 5f2aa5334b chore: bump version to v0.1.138
Auto Tag Develop / tag (push) Successful in 7s
Build & Push Docker Image / build (push) Successful in 50s
v0.1.138
2026-06-18 08:51:36 +00:00
tristan 21b1c64a5f Merge pull request 'feat(transport) : upload décharge + i18n transporteur (ERP-171)' (#130) from feat/erp-171-carrier-upload-i18n into develop
Auto Tag Develop / tag (push) Successful in 9s
2026-06-18 08:50:13 +00:00
tristan fd89160c4b Merge pull request 'feat(transport) : consultation + modification transporteur (ERP-170)' (#129) from feat/erp-170-carrier-view-edit into develop
Auto Tag Develop / tag (push) Successful in 7s
2026-06-18 08:50:07 +00:00
tristan 8daf0ff5d4 Merge pull request 'feat(transport) : onglet prix transporteur (ERP-169)' (#128) from feat/erp-169-carrier-prices into develop
Auto Tag Develop / tag (push) Successful in 9s
2026-06-18 08:49:57 +00:00
tristan 87c53c354b Merge pull request 'feat(transport) : onglet contacts transporteur (ERP-168)' (#127) from feat/erp-168-carrier-contacts into develop
Auto Tag Develop / tag (push) Successful in 9s
2026-06-18 08:49:50 +00:00
tristan f8b45cb30b Merge pull request 'feat(transport) : onglet adresses transporteur (ERP-167)' (#126) from feat/erp-167-carrier-addresses into develop
Auto Tag Develop / tag (push) Successful in 8s
2026-06-18 08:49:37 +00:00
tristan 0c0b57f898 Merge pull request 'feat(transport) : saisie assistée QUALIMAT + champs conditionnels (ERP-166)' (#123) from feat/erp-166-qualimat-search into develop
Auto Tag Develop / tag (push) Successful in 8s
2026-06-18 08:49:25 +00:00
tristan c18566124a Merge pull request 'feat(transport) : écran ajout transporteur — layout + formulaire principal (ERP-165)' (#122) from feat/erp-165-carrier-new into develop
Auto Tag Develop / tag (push) Successful in 9s
2026-06-18 08:49:15 +00:00
gitea-actions f767733b87 chore: bump version to v0.1.131
Auto Tag Develop / tag (push) Successful in 8s
Build & Push Docker Image / build (push) Successful in 1m26s
v0.1.131
2026-06-18 08:48:56 +00:00
tristan 40da5dfb31 Merge pull request 'feat(transport) : page répertoire transporteurs (ERP-164)' (#121) from feat/erp-164-carriers-list into develop
Auto Tag Develop / tag (push) Successful in 10s
2026-06-18 08:48:45 +00:00
tristan d304b74289 refactor(transport) : supprime les reliquats multi-adresses — colonne position, dead code front, docblocks 1:n (ERP-172)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m20s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m39s
2026-06-18 10:38:25 +02:00
tristan 80b3741f64 style(transport) : tableau prix consultation — colonne « Type de transport » à 170px (ERP-172)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m3s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m32s
2026-06-17 17:58:06 +02:00
tristan c468374b16 style(transport) : tableau prix consultation — « Type de transport » (colonne élargie, en-tête centré) (ERP-172)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Has been cancelled
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Has been cancelled
2026-06-17 17:57:26 +02:00
tristan 7ddf495d7f style(transport) : tableau prix consultation — code du site (département) + en-têtes Forfait/Tonne (€) (ERP-172)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m15s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m31s
2026-06-17 17:46:58 +02:00
tristan 9fcf5c24f6 feat(transport) : retour au répertoire après validation du dernier onglet (création) (ERP-172)
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Has been cancelled
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Has been cancelled
2026-06-17 17:44:34 +02:00
tristan 76fb01c063 feat(transport) : modif — onglet Qualimat (actualisation) + certification éditable (déliage Qualimat) (ERP-172)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m14s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Has been cancelled
2026-06-17 17:40:05 +02:00
tristan e76bd1dd63 feat(transport) : adresse unique par transporteur (OneToOne back + un seul bloc front) (ERP-172) 2026-06-17 17:32:29 +02:00
tristan 498cef8cc0 fix(transport) : embarque le nom de la décharge dans le détail carrier (consultation/modif) (ERP-171)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m15s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m50s
2026-06-17 16:08:08 +02:00
tristan 7668d77c78 fix(transport) : upload décharge différé à l'enregistrement/validation (évite les orphelins) (ERP-171) 2026-06-17 16:08:08 +02:00
tristan 1d5110d000 feat(transport) : upload décharge (useUpload) + câblage MalioInputUpload + i18n erreur (ERP-171) 2026-06-17 16:08:08 +02:00
tristan b6b5bb06e8 fix(transport) : affiche le message 409 (homonyme) à la restauration + virgule décimale dans sanitizeDecimal (ERP-170)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m7s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m41s
2026-06-17 16:08:02 +02:00
tristan fb9c15c52a fix(transport) : pré-validation front du bloc prix — erreurs inline sous tous les champs requis (selects branche) (ERP-169)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m4s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m34s
2026-06-17 16:08:02 +02:00
tristan c371057c0b style(transport) : tableau prix — réduit Adresse sites au profit d'Adresse livraisons (ERP-170) 2026-06-17 16:08:02 +02:00
tristan e1712465f1 fix(transport) : bloc prix — radios sens/contenant/tarif horizontaux et centrés (h-12) en colonne 1 (ERP-169) 2026-06-17 16:08:02 +02:00
tristan 5125883e21 fix(transport) : tableau prix — corrige l'inversion Adresse sites / Adresse livraisons (ERP-170) 2026-06-17 16:08:02 +02:00
tristan 6ff5b13ce2 fix(transport) : bloc prix par défaut (CLIENT), sens seul en ligne 1, payload omet scalaires vides (422 inline au lieu de 400) (ERP-169) 2026-06-17 16:08:02 +02:00
tristan 5bbd4ddb47 style(transport) : tableau prix — libellés colonnes + élargit Transporteurs/Adresse livraisons, réduit Forfait/Tonne/Indexation/État (ERP-170) 2026-06-17 16:08:02 +02:00
tristan a26bb09ee1 fix(transport) : bloc prix — radios sans label de groupe, sens en colonne 1, défaut Benne/Forfait (ERP-169) 2026-06-17 16:08:02 +02:00
tristan 20296ac149 style(transport) : datatable qualimat table-fixed (radio étroit, colonnes égales) + icônes onglets prix/qualimat (ERP-170) 2026-06-17 16:08:02 +02:00
tristan 07e0bcbcce feat(transport) : onglet prix transporteur (ERP-169) 2026-06-17 16:08:02 +02:00
tristan fe1d012548 style(transport) : tableau prix consultation en table-fixed (colonnes à parts égales, contenant étroit) (ERP-170) 2026-06-17 16:08:02 +02:00
tristan d86dc69cf2 feat(transport) : consultation — contenant en radios lecture seule (aligné ajout/modif) (ERP-170) 2026-06-17 16:08:02 +02:00
tristan 07ed57f283 feat(transport) : contenant du formulaire principal en radios centrés (Benne par défaut) (ERP-170) 2026-06-17 16:08:02 +02:00
tristan b5749520bc fix(transport) : consultation — disposition du bloc principal alignée sur l'ajout (LIOT, décharge col 3, affréter col 4) (ERP-170) 2026-06-17 16:08:02 +02:00
tristan 02d2fde653 fix(transport) : indexation réellement plafonnée à 100 % — re-synchronise le champ amount contrôlé via :key (ERP-170) 2026-06-17 16:08:02 +02:00