# Generated by Django 5.1.6 on 2025-03-24 06:56

import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import ott_subscription.models
from decimal import Decimal
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='OTT',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('code', models.CharField(max_length=255, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='ott_images/', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['jpg', 'jpeg', 'png', 'gif'])])),
            ],
        ),
        migrations.CreateModel(
            name='OTTAggregator',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('code', models.CharField(max_length=50, unique=True)),
                ('status', models.CharField(choices=[('active', 'Active'), ('inactive', 'Inactive')], default='active', max_length=50)),
            ],
            options={
                'verbose_name': 'OTT Aggregator',
                'verbose_name_plural': 'OTT Aggregators',
            },
        ),
        migrations.CreateModel(
            name='VerificationCode',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, unique=True)),
                ('phone_number', models.CharField(blank=True, max_length=15, null=True)),
                ('code', models.CharField(max_length=6)),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='OTTActivationLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('client_id', models.CharField(max_length=255)),
                ('plan_id', models.CharField(max_length=255)),
                ('activation_date', models.DateTimeField(auto_now_add=True)),
                ('status', models.CharField(default='Success', max_length=50)),
                ('message', models.TextField(blank=True, null=True)),
                ('input', models.JSONField(blank=True, null=True)),
                ('response_status', models.IntegerField(blank=True, null=True)),
                ('output', models.JSONField(blank=True, null=True)),
                ('endpoint', models.CharField(blank=True, max_length=5000, null=True)),
                ('subscription_tiers', models.CharField(default='free', max_length=50)),
                ('razorpay_payment_id', models.CharField(blank=True, max_length=255, null=True)),
                ('razorpay_signature', models.CharField(blank=True, max_length=255, null=True)),
                ('razorpay_order_id', models.CharField(blank=True, max_length=255, null=True)),
                ('payment_verified', models.BooleanField(default=False)),
                ('payment_amount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('payment_currency', models.CharField(blank=True, max_length=10, null=True)),
                ('expiration_date', models.DateTimeField(default=ott_subscription.models.get_expiration_date)),
                ('platform_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ott_subscription.ottaggregator')),
            ],
        ),
        migrations.CreateModel(
            name='OTTPlan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('code', models.CharField(max_length=20, unique=True)),
                ('status', models.CharField(choices=[('active', 'Active'), ('inactive', 'Inactive')], default='active', max_length=10)),
                ('price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('otts', models.ManyToManyField(related_name='ott_plans_associated', to='ott_subscription.ott')),
                ('platform_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ott_subscription.ottaggregator')),
            ],
        ),
        migrations.CreateModel(
            name='OTTSubscription',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('client_id', models.CharField(max_length=255)),
                ('plan_id', models.CharField(max_length=255)),
                ('subscription_date', models.DateTimeField(auto_now_add=True)),
                ('platform_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ott_subscription.ottaggregator')),
            ],
        ),
        migrations.CreateModel(
            name='SkylinkPlan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('code', models.CharField(max_length=50, unique=True)),
                ('status', models.CharField(choices=[('active', 'Active'), ('inactive', 'Inactive')], default='active', max_length=10)),
                ('ott_plans', models.ManyToManyField(to='ott_subscription.ottplan')),
            ],
        ),
    ]
