feat(commercial) : messages de validation FR sur les contraintes back + garde-fou (ERP-107)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 1m45s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m12s

Audit et complete les messages des contraintes #[Assert\*] des entites metier
(pendant back du mapping d'erreur par champ front ERP-101) :

- Message FR explicite sur toutes les contraintes (Email, NotBlank, Length,
  Bic, Iban, PositiveOrZero, Count...) des entites Client, ClientContact,
  ClientAddress, ClientRib, Category, Role, User.
- Ajout des Assert\Length manquantes calees sur le length de la colonne ORM
  (telephones VARCHAR(20), siren, nTva, accountNumber, username...) : evite
  une erreur Postgres 500 non rattachee au champ au profit d'une 422 propre.
- Locale FR globale (symfony/translation + default_locale: fr) comme filet
  pour les messages natifs non surcharges.
- Garde-fou tests/Architecture/EntityConstraintsHaveFrenchMessageTest : echoue
  si une contrainte n'a pas de message FR explicite ou si Assert\Length.max
  diverge du length ORM (whitelist justifiee pour les formats Bic/Iban/Regex).
- Test fonctionnel du JSON 422 reel (message FR + propertyPath consommable
  par useFormErrors cote front).
- Convention documentee dans .claude/rules/backend.md.

Tests : 469 verts (1793 assertions).
This commit is contained in:
Matthieu
2026-06-04 10:11:33 +02:00
parent 97301dcd6c
commit 9202d2ee6f
16 changed files with 617 additions and 26 deletions
Generated
+94 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "aada2e60fd7563f1498b5505b37e3f4b",
"content-hash": "2dc5db01e7f5d6aecd5956749b21a092",
"packages": [
{
"name": "api-platform/doctrine-common",
@@ -7657,6 +7657,99 @@
],
"time": "2026-03-30T15:14:47+00:00"
},
{
"name": "symfony/translation",
"version": "v8.0.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "f63e9342e12646a57c91ef8a366a4f9d8e557b67"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/f63e9342e12646a57c91ef8a366a4f9d8e557b67",
"reference": "f63e9342e12646a57c91ef8a366a4f9d8e557b67",
"shasum": ""
},
"require": {
"php": ">=8.4",
"symfony/polyfill-mbstring": "^1.0",
"symfony/translation-contracts": "^3.6.1"
},
"conflict": {
"nikic/php-parser": "<5.0",
"symfony/http-client-contracts": "<2.5",
"symfony/service-contracts": "<2.5"
},
"provide": {
"symfony/translation-implementation": "2.3|3.0"
},
"require-dev": {
"nikic/php-parser": "^5.0",
"psr/log": "^1|^2|^3",
"symfony/config": "^7.4|^8.0",
"symfony/console": "^7.4|^8.0",
"symfony/dependency-injection": "^7.4|^8.0",
"symfony/finder": "^7.4|^8.0",
"symfony/http-client-contracts": "^2.5|^3.0",
"symfony/http-kernel": "^7.4|^8.0",
"symfony/intl": "^7.4|^8.0",
"symfony/polyfill-intl-icu": "^1.21",
"symfony/routing": "^7.4|^8.0",
"symfony/service-contracts": "^2.5|^3",
"symfony/yaml": "^7.4|^8.0"
},
"type": "library",
"autoload": {
"files": [
"Resources/functions.php"
],
"psr-4": {
"Symfony\\Component\\Translation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v8.0.10"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2026-05-06T11:30:54+00:00"
},
{
"name": "symfony/translation-contracts",
"version": "v3.6.1",