597101262d
Auto Tag Develop / tag (push) Successful in 8s
## Contexte Résout **ERP-107** — pendant back du mapping d'erreur par champ front (ERP-101). Le front (`useFormErrors` / `mapViolationsToRecord`) affiche sous chaque champ le `message` renvoyé par le back. Ce ticket garantit que ces messages existent, sont en FR et rattachés au bon champ. ## Changements - **Messages FR explicites** sur toutes les contraintes `#[Assert\*]` des entités métier : `Client`, `ClientContact`, `ClientAddress`, `ClientRib`, `Category`, `Role`, `User` (Email, NotBlank, Length, Bic, Iban, PositiveOrZero, Count…). - **Contraintes `Assert\Length` manquantes ajoutées**, calées sur le `length` de la colonne ORM (téléphones `VARCHAR(20)`, `siren`, `nTva`, `accountNumber`, `username`…). Évite une erreur Postgres 500 non rattachée au champ → 422 propre. - **Locale FR globale** (`symfony/translation` + `default_locale: fr`) comme filet pour les messages natifs Symfony non surchargés. - **Garde-fou** `tests/Architecture/EntityConstraintsHaveFrenchMessageTest` : échoue si une contrainte n'a pas de message FR explicite (comparaison au défaut Symfony) ou si `Assert\Length.max` diverge du `length` ORM. Whitelist justifiée pour les formats auto-bornés (Bic/Iban/Regex CP/couleur hex). - **Test fonctionnel** du JSON 422 réel : message FR + `propertyPath` consommable par le front. - **Convention documentée** dans `.claude/rules/backend.md`. ## Décisions - Stratégie retenue : message FR **explicite sur toutes** les contraintes + locale FR en filet (les deux leviers du ticket). - Garde-fou `Length == ORM length` : **test bloquant** (anti-dérive). - RG-1.03 (distributor/broker) : pas de `Assert\Callback` ajouté — le `ClientProcessor` gère **déjà** l'exclusivité (422 + `propertyPath`). Pas de doublon. ## Hors périmètre / à suivre - **Alignement `nullable`(DB) / `NotBlank`(back) / `required`(front)** : les champs obligatoires existants ont été confirmés, mais aucun changement de nullabilité DB n'a été fait sans arbitrage métier. À recroiser avec les astérisques front (ERP-101 / PR #58) si divergence constatée. ## Vérifications - `make test` : **469 tests verts** (1793 assertions), 0 échec/erreur. - `php-cs-fixer` : 0 fichier à corriger. --------- Co-authored-by: admin malio <malio@yuno.malio.fr> Co-authored-by: Matthieu <contact@malio.fr> Reviewed-on: #59 Co-authored-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr> Co-committed-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr>
102 lines
2.9 KiB
JSON
102 lines
2.9 KiB
JSON
{
|
|
"type": "project",
|
|
"license": "proprietary",
|
|
"minimum-stability": "stable",
|
|
"prefer-stable": true,
|
|
"require": {
|
|
"php": ">=8.4",
|
|
"ext-ctype": "*",
|
|
"ext-iconv": "*",
|
|
"api-platform/doctrine-orm": "^4.2",
|
|
"api-platform/symfony": "^4.2",
|
|
"doctrine/doctrine-bundle": "^3.2",
|
|
"doctrine/doctrine-migrations-bundle": "^4.0",
|
|
"doctrine/orm": "^3.6",
|
|
"lexik/jwt-authentication-bundle": "^3.2",
|
|
"nelmio/cors-bundle": "^2.6",
|
|
"nyholm/psr7": "^1.8",
|
|
"phpdocumentor/reflection-docblock": "^5.6|^6.0",
|
|
"phpoffice/phpspreadsheet": "^5.7",
|
|
"phpstan/phpdoc-parser": "^2.3",
|
|
"symfony/asset": "8.0.*",
|
|
"symfony/console": "8.0.*",
|
|
"symfony/dotenv": "8.0.*",
|
|
"symfony/expression-language": "8.0.*",
|
|
"symfony/flex": "^2",
|
|
"symfony/framework-bundle": "8.0.*",
|
|
"symfony/intl": "8.0.*",
|
|
"symfony/mime": "8.0.*",
|
|
"symfony/monolog-bundle": "^4.0",
|
|
"symfony/property-access": "8.0.*",
|
|
"symfony/property-info": "8.0.*",
|
|
"symfony/rate-limiter": "8.0.*",
|
|
"symfony/runtime": "8.0.*",
|
|
"symfony/security-bundle": "8.0.*",
|
|
"symfony/serializer": "8.0.*",
|
|
"symfony/translation": "8.0.*",
|
|
"symfony/twig-bundle": "8.0.*",
|
|
"symfony/uid": "8.0.*",
|
|
"symfony/validator": "8.0.*",
|
|
"symfony/yaml": "8.0.*"
|
|
},
|
|
"config": {
|
|
"allow-plugins": {
|
|
"php-http/discovery": true,
|
|
"symfony/flex": true,
|
|
"symfony/runtime": true
|
|
},
|
|
"bump-after-update": true,
|
|
"sort-packages": true
|
|
},
|
|
"autoload": {
|
|
"psr-4": {
|
|
"App\\": "src/"
|
|
}
|
|
},
|
|
"autoload-dev": {
|
|
"psr-4": {
|
|
"App\\Tests\\": "tests/"
|
|
}
|
|
},
|
|
"replace": {
|
|
"symfony/polyfill-ctype": "*",
|
|
"symfony/polyfill-iconv": "*",
|
|
"symfony/polyfill-php72": "*",
|
|
"symfony/polyfill-php73": "*",
|
|
"symfony/polyfill-php74": "*",
|
|
"symfony/polyfill-php80": "*",
|
|
"symfony/polyfill-php81": "*",
|
|
"symfony/polyfill-php82": "*",
|
|
"symfony/polyfill-php83": "*",
|
|
"symfony/polyfill-php84": "*"
|
|
},
|
|
"scripts": {
|
|
"auto-scripts": {
|
|
"cache:clear": "symfony-cmd",
|
|
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
|
},
|
|
"post-install-cmd": [
|
|
"@auto-scripts"
|
|
],
|
|
"post-update-cmd": [
|
|
"@auto-scripts"
|
|
]
|
|
},
|
|
"conflict": {
|
|
"symfony/symfony": "*"
|
|
},
|
|
"extra": {
|
|
"symfony": {
|
|
"allow-contrib": false,
|
|
"require": "8.0.*"
|
|
}
|
|
},
|
|
"require-dev": {
|
|
"doctrine/doctrine-fixtures-bundle": "^4.3",
|
|
"friendsofphp/php-cs-fixer": "^3.94",
|
|
"phpunit/phpunit": "^13.0",
|
|
"symfony/browser-kit": "8.0.*",
|
|
"symfony/http-client": "8.0.*"
|
|
}
|
|
}
|