<?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 Version20250724084328 extends AbstractMigration
{
public function getDescription(): string
{
return 'Paiements en 3x - Gestion des points, commissions et index de paiement en 3x';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE app_product_point ADD points_month1 INT DEFAULT NULL, ADD points_month2 INT DEFAULT NULL, ADD points_month3 INT DEFAULT NULL');
$this->addSql('ALTER TABLE app_product_price ADD commission_month1 INT DEFAULT NULL AFTER subscription_commission, ADD commission_month2 INT DEFAULT NULL AFTER commission_month1, ADD commission_month3 INT DEFAULT NULL AFTER commission_month2');
$this->addSql('ALTER TABLE app_payment_history ADD is_installment TINYINT(1) NOT NULL DEFAULT 0, ADD index_installment INT DEFAULT NULL');
// Points
// Digital Europe
$this->addSql('UPDATE app_product_point SET points_month1 = 130, points_month2 = 98, points_month3 = 98 WHERE product_id IN (41) and market_id = 1;');
// Digital Asie/Afrique
$this->addSql('UPDATE app_product_point SET points_month1 = 66, points_month2 = 50, points_month3 = 50 WHERE product_id IN (41) and market_id IN (2, 3);');
// Ecom Europe
$this->addSql('UPDATE app_product_point SET points_month1 = 168, points_month2 = 126, points_month3 = 126 WHERE product_id IN (42) and market_id = 1;');
// Ecom Asie/Afrique
$this->addSql('UPDATE app_product_point SET points_month1 = 86, points_month2 = 64, points_month3 = 64 WHERE product_id IN (42) and market_id IN (2, 3);');
// Digital + Ecom Europe
$this->addSql('UPDATE app_product_point SET points_month1 = 128, points_month2 = 96, points_month3 = 96 WHERE product_id IN (44) and market_id = 1;');
// Digital + Ecom Asie/Afrique
$this->addSql('UPDATE app_product_point SET points_month1 = 64, points_month2 = 48, points_month3 = 48 WHERE product_id IN (44) and market_id IN (2, 3);');
// Premium 6 mois Europe
$this->addSql('UPDATE app_product_point SET points_month1 = 216, points_month2 = 162, points_month3 = 162 WHERE product_id IN (9) and nb_month = 6 and market_id = 1;');
// Premium 6 mois Asie/Afrique
$this->addSql('UPDATE app_product_point SET points_month1 = 120, points_month2 = 90, points_month3 = 90 WHERE product_id IN (9) and nb_month = 6 and market_id IN (2, 3);');
// Premium 12 mois Europe
$this->addSql('UPDATE app_product_point SET points_month1 = 360, points_month2 = 270, points_month3 = 270 WHERE product_id IN (9) and nb_month = 12 and market_id = 1;');
// Premium 12 mois Asie/Afrique
$this->addSql('UPDATE app_product_point SET points_month1 = 216, points_month2 = 162, points_month3 = 162 WHERE product_id IN (9) and nb_month = 12 and market_id IN (2, 3);');
// Full Gold / Silver 6 mois Europe
$this->addSql('UPDATE app_product_point SET points_month1 = 144, points_month2 = 108, points_month3 = 108 WHERE product_id IN (3, 7) and nb_month = 6 and market_id = 1;');
// Full Gold / Silver 6 mois Asie/Afrique
$this->addSql('UPDATE app_product_point SET points_month1 = 84, points_month2 = 63, points_month3 = 63 WHERE product_id IN (3, 7) and nb_month = 6 and market_id IN (2, 3);');
// Full Gold / Silver 12 mois Europe
$this->addSql('UPDATE app_product_point SET points_month1 = 240, points_month2 = 180, points_month3 = 180 WHERE product_id IN (3, 7) and nb_month = 12 and market_id = 1;');
// Full Gold / Silver 12 mois Asie/Afrique
$this->addSql('UPDATE app_product_point SET points_month1 = 130, points_month2 = 97, points_month3 = 97 WHERE product_id IN (3, 7) and nb_month = 12 and market_id IN (2, 3);');
// Commissions
// Digital Europe
$this->addSql('UPDATE app_product_price SET commission_month1 = 69, commission_month2 = 52, commission_month3 = 52 WHERE product_id IN (41) and market_id = 1;');
// Digital Asie/Afrique
$this->addSql('UPDATE app_product_price SET commission_month1 = 25, commission_month2 = 19, commission_month3 = 20 WHERE product_id IN (41) and market_id IN (2, 3);');
// Ecom Europe
$this->addSql('UPDATE app_product_price SET commission_month1 = 88, commission_month2 = 66, commission_month3 = 66 WHERE product_id IN (42) and market_id = 1;');
// Ecom Asie/Afrique
$this->addSql('UPDATE app_product_price SET commission_month1 = 44, commission_month2 = 33, commission_month3 = 33 WHERE product_id IN (42) and market_id IN (2, 3);');
// Digital + Ecom Europe
$this->addSql('UPDATE app_product_price SET commission_month1 = 67, commission_month2 = 50, commission_month3 = 50 WHERE product_id IN (44) and market_id = 1;');
// Digital + Ecom Asie/Afrique
$this->addSql('UPDATE app_product_price SET commission_month1 = 33, commission_month2 = 25, commission_month3 = 25 WHERE product_id IN (44) and market_id IN (2, 3);');
// Premium 6 mois Europe
$this->addSql('UPDATE app_product_price SET commission_month1 = 84, commission_month2 = 63, commission_month3 = 63 WHERE product_id IN (9) and nb_month = 6 and market_id = 1;');
// Premium 6 mois Asie/Afrique
$this->addSql('UPDATE app_product_price SET commission_month1 = 40, commission_month2 = 30, commission_month3 = 30 WHERE product_id IN (9) and nb_month = 6 and market_id IN (2, 3);');
// Premium 12 mois Europe
$this->addSql('UPDATE app_product_price SET commission_month1 = 160, commission_month2 = 120, commission_month3 = 120 WHERE product_id IN (9) and nb_month = 12 and market_id = 1;');
// Premium 12 mois Asie/Afrique
$this->addSql('UPDATE app_product_price SET commission_month1 = 58, commission_month2 = 43, commission_month3 = 44 WHERE product_id IN (9) and nb_month = 12 and market_id IN (2, 3);');
// Full Gold / Silver 6 mois Europe
$this->addSql('UPDATE app_product_price SET commission_month1 = 56, commission_month2 = 42, commission_month3 = 42 WHERE product_id IN (3, 7) and nb_month = 6 and market_id = 1;');
// Full Gold / Silver 6 mois Asie/Afrique
$this->addSql('UPDATE app_product_price SET commission_month1 = 16, commission_month2 = 12, commission_month3 = 12 WHERE product_id IN (3, 7) and nb_month = 6 and market_id IN (2, 3);');
// Full Gold / Silver 12 mois Europe
$this->addSql('UPDATE app_product_price SET commission_month1 = 104, commission_month2 = 78, commission_month3 = 78 WHERE product_id IN (3, 7) and nb_month = 12 and market_id = 1;');
// Full Gold / Silver 12 mois Asie/Afrique
$this->addSql('UPDATE app_product_price SET commission_month1 = 41, commission_month2 = 32, commission_month3 = 33 WHERE product_id IN (3, 7) and nb_month = 12 and market_id IN (2, 3);');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE app_product_point DROP points_month1, DROP points_month2, DROP points_month3');
$this->addSql('ALTER TABLE app_product_price DROP commission_month1, DROP commission_month2, DROP commission_month3');
$this->addSql('ALTER TABLE app_payment_history DROP is_installment, DROP index_installment');
}
}