feat : M5 — Tickets de pesée (ERP-188 → ERP-193) (#144)
Auto Tag Develop / tag (push) Successful in 8s
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:
@@ -220,7 +220,8 @@ abstract class AbstractWeighingTicketApiTestCase extends AbstractApiTestCase
|
||||
|
||||
/**
|
||||
* POST un ticket et renvoie la reponse (assertions de statut a la charge de
|
||||
* l'appelant).
|
||||
* l'appelant). Cree un BROUILLON (status DRAFT, sans numero, ERP-193) — la
|
||||
* validation est portee par validateTicket().
|
||||
*/
|
||||
protected function postTicket(Client $http, array $payload): ResponseInterface
|
||||
{
|
||||
@@ -230,6 +231,32 @@ abstract class AbstractWeighingTicketApiTestCase extends AbstractApiTestCase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* « Valider » un ticket : PATCH /weighing_tickets/{id}/validate (ERP-193).
|
||||
* Declenche la validation stricte (groupe finalize) + attribution du numero +
|
||||
* passage en VALIDATED. Body vide par defaut = on valide l'etat deja persiste.
|
||||
*/
|
||||
protected function validateTicket(Client $http, int $id, array $payload = []): ResponseInterface
|
||||
{
|
||||
return $http->request('PATCH', '/api/weighing_tickets/'.$id.'/validate', [
|
||||
'headers' => ['Content-Type' => self::MERGE],
|
||||
'json' => [] === $payload ? new \stdClass() : $payload,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST un brouillon complet puis le valide ; renvoie le ticket VALIDE (numero
|
||||
* attribue). Le payload doit porter contrepartie + immatriculation + 2 pesees.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function createValidatedTicket(Client $http, array $payload): array
|
||||
{
|
||||
$id = (int) $this->postTicket($http, $payload)->toArray()['id'];
|
||||
|
||||
return $this->validateTicket($http, $id)->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrouve un membre d'une collection Hydra par son id.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user