feat(commercial) : add M1 client entities + accounting referentials + repositories
Entites metier (Client, ClientContact, ClientAddress, ClientRib) avec #[Auditable] + Timestampable/Blamable, et 4 referentiels comptables statiques (TvaMode, PaymentDelay, PaymentType, Bank). 8 repositories interfaces + impl Doctrine. Aucun ApiResource (Provider/Processor = ERP-55). - Client : 2 FK auto-referentes distributor/broker (mutuellement exclusives, CHECK en base), M2M categories, FK referentiels comptables, groupes de serialisation par onglet. Pas de #[ORM\UniqueConstraint] : unicite du nom de societe portee par l'index partiel Postgres (decision Q4). - ClientRib : tous les champs audites, aucun #[AuditIgnore] sur iban/bic (decision 29/05, audit admin-only). - M2M Category via le contrat Shared CategoryInterface + resolve_target_entities (regle n°1, pas d'import inter-modules) ; sites via SiteInterface. - CommercialReferentialFixtures : re-seed idempotent des 4 referentiels (sinon vides apres db-reset car desormais tables mappees, purgees par les fixtures). - Referentiels whitelistes dans EntitiesAreTimestampableBlamableTest::EXCLUDED. - doctrine.yaml : mapping ORM du module Commercial + resolve CategoryInterface. - ColumnCommentsCatalog : ajout des colonnes M1 (chemin schema:update/test) ; migration retrofit Version20260528120000 filtree sur les tables existantes pour ne pas casser sur les tables des modules crees plus tard. - makefile test-db-setup : recreation de l'index partiel uq_client_company_name_active. Refs ERP-54.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\Bank;
|
||||
|
||||
interface BankRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?Bank;
|
||||
|
||||
/**
|
||||
* Retourne toutes les banques triees position ASC puis label ASC.
|
||||
*
|
||||
* @return list<Bank>
|
||||
*/
|
||||
public function findAllOrdered(): array;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\ClientAddress;
|
||||
|
||||
interface ClientAddressRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?ClientAddress;
|
||||
|
||||
public function save(ClientAddress $address): void;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\ClientContact;
|
||||
|
||||
interface ClientContactRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?ClientContact;
|
||||
|
||||
public function save(ClientContact $contact): void;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\Client;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
|
||||
interface ClientRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?Client;
|
||||
|
||||
public function save(Client $client): void;
|
||||
|
||||
/**
|
||||
* Construit un QueryBuilder de liste pour le repertoire clients.
|
||||
* - Exclut toujours les clients soft-deletes (deleted_at IS NOT NULL, RG-1.24).
|
||||
* - Exclut les archives sauf si $includeArchived = true (RG-1.25).
|
||||
* - Tri par defaut : companyName ASC (RG-1.26).
|
||||
*/
|
||||
public function createListQueryBuilder(bool $includeArchived = false): QueryBuilder;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\ClientRib;
|
||||
|
||||
interface ClientRibRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?ClientRib;
|
||||
|
||||
public function save(ClientRib $rib): void;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\PaymentDelay;
|
||||
|
||||
interface PaymentDelayRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?PaymentDelay;
|
||||
|
||||
/**
|
||||
* Retourne tous les delais de reglement tries position ASC puis label ASC.
|
||||
*
|
||||
* @return list<PaymentDelay>
|
||||
*/
|
||||
public function findAllOrdered(): array;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\PaymentType;
|
||||
|
||||
interface PaymentTypeRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?PaymentType;
|
||||
|
||||
/**
|
||||
* Retourne tous les types de reglement tries position ASC puis label ASC.
|
||||
*
|
||||
* @return list<PaymentType>
|
||||
*/
|
||||
public function findAllOrdered(): array;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Module\Commercial\Domain\Repository;
|
||||
|
||||
use App\Module\Commercial\Domain\Entity\TvaMode;
|
||||
|
||||
interface TvaModeRepositoryInterface
|
||||
{
|
||||
public function findById(int $id): ?TvaMode;
|
||||
|
||||
/**
|
||||
* Retourne tous les modes de TVA tries position ASC puis label ASC
|
||||
* (ordre des selecteurs, reutilise par la fixture de re-seed).
|
||||
*
|
||||
* @return list<TvaMode>
|
||||
*/
|
||||
public function findAllOrdered(): array;
|
||||
}
|
||||
Reference in New Issue
Block a user