feat(front) : branchement site courant + formats d'affichage (ERP-191) #143

Closed
tristan wants to merge 12 commits from feat/erp-191-i18n-site-courant into feat/erp-190-ecran-modification-ticket-pesee
Showing only changes of commit 68e7205793 - Show all commits
@@ -95,6 +95,10 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
'default:read',
]],
denormalizationContext: ['groups' => ['weighing_ticket:write']],
// Erreurs de denormalisation (date non parsable, type/IRI invalide)
// remontees en 422 avec propertyPath (et non 400 opaque) -> mapping
// inline par champ cote front via useFormErrors (miroir M1 Client).
collectDenormalizationErrors: true,
processor: WeighingTicketProcessor::class,
),
new Patch(
@@ -108,6 +112,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
'default:read',
]],
denormalizationContext: ['groups' => ['weighing_ticket:write']],
collectDenormalizationErrors: true,
provider: WeighingTicketProvider::class,
processor: WeighingTicketProcessor::class,
),
@@ -190,8 +195,15 @@ class WeighingTicket implements TimestampableInterface, BlamableInterface
#[Groups(['weighing_ticket:item:read', 'weighing_ticket:write'])]
private ?DateTimeImmutable $emptyDate = null;
/** Poids a vide (tare) en kg — readonly UI, rempli par la pesee (RG-5.07). */
/**
* Poids a vide (tare) en kg — readonly UI, rempli par la pesee (RG-5.07).
* Obligatoire : un ticket est cree APRES la pesee a vide (POST). NotBlank ici
* (et non sur empty_dsd, alloue serveur) rend la 422 « poids obligatoire »
* coherente avec les autres champs requis (counterpartyType / immatriculation),
* toutes renvoyees d'un coup -> mapping inline front (ERP-101).
*/
#[ORM\Column(name: 'empty_weight', nullable: true)]
#[Assert\NotBlank(message: 'Le poids est obligatoire : effectuez une pesée.')]
#[Groups(['weighing_ticket:item:read', 'weighing_ticket:write'])]
private ?int $emptyWeight = null;