# Generated by Django 3.0.6 on 2020-05-20 12:05

from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('se_account_id', models.IntegerField()),
                ('se_account_name', models.CharField(max_length=100)),
                ('se_currency', models.CharField(max_length=10)),
                ('se_balance', models.IntegerField()),
                ('se_account_nature', models.CharField(max_length=100)),
                ('se_account_holder_name', models.CharField(max_length=100)),
                ('se_available_money', models.IntegerField()),
                ('created_at', models.DateTimeField()),
                ('updated_at', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='AppUser',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('se_customer_id', models.IntegerField(blank=True, default=None, null=True)),
                ('se_identifier', models.CharField(blank=True, default=None, max_length=100, null=True)),
                ('se_customer_type', models.CharField(blank=True, default=None, max_length=100, null=True)),
                ('created_at', models.DateTimeField()),
                ('last_updated', models.DateTimeField()),
                ('se_customer_secret', models.CharField(blank=True, default=None, max_length=200, null=True)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='BankCustomerInfo',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('first_name', models.CharField(max_length=20)),
                ('last_name', models.CharField(max_length=20)),
                ('middle_name', models.CharField(max_length=20)),
                ('email', models.CharField(max_length=20)),
                ('phone', models.CharField(max_length=20)),
                ('origin_country', models.CharField(max_length=20)),
                ('account_type', models.CharField(max_length=20)),
                ('residence_country', models.CharField(max_length=20)),
                ('address', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='BankProvider',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('bank_name', models.CharField(max_length=100)),
                ('bank_country', models.CharField(max_length=10)),
                ('provider_name', models.CharField(max_length=150)),
                ('se_provider_code', models.CharField(max_length=150)),
                ('se_country_code', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('currency', models.CharField(max_length=10)),
                ('country_name', models.CharField(max_length=20)),
                ('se_country_id', models.IntegerField()),
                ('se_country_code', models.CharField(max_length=10)),
                ('country_flag_icon_url', models.CharField(max_length=1024)),
            ],
        ),
        migrations.CreateModel(
            name='UserConnection',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('se_customer_id', models.IntegerField()),
                ('se_identifier', models.CharField(max_length=100)),
                ('provider_name', models.CharField(max_length=150)),
                ('se_provider_code', models.CharField(max_length=150)),
                ('created_at', models.DateTimeField()),
                ('updated_at', models.DateTimeField()),
                ('deleted_at', models.DateTimeField()),
                ('se_status', models.CharField(max_length=20)),
                ('se_next_refresh_at', models.DateTimeField()),
                ('se_last_success_at', models.DateTimeField()),
                ('se_provider_id', models.IntegerField()),
                ('se_connection_secret', models.CharField(max_length=200)),
                ('se_categorization', models.CharField(max_length=200)),
                ('country_code', models.CharField(max_length=10)),
                ('app_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_backend.AppUser')),
                ('bank_customer_info', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app_backend.BankCustomerInfo')),
                ('bank_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_backend.BankProvider')),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('se_transaction_id', models.IntegerField()),
                ('se_status', models.CharField(max_length=20)),
                ('se_currency', models.CharField(max_length=10)),
                ('se_transaction_amount', models.IntegerField()),
                ('se_transaction_description', models.CharField(max_length=1000)),
                ('se_transaction_category', models.CharField(max_length=20)),
                ('se_transaction_mode', models.CharField(max_length=20)),
                ('created_at', models.DateTimeField()),
                ('updated_at', models.DateTimeField()),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_backend.Account')),
            ],
        ),
        migrations.AddField(
            model_name='bankprovider',
            name='country',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_backend.Country'),
        ),
        migrations.AddField(
            model_name='bankcustomerinfo',
            name='bank_provider',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_backend.BankProvider'),
        ),
        migrations.AddField(
            model_name='appuser',
            name='country',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='app_backend.Country'),
        ),
        migrations.AddField(
            model_name='account',
            name='bank_customer_info',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_backend.BankCustomerInfo'),
        ),
    ]
