311e758dea
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.
84 lines
2.0 KiB
PHP
84 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Module\Commercial\Domain\Entity;
|
|
|
|
use App\Module\Commercial\Infrastructure\Doctrine\DoctrinePaymentDelayRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
|
|
|
/**
|
|
* Delai de reglement applique a un client (15 jours, 30 jours, a reception) :
|
|
* referentiel statique seede par la migration M1 et re-seede en dev/test par
|
|
* CommercialReferentialFixtures.
|
|
*
|
|
* Lecture seule au M1 (HP-M2-2). Pas de Timestampable/Blamable (referentiel
|
|
* statique whiteliste dans EntitiesAreTimestampableBlamableTest::EXCLUDED). Le
|
|
* groupe `client:read:accounting` permet l'embarquement dans la reponse Client.
|
|
*/
|
|
#[ORM\Entity(repositoryClass: DoctrinePaymentDelayRepository::class)]
|
|
#[ORM\Table(name: 'payment_delay')]
|
|
#[ORM\UniqueConstraint(name: 'uq_payment_delay_code', columns: ['code'])]
|
|
class PaymentDelay
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
#[Groups(['payment_delay:read', 'client:read:accounting'])]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(length: 30)]
|
|
#[Groups(['payment_delay:read', 'client:read:accounting'])]
|
|
private ?string $code = null;
|
|
|
|
#[ORM\Column(length: 120)]
|
|
#[Groups(['payment_delay:read', 'client:read:accounting'])]
|
|
private ?string $label = null;
|
|
|
|
#[ORM\Column(options: ['default' => 0])]
|
|
#[Groups(['payment_delay:read'])]
|
|
private int $position = 0;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getCode(): ?string
|
|
{
|
|
return $this->code;
|
|
}
|
|
|
|
public function setCode(string $code): static
|
|
{
|
|
$this->code = $code;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getLabel(): ?string
|
|
{
|
|
return $this->label;
|
|
}
|
|
|
|
public function setLabel(string $label): static
|
|
{
|
|
$this->label = $label;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getPosition(): int
|
|
{
|
|
return $this->position;
|
|
}
|
|
|
|
public function setPosition(int $position): static
|
|
{
|
|
$this->position = $position;
|
|
|
|
return $this;
|
|
}
|
|
}
|