# Generated by Django 3.1.3 on 2020-11-08 11:51

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


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ticket_id', models.CharField(db_index=True, max_length=84, verbose_name='ticket id')),
                ('txn_hash', models.CharField(db_index=True, max_length=84, verbose_name='Transaction hash')),
                ('timestamp', models.DateTimeField(blank=True, null=True, verbose_name='Timestamp')),
                ('destination', models.CharField(max_length=100, verbose_name='Destination')),
                ('source', models.CharField(max_length=100, verbose_name='Source')),
                ('amount', models.CharField(max_length=20, verbose_name='amount')),
            ],
        ),
        migrations.CreateModel(
            name='Wallet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, db_index=True, verbose_name='updated_at')),
                ('claim_from', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='claimants', to='api.wallet')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='wallet', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TicketClaimMapping',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('claimed_status', models.CharField(choices=[('raised', 'Raised'), ('verified', 'Verified'), ('rejected', 'Rejected'), ('success', 'Success'), ('not_eligible', 'Not Eligible'), ('eligible', 'Eligible')], max_length=32, verbose_name='Claimed Status')),
                ('employee_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='employee_claims', to=settings.AUTH_USER_MODEL)),
                ('employer_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='employer_claims', to=settings.AUTH_USER_MODEL)),
                ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='claims', to='api.ticket')),
            ],
        ),
        migrations.AddField(
            model_name='ticket',
            name='from_wallet',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='f_tickets', to='api.wallet'),
        ),
        migrations.AddField(
            model_name='ticket',
            name='to_wallet',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='t_tickets', to='api.wallet'),
        ),
    ]
