# Generated by Django 3.0.2 on 2020-01-17 17:39

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Gateway',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PaymentType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('uuid', models.CharField(default=uuid.uuid4, max_length=50)),
                ('external_id', models.CharField(max_length=50)),
                ('card_token', models.CharField(max_length=50)),
                ('value', models.DecimalField(decimal_places=2, max_digits=9)),
                ('description', models.TextField(blank=True)),
                ('gateway', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='transactions.Gateway')),
                ('payment_type', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='transactions.PaymentType')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='gateway',
            name='accept_payments_types',
            field=models.ManyToManyField(to='transactions.PaymentType'),
        ),
    ]
