# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-17 16:41
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='MyUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('username', models.CharField(max_length=20, unique=True)),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
                ('full_name', models.CharField(blank=True, max_length=30)),
                ('mobile', models.CharField(blank=True, max_length=20)),
                ('short_bio', models.CharField(blank=True, max_length=50)),
                ('profile_description', models.CharField(blank=True, max_length=1000)),
                ('featured_image', models.ImageField(default='featured_images/default_cover.jpg', upload_to='featured_images')),
                ('picture', models.ImageField(default='profile_images/profile_b.jpg', upload_to='profile_images')),
                ('thumbnail', models.ImageField(default='profile_images/profile_b.jpg', upload_to='profile_images')),
                ('category', models.CharField(choices=[('OTHERS', 'Others'), ('VIDEOS AND FILMS', 'Videos and Films'), ('MUSIC', 'Music'), ('WRITING', 'Writing'), ('ARTS AND CRAFTS', 'Arts and Crafts'), ('GAMES', 'Games'), ('MEDIA', 'Media'), ('PHOTOGRAPHY', 'Photography'), ('SCIENCE AND TECHNOLOGY', 'Science and Technology'), ('EDUCATION', 'Education'), ('DANCE AND THEATER', 'Dance and Theater'), ('CODING', 'Coding')], default='Coding', max_length=30)),
                ('card_ids', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), blank=True, default=list, size=None)),
                ('customer_id', models.CharField(blank=True, max_length=20)),
                ('featured_video', models.URLField(default='https://www.youtube.com/embed/oc_vB5Xcx1o')),
                ('featured_text', models.CharField(blank=True, max_length=1000)),
                ('social_links', models.TextField(blank=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_verified', models.BooleanField(default=False)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_creator', models.BooleanField(default=False)),
                ('last_login', models.DateTimeField(default=django.utils.timezone.now)),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DataDumpModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('event_type', models.CharField(max_length=100)),
                ('data', django.contrib.postgres.fields.jsonb.JSONField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='SubscriptionModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subscription_id', models.CharField(max_length=20)),
                ('status', models.CharField(choices=[('unknown', 'unknown'), ('created', 'created'), ('authenticated', 'authenticated'), ('active', 'active'), ('pending', 'pending'), ('halted', 'halted'), ('cancelled', 'cancelled'), ('completed', 'completed'), ('expired', 'expired')], default='unknown', max_length=30)),
                ('subs_channel', models.CharField(choices=[('NA', 'na'), ('ZOHO', 'zoho'), ('PAYTM', 'paytm'), ('RAZORPAY', 'razorpay')], default='NA', max_length=10)),
                ('amount', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(10), django.core.validators.MaxValueValidator(9999)])),
                ('notes', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('ended_at', models.DateTimeField(blank=True, null=True)),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='creator', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SubsPlanModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plan_id', models.CharField(max_length=255)),
                ('name', models.CharField(blank=True, max_length=255, null=True)),
                ('description', models.CharField(blank=True, max_length=1000, null=True)),
                ('amount', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(10), django.core.validators.MaxValueValidator(9999)])),
                ('interval', models.PositiveSmallIntegerField(default=1)),
                ('period', models.CharField(default='monthly', max_length=10)),
                ('currency', models.CharField(blank=True, max_length=10)),
                ('notes', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='plan_creator', to=settings.AUTH_USER_MODEL)),
                ('subscriber', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='plan_subscriber', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TransactionModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('invoice_id', models.CharField(max_length=255)),
                ('subscription_id', models.CharField(max_length=255)),
                ('transaction_id', models.CharField(max_length=255)),
                ('transaction_type', models.CharField(max_length=255)),
                ('transaction_status', models.CharField(choices=[('paid', 'Amount paid'), ('waiting', 'Waiting for confirmation'), ('preauth', 'Pre-authorized'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected'), ('refunded', 'Refunded'), ('error', 'Error'), ('input', 'Input')], default='waiting', max_length=20)),
                ('tax', models.DecimalField(decimal_places=2, default='0.0', max_digits=9)),
                ('captured_amount', models.DecimalField(decimal_places=2, default='0.0', max_digits=9)),
                ('total_amount', models.DecimalField(decimal_places=2, default='0.0', max_digits=9)),
                ('currency', models.CharField(max_length=10)),
                ('message', models.TextField(blank=True, default='')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('creator', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, related_name='creator_transaction', to=settings.AUTH_USER_MODEL)),
                ('subscriber', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, related_name='subscriber_transaction', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='subscriptionmodel',
            name='plan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='plan', to='regapp.SubsPlanModel'),
        ),
        migrations.AddField(
            model_name='subscriptionmodel',
            name='subscriber',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='subscriber', to=settings.AUTH_USER_MODEL),
        ),
    ]
