# Generated by Django 3.1.5 on 2021-01-20 21:11

from django.db import migrations, models
import django.db.models.deletion
import donations.validators


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='RecurringDonation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('active', models.BooleanField(default=True, verbose_name='Active')),
                ('donated_value', models.FloatField()),
                ('has_valid_credit_card', models.BooleanField(default=True)),
                ('benefactor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='users.benefactor')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Donation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('active', models.BooleanField(default=True, verbose_name='Active')),
                ('donated_value', models.FloatField()),
                ('method', models.CharField(choices=[('CASH', 'Em dinheiro'), ('PIX', 'Pix'), ('TED', 'Transferência Bancária'), ('CREDIT', 'Cartão de crédito'), ('RCREDIT', 'Cartão de crédito - Recorrente')], max_length=8)),
                ('status', models.CharField(choices=[('approved', 'Aprovado'), ('in_process', 'Em processo'), ('pending', 'Pendente'), ('authorized', 'Autorizado'), ('rejected', 'Rejeitado'), ('charged_back', 'Estornado'), ('approved', 'Aprovado')], max_length=12)),
                ('benefactor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.benefactor')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CreditCard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=20, validators=[donations.validators.FNGCCValidator])),
                ('expiration', models.DateField()),
                ('card_type', models.CharField(blank=True, max_length=32, null=True)),
                ('cardholder_name', models.CharField(max_length=32)),
                ('cvv', models.CharField(max_length=4)),
                ('benefactor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.benefactor')),
            ],
        ),
    ]
