# Generated by Django 5.2 on 2025-09-17 18:49

import django.core.validators
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0134_merge_20250917_1942'),
    ]

    operations = [
        migrations.CreateModel(
            name='OrganizationBilling',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subscription', models.CharField(choices=[('free', 'Free'), ('startup', 'Startup')], default='free', help_text="The organization's subscription plan", max_length=32)),
                ('billing_cycle_anchor', models.IntegerField(default=1, help_text='Day of the month when billing cycle starts (1-31).', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(31)])),
                ('stripe_customer_id', models.CharField(blank=True, help_text='Stripe customer identifier for the organization', max_length=255, null=True)),
                ('stripe_subscription_id', models.CharField(blank=True, help_text='Stripe subscription identifier for the organization', max_length=255, null=True)),
                ('cancel_at', models.DateTimeField(blank=True, help_text='Timestamp when the subscription is scheduled to cancel', null=True)),
                ('cancel_at_period_end', models.BooleanField(default=False, help_text='Whether the subscription will cancel at the end of the period')),
                ('downgraded_at', models.DateTimeField(blank=True, help_text='Timestamp when the organization was downgraded to free', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('organization', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='billing', to='api.organization')),
            ],
            options={
                'verbose_name': 'Organization Billing',
                'verbose_name_plural': 'Organization Billing',
            },
        ),
    ]
