76e7a59ba7
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).
19 lines
627 B
PHP
19 lines
627 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Module\Logistique\Domain\Exception;
|
|
|
|
use RuntimeException;
|
|
|
|
/**
|
|
* Levee quand une immatriculation ne respecte pas le masque SIV XX-000-XX alors
|
|
* que « Tout format » n'est PAS coche (plateFreeFormat = false, RG-5.01).
|
|
*
|
|
* Exception de DOMAINE (pure, sans dependance HTTP) levee par le
|
|
* WeighingTicketFieldNormalizer : c'est le WeighingTicketProcessor qui la traduit
|
|
* en 422 portant un propertyPath « immatriculation » (mapping inline useFormErrors,
|
|
* convention ERP-101) plutot qu'un toast.
|
|
*/
|
|
final class InvalidImmatriculationException extends RuntimeException {}
|