feat(commercial) : validation back de la relation + suivi de revue MR (ERP-119)
- validation serveur « relation choisie => FK obligatoire » : champ transitoire relationType (non persiste) + Assert\Callback portant la 422 sur distributor / broker, que le back ne pouvait pas deriver des seules FK nullable - mutualisation des payloads d'ecriture clients : new.vue consomme buildMainPayload / buildAddressPayload / buildRibPayload (fin de la duplication create/edit) - COMMENT ON TABLE client_address : ajout des types Courtier / Distributeur (catalogue + migration Version20260609120000) - tests : violationsByPath remonte dans AbstractCommercialApiTestCase (fin des copies inline) + couverture de la nouvelle RG relation
This commit is contained in:
@@ -241,10 +241,7 @@ final class ClientAddressTest extends AbstractCommercialApiTestCase
|
||||
])->toArray(false);
|
||||
|
||||
self::assertResponseStatusCodeSame(422);
|
||||
$byPath = [];
|
||||
foreach ($body['violations'] ?? [] as $v) {
|
||||
$byPath[$v['propertyPath']] = $v['message'];
|
||||
}
|
||||
$byPath = $this->violationsByPath($body);
|
||||
self::assertArrayHasKey('billingEmailSecondary', $byPath);
|
||||
}
|
||||
|
||||
@@ -402,10 +399,7 @@ final class ClientAddressTest extends AbstractCommercialApiTestCase
|
||||
])->toArray(false);
|
||||
|
||||
self::assertResponseStatusCodeSame(422);
|
||||
$byPath = [];
|
||||
foreach ($body['violations'] ?? [] as $v) {
|
||||
$byPath[$v['propertyPath']] = $v['message'];
|
||||
}
|
||||
$byPath = $this->violationsByPath($body);
|
||||
self::assertArrayHasKey('isProspect', $byPath);
|
||||
self::assertSame('Le type d\'adresse est obligatoire.', $byPath['isProspect']);
|
||||
}
|
||||
@@ -484,10 +478,7 @@ final class ClientAddressTest extends AbstractCommercialApiTestCase
|
||||
])->toArray(false);
|
||||
|
||||
self::assertResponseStatusCodeSame(422);
|
||||
$byPath = [];
|
||||
foreach ($body['violations'] ?? [] as $v) {
|
||||
$byPath[$v['propertyPath']] = $v['message'];
|
||||
}
|
||||
$byPath = $this->violationsByPath($body);
|
||||
self::assertArrayHasKey('isProspect', $byPath);
|
||||
self::assertSame('Une adresse Courtier ne peut pas avoir d\'autre type.', $byPath['isProspect']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user