# Generated by Django 4.1.3 on 2024-01-23 10:30

import ckeditor.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Extention',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(max_length=6)),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('transactionID', models.CharField(blank=True, max_length=100, null=True)),
                ('conversationID', models.CharField(blank=True, max_length=100, null=True)),
                ('reference_no', models.CharField(blank=True, max_length=150, null=True)),
                ('sub_id', models.CharField(max_length=255)),
                ('is_active', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ('created_at',),
            },
        ),
        migrations.CreateModel(
            name='Plan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plan_id', models.CharField(max_length=200, unique=True)),
                ('plan_type', models.CharField(max_length=30)),
                ('plan_name', models.CharField(max_length=30)),
                ('plan_duration', models.CharField(choices=[('Yearly', 'Yearly'), ('Monthly', 'Monthly'), ('Weekly', 'Weekly')], default='Monthly', max_length=25)),
                ('describe', ckeditor.fields.RichTextField()),
                ('price', models.FloatField(default=0)),
                ('paymentSource', models.CharField(max_length=200)),
                ('duration_days', models.IntegerField(default=5)),
                ('videos_per_day', models.IntegerField(default=1)),
                ('time_per_video', models.TimeField()),
                ('upload_youtube_perm', models.BooleanField(default=False)),
                ('download_youtube_perm', models.BooleanField(default=False)),
                ('file_size', models.FloatField(default=1)),
                ('parts_limits', models.FloatField(default=1)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('valid_extentions', models.ManyToManyField(to='subscriptions.extention')),
            ],
        ),
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('start_time', models.DateTimeField(auto_now_add=True)),
                ('ends_time', models.DateField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=False)),
                ('paid_status', models.BooleanField(default=False)),
                ('plan', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='subscriptions.plan')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PendingSubs',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plan_id', models.CharField(blank=True, max_length=255, null=True)),
                ('revise_failed_reason', models.CharField(max_length=255)),
                ('payment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscriptions.payment')),
            ],
        ),
        migrations.AddField(
            model_name='payment',
            name='subscription',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscriptions.subscription'),
        ),
    ]
