# Generated by Django 3.2.7 on 2021-10-07 15:40

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='Wallet',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('amount', models.PositiveIntegerField(default=0)),
                ('status', models.CharField(choices=[('enabled', 'enabled'), ('disabled', 'disabled')], db_index=True, default='enabled', max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('owned_by', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='customer_wallet', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('amount', models.PositiveIntegerField(default=0)),
                ('is_deposit', models.BooleanField()),
                ('status', models.CharField(choices=[('success', 'success'), ('failed', 'failed')], max_length=30)),
                ('reference_id', models.CharField(db_index=True, max_length=100, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('wallet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wallet_transactions', to='apis.wallet')),
            ],
        ),
    ]
