# Generated by Django 2.2 on 2019-05-05 08:56

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


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')),
                ('name', models.CharField(max_length=64, verbose_name='name')),
                ('slug', models.SlugField(max_length=64, verbose_name='slug')),
                ('merchant_id', models.CharField(max_length=64, verbose_name='merchant identifier')),
                ('shop_id', models.CharField(max_length=64, verbose_name='shop identifier')),
                ('secret_key', django_pays.models.PasswordField(max_length=64, verbose_name='secret key')),
                ('default_currency', models.CharField(choices=[('CZK', 'CZK'), ('EUR', 'EUR'), ('USD', 'USD')], max_length=3, verbose_name='default currency')),
                ('default_lang', models.CharField(choices=[('CS-CZ', 'CS-CZ'), ('SK-SK', 'SK-SK'), ('EN-US', 'EN-US'), ('RU-RU', 'RU-RU'), ('JA-JP', 'JA-JP')], max_length=5, verbose_name='default language')),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
                ('payment_id', models.CharField(max_length=100, verbose_name='payment identifier')),
                ('order_id', models.CharField(db_index=True, max_length=100, verbose_name='order identifier')),
                ('currency', models.CharField(max_length=3, verbose_name='currency')),
                ('amount', models.BigIntegerField(help_text='amount in the smallest (base) currency unit', verbose_name='amount')),
                ('base_units', models.PositiveIntegerField(help_text='number of base units in currency', verbose_name='base units')),
                ('status', models.PositiveSmallIntegerField(choices=[(2, 'not realized'), (3, 'successful')], verbose_name='payment status')),
                ('status_description', models.TextField(verbose_name='payment status description')),
                ('gateway', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='payments', to='django_pays.Gateway', verbose_name='gateway')),
            ],
            options={
                'verbose_name': 'payment',
                'verbose_name_plural': 'payments',
                'ordering': ('created',),
                'unique_together': {('gateway', 'payment_id')},
            },
        ),
    ]
