feat(Customer): Ajoute la gestion des échéances de paiement client

Ajoute l'entité CustomerSplit et les services associés pour gérer
les échéances de paiement des clients (PDF, envoi mail, etc.).
This commit is contained in:
Serreau Jovann
2025-10-09 09:18:01 +02:00
parent 57eac4d32a
commit aff07c97e1
40 changed files with 1453 additions and 45 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251008065523 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customer_advert_payment ADD type_payment VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE customer_advert_payment DROP type_payment');
}
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251008084118 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customer_order ADD is_lock BOOLEAN DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE customer_order DROP is_lock');
}
}

View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251008124926 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE customer_split (id SERIAL NOT NULL, customer_id INT DEFAULT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, num VARCHAR(255) NOT NULL, amount DOUBLE PRECISION NOT NULL, state VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_7FC0EF2A9395C3F3 ON customer_split (customer_id)');
$this->addSql('COMMENT ON COLUMN customer_split.create_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE TABLE customer_split_line (id SERIAL NOT NULL, split_id INT DEFAULT NULL, date_prev TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, amount DOUBLE PRECISION NOT NULL, state VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_B054515F3DDC68C5 ON customer_split_line (split_id)');
$this->addSql('COMMENT ON COLUMN customer_split_line.date_prev IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE customer_split ADD CONSTRAINT FK_7FC0EF2A9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE customer_split_line ADD CONSTRAINT FK_B054515F3DDC68C5 FOREIGN KEY (split_id) REFERENCES customer_split (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE customer_split DROP CONSTRAINT FK_7FC0EF2A9395C3F3');
$this->addSql('ALTER TABLE customer_split_line DROP CONSTRAINT FK_B054515F3DDC68C5');
$this->addSql('DROP TABLE customer_split');
$this->addSql('DROP TABLE customer_split_line');
}
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251008125048 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customer_split ADD description TEXT NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE customer_split DROP description');
}
}

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251008133426 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customer_split ADD submission_id VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE customer_split_line ADD payment_id VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE customer_split_line DROP payment_id');
$this->addSql('ALTER TABLE customer_split DROP submission_id');
}
}