feat : M5 — Tickets de pesée (ERP-188 → ERP-193) (#144)
Auto Tag Develop / tag (push) Successful in 8s

MR unique regroupant tout le module M5 « Tickets de pesée » (remplace les MR empilées #140/#141/#142/#143).

## Périmètre
- **ERP-188** — Page liste des tickets de pesée + export XLSX (colonnes Fournisseur/Client/Autre + Statut).
- **ERP-189** — Écran « Ajouter » (4 champs en haut, 2 blocs de pesée, pesée bascule/manuelle, date+heure horodatée à la validation).
- **ERP-190** — Écran « Modifier » + bouton Imprimer.
- **ERP-191** — i18n + libellés + branchement site courant.
- **ERP-192** — Bon de pesée PDF généré côté back (template Twig → Dompdf), endpoint `GET /api/weighing_tickets/{id}/print.pdf`.
- **ERP-193** — Cycle de vie brouillon/validé (status DRAFT/VALIDATED, numéro attribué à la validation), DSD saisi conservé en pesée manuelle, retours métier design.

## Vérifications
- Back : tests Logistique + architecture verts, php-cs-fixer propre, migrations appliquées (dev + test).
- Front : suite Vitest complète verte, ESLint propre.

Base : `develop` — contient les 16 commits du M5 (rien d'autre).
Reviewed-on: #144
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #144.
This commit is contained in:
2026-06-24 14:38:01 +00:00
committed by Autin
parent a4158d4e37
commit faafd99ef8
47 changed files with 4121 additions and 254 deletions
@@ -26,13 +26,12 @@ final class WeighingTicketNumberingTest extends AbstractWeighingTicketApiTestCas
$http = $this->authManageOnSite($site);
$client = $this->seedTestClient('Num');
$first = $this->postTicket($http, $this->validClientTicketPayload($client));
self::assertResponseStatusCodeSame(201);
$second = $this->postTicket($http, $this->validClientTicketPayload($client));
self::assertResponseStatusCodeSame(201);
// Le numero est attribue a la VALIDATION (brouillon -> valide, ERP-193).
$first = $this->createValidatedTicket($http, $this->validClientTicketPayload($client));
$second = $this->createValidatedTicket($http, $this->validClientTicketPayload($client));
$n1 = (string) $first->toArray()['number'];
$n2 = (string) $second->toArray()['number'];
$n1 = (string) $first['number'];
$n2 = (string) $second['number'];
self::assertMatchesRegularExpression('/^86-TP-\d{4}$/', $n1);
self::assertMatchesRegularExpression('/^86-TP-\d{4}$/', $n2);
@@ -49,8 +48,8 @@ final class WeighingTicketNumberingTest extends AbstractWeighingTicketApiTestCas
$http86 = $this->authManageOnSite($this->siteByCode('86'));
$http17 = $this->authManageOnSite($this->siteByCode('17'));
$n86 = (string) $this->postTicket($http86, $this->validClientTicketPayload($client))->toArray()['number'];
$n17 = (string) $this->postTicket($http17, $this->validClientTicketPayload($client))->toArray()['number'];
$n86 = (string) $this->createValidatedTicket($http86, $this->validClientTicketPayload($client))['number'];
$n17 = (string) $this->createValidatedTicket($http17, $this->validClientTicketPayload($client))['number'];
// Chaque site encode son propre code dans le numero ; sequences disjointes.
self::assertStringStartsWith('86-TP-', $n86);
@@ -63,7 +62,8 @@ final class WeighingTicketNumberingTest extends AbstractWeighingTicketApiTestCas
$http = $this->authManageOnSite($site);
$client = $this->seedTestClient('Immutable');
$created = $this->postTicket($http, $this->validClientTicketPayload($client))->toArray();
// Ticket valide (numero attribue) puis tentative de re-ecriture.
$created = $this->createValidatedTicket($http, $this->validClientTicketPayload($client));
$id = (int) $created['id'];
$number = (string) $created['number'];