feat(technique) : validations RG comptables server-side (RG-3.07 Virement/banque, RG-3.08 LCR/RIB) (ERP-136)
- Provider::validatePaymentTypeConsistency (Assert\Callback, miroir Supplier ERP-89) : RG-3.07 VIREMENT impose une banque (violation sur bank), RG-3.08 LCR impose au moins un RIB (violation sur paymentType). - ProviderProcessor : docblock realigne (RG-3.07/3.08 portees par l'entite). - AbstractProviderApiTestCase::bank() helper referentiel. - ProviderAccountingValidationTest : 4 cas (negatif 422 / positif 200) par RG. Les RG-3.03/3.05/3.09 (contraintes d'entite) et l'ecriture cloisonnee (gardes processors, RG-3.17/2.13) etaient deja posees en ERP-133/134/135 et restent couvertes.
This commit is contained in:
@@ -7,6 +7,7 @@ namespace App\Tests\Module\Technique\Api;
|
||||
use ApiPlatform\Symfony\Bundle\Test\Client;
|
||||
use App\Module\Catalog\Domain\Entity\Category;
|
||||
use App\Module\Catalog\Domain\Entity\CategoryType;
|
||||
use App\Module\Commercial\Domain\Entity\Bank;
|
||||
use App\Module\Commercial\Domain\Entity\PaymentType;
|
||||
use App\Module\Core\Domain\Entity\Permission;
|
||||
use App\Module\Core\Domain\Entity\Role;
|
||||
@@ -335,6 +336,22 @@ abstract class AbstractProviderApiTestCase extends AbstractApiTestCase
|
||||
return $paymentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupere une banque seedee (CommercialReferentialFixtures) par code (ex. SG).
|
||||
* Echoue explicitement si absente (fixtures non chargees).
|
||||
*/
|
||||
protected function bank(string $code): Bank
|
||||
{
|
||||
$bank = $this->getEm()->getRepository(Bank::class)->findOneBy(['code' => $code]);
|
||||
|
||||
self::assertNotNull(
|
||||
$bank,
|
||||
sprintf('Banque "%s" introuvable : fixtures comptables chargees (make test-db-setup) ?', $code),
|
||||
);
|
||||
|
||||
return $bank;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indexe les violations d'un corps 422 par propertyPath (assert ciblee).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user