# Generated by Django 3.2.4 on 2021-07-02 11:39

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Wallet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('balance', models.IntegerField(default=0)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transaction_id', models.CharField(blank=True, default=uuid.uuid4, max_length=10)),
                ('refference_id', models.CharField(blank=True, default=uuid.uuid4, max_length=10)),
                ('is_success', models.BooleanField(default=False)),
                ('date_time', models.DateTimeField(auto_now_add=True)),
                ('amount', models.IntegerField()),
                ('credited_to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credited_to_wallet', to='wallet_app.wallet')),
                ('debited_wallet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='debited_to_wallet', to='wallet_app.wallet')),
                ('type', models.ManyToManyField(to='wallet_app.Type')),
            ],
        ),
        migrations.CreateModel(
            name='TopUp',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.IntegerField()),
                ('order_id', models.CharField(max_length=1000)),
                ('razorpay_payment_id', models.CharField(blank=True, max_length=1000)),
                ('description', models.CharField(default='None', max_length=50)),
                ('is_success', models.BooleanField(default=False)),
                ('wallet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wallet_app.wallet')),
            ],
        ),
    ]

# Generated by Django 3.2.4 on 2021-07-02 11:39

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Wallet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('balance', models.IntegerField(default=0)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transaction_id', models.CharField(blank=True, default=uuid.uuid4, max_length=10)),
                ('refference_id', models.CharField(blank=True, default=uuid.uuid4, max_length=10)),
                ('is_success', models.BooleanField(default=False)),
                ('date_time', models.DateTimeField(auto_now_add=True)),
                ('amount', models.IntegerField()),
                ('credited_to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credited_to_wallet', to='wallet_app.wallet')),
                ('debited_wallet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='debited_to_wallet', to='wallet_app.wallet')),
                ('type', models.ManyToManyField(to='wallet_app.Type')),
            ],
        ),
        migrations.CreateModel(
            name='TopUp',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.IntegerField()),
                ('order_id', models.CharField(max_length=1000)),
                ('razorpay_payment_id', models.CharField(blank=True, max_length=1000)),
                ('description', models.CharField(default='None', max_length=50)),
                ('is_success', models.BooleanField(default=False)),
                ('wallet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wallet_app.wallet')),
            ],
        ),
    ]

# Generated by Django 3.2.4 on 2021-07-02 11:39