- Add billing fields to User (isBilling, billingAmount, billingState, billingStripeSubscriptionId) and OrganizerInvitation (billingAmount) - Registration: organizer gets billingState="poor" (pending review) - Admin approval: sets isBilling=true, billingAmount from form, state="good" - Invitation: billingAmount from invitation, if 0 then isBilling=false - ROLE_ROOT accounts: billing free (amount=0, state="good") - Block Stripe Connect creation and all organizer features if state is "poor" or "suspendu" - Hide Stripe configuration section if billing not settled - Add billing checkout via Stripe subscription with success route - Webhooks: checkout.session.completed activates billing, invoice.payment_failed and customer.subscription.deleted suspend account and disable online events - Show billing alert on /mon-compte with amount and subscribe button - Display billing info in invitation email and landing page - Add email templates for billing activated/failed/cancelled Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20260324131819 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add billing fields to user and organizer_invitation tables';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE organizer_invitation ADD billing_amount INT DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE "user" ADD is_billing BOOLEAN DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE "user" ADD billing_amount INT DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE "user" ADD billing_state VARCHAR(20) DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE "user" ADD billing_stripe_subscription_id VARCHAR(255) DEFAULT NULL');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE organizer_invitation DROP billing_amount');
|
|
$this->addSql('ALTER TABLE "user" DROP is_billing');
|
|
$this->addSql('ALTER TABLE "user" DROP billing_amount');
|
|
$this->addSql('ALTER TABLE "user" DROP billing_state');
|
|
$this->addSql('ALTER TABLE "user" DROP billing_stripe_subscription_id');
|
|
}
|
|
}
|