# Generated by Django 3.2.12 on 2023-01-07 15:42

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


class Migration(migrations.Migration):

    dependencies = [
        ('subscriptions', '0005_alter_plan_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProductFeature',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('description', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='ProductType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(choices=[('tenant', 'Tenant App'), ('domain', 'Domain'), ('third_party', '3rd party App')], default='tenant', max_length=115)),
                ('features', models.ManyToManyField(to='subscriptions.ProductFeature')),
            ],
        ),
        migrations.RemoveField(
            model_name='subscription',
            name='duration',
        ),
        migrations.AddField(
            model_name='subscription',
            name='cycle',
            field=models.CharField(choices=[('weekly', 'Weekly'), ('monthly', 'Monthly'), ('quartely', 'quarterly'), ('annually', 'annually')], default='monthly', max_length=50),
        ),
        migrations.AddField(
            model_name='subscription',
            name='renewal_date',
            field=models.DateField(null=True),
        ),
        migrations.AddField(
            model_name='subscription',
            name='renewal_status',
            field=models.CharField(choices=[('active', 'Active'), ('cancelled', 'Cancelled'), ('expired', 'Expired')], default='active', max_length=10),
        ),
        migrations.AddField(
            model_name='subscription',
            name='subscription_duration',
            field=models.IntegerField(null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='start_date',
            field=models.DateField(auto_now_add=True),
        ),
        migrations.DeleteModel(
            name='UserSubcriptions',
        ),
        migrations.AddField(
            model_name='subscription',
            name='product_type',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to='subscriptions.producttype'),
        ),
    ]
