# Generated by Django 3.2.7 on 2021-11-23 22:35

from django.db import migrations, models
import django.db.models.deletion
import uuid
import vpos.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='id')),
                ('key', models.CharField(default=None, editable=False, max_length=100, null=True, verbose_name='location id')),
                ('amount', models.DecimalField(decimal_places=2, editable=False, max_digits=12, verbose_name='amount')),
                ('mobile', models.CharField(editable=False, max_length=15, validators=[vpos.validators.PhoneAOValidator()], verbose_name='mobile number')),
                ('type', models.CharField(choices=[('payment', 'Payment'), ('refund', 'Refund')], editable=False, max_length=7, verbose_name='type')),
                ('requested', models.BooleanField(default=False, editable=False, verbose_name='was requested')),
                ('data', models.JSONField(default=dict, editable=False, verbose_name='vpos transaction data')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated at')),
                ('parent', models.OneToOneField(blank=True, default=None, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='refund', to='vpos.transaction', verbose_name='parent transaction')),
            ],
            options={
                'verbose_name': 'Transaction',
                'verbose_name_plural': 'Transactions',
            },
        ),
    ]
