<gh_stars>0
# Generated by Django 2.2.10 on 2020-04-23 10:19

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


class Migration(migrations.Migration):

    dependencies = [
        ('twofa', '0004_auto_20200418_1009'),
    ]

    operations = [
        migrations.CreateModel(
            name='Bank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('bank_code', models.CharField(max_length=50)),
            ],
        ),
        migrations.AddField(
            model_name='twofauser',
            name='user_type',
            field=models.CharField(choices=[('C', 'Customer'), ('M', 'Merchant'), ('A', 'Admin')], default='C', max_length=1),
        ),
        migrations.CreateModel(
            name='Wallet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('balance', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='wallet_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Topup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('trx_id', models.CharField(max_length=50)),
                ('ref_id', models.IntegerField(default=0)),
                ('amount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('description', fernet_fields.fields.EncryptedTextField()),
                ('trx_date', models.DateTimeField(auto_now_add=True)),
                ('wallet', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='wallet', to='twofa.Wallet')),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('trx_id', models.CharField(max_length=50)),
                ('ref_id', models.IntegerField(default=0)),
                ('description', fernet_fields.fields.EncryptedTextField()),
                ('trx_date', models.DateTimeField(auto_now_add=True)),
                ('amount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('pay_type', models.CharField(choices=[('T', 'Top-up'), ('P', 'Payment')], default='C', max_length=1)),
                ('credit_wallet', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='credit_wallet', to='twofa.Wallet')),
                ('debit_wallet', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='debit_wallet', to='twofa.Wallet')),
            ],
        ),
        migrations.CreateModel(
            name='Contract',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('ref_id', models.IntegerField(default=0)),
                ('description', fernet_fields.fields.EncryptedTextField()),
                ('merchant', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
                ('wallet', models.ManyToManyField(to='twofa.Wallet')),
            ],
        ),
        migrations.CreateModel(
            name='ContactList',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('shared_key', fernet_fields.fields.EncryptedTextField()),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='person', to=settings.AUTH_USER_MODEL)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='contract_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='BankList',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('api_key', fernet_fields.fields.EncryptedTextField()),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('bank', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bank', to='twofa.Bank')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='bank_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
