dacf67535d
Pendant du telephone secondaire (max 2). Bump @malio/layer-ui 1.7.8 (prop addable du MalioInputEmail). - back : colonne billing_email_secondary (migration + COMMENT + catalogue), propriete ClientAddress (Email + Length), Callback etendu (2e email interdit hors facturation, optionnel sinon), normalisation lowercase au Processor. - front : draft + flag UI hasSecondaryBillingEmail, mappers, payloads, champ MalioInputEmail :addable -> revele un 2e champ ; layout : 2e email qui coule dans la grille et Adresse complementaire sur une colonne. - tests back (2 emails / 2e email hors facturation) et front (payload).
52 lines
1.7 KiB
PHP
52 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Commercial — second email de facturation (optionnel) sur une adresse client.
|
|
*
|
|
* Ajoute `billing_email_secondary` sur `client_address`, pendant du telephone
|
|
* secondaire du contact (max 2 emails). Optionnel ; comme l'email principal, il
|
|
* n'a de sens que sur une adresse de facturation (validateBillingEmailPresence).
|
|
*
|
|
* Migration au namespace racine `DoctrineMigrations` (regle ABSOLUE n°11).
|
|
*/
|
|
final class Version20260609140000 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Commercial : 2e email de facturation optionnel (billing_email_secondary) sur client_address.';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE client_address ADD COLUMN billing_email_secondary VARCHAR(180) DEFAULT NULL');
|
|
|
|
$this->comment('client_address', 'billing_email_secondary', '2e email de facturation, optionnel (max 2). Interdit hors facturation (validateBillingEmailPresence), normalise en minuscules (RG-1.21).');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE client_address DROP COLUMN billing_email_secondary');
|
|
}
|
|
|
|
/**
|
|
* Emet un `COMMENT ON COLUMN` en dollar-quoting Postgres ($_$...$_$) pour
|
|
* eviter tout echappement.
|
|
*/
|
|
private function comment(string $table, string $column, string $description): void
|
|
{
|
|
$this->addSql(sprintf(
|
|
'COMMENT ON COLUMN %s.%s IS $_$%s$_$',
|
|
'"'.str_replace('"', '""', $table).'"',
|
|
'"'.str_replace('"', '""', $column).'"',
|
|
$description,
|
|
));
|
|
}
|
|
}
|