# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-24 19:15
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Debit',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('client', models.CharField(blank=True, help_text='Client identifier (UUID, number, reference, etc.) from your system', max_length=50, null=True, verbose_name='Client')),
                ('downstream_reference', models.CharField(blank=True, help_text='Payment reference (UUID, number, reference, etc.) from your system', max_length=50, null=True, verbose_name='Reference')),
                ('callback_url', models.CharField(blank=True, help_text='URL to callback when debit moves to successful or failed', max_length=500, null=True, verbose_name='Callback URL')),
                ('account_name', models.CharField(help_text="Bank account holder's name, unvalidated", max_length=60, verbose_name='Account Name')),
                ('account_number', models.CharField(help_text='Bank account Number', max_length=15)),
                ('branch_code', models.CharField(max_length=6)),
                ('account_type', models.CharField(blank=True, choices=[('savings', 'Savings'), ('current', 'Current')], max_length=30, null=True)),
                ('status', models.CharField(blank=True, choices=[('pending', 'Pending'), ('processing', 'Processing'), ('loaded', 'Loaded'), ('successful', 'Successful'), ('failed', 'Failed')], max_length=30, null=True)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=7)),
                ('reference', models.CharField(blank=True, help_text='Unique 9 digit validated debit reference, provider agnostic', max_length=9, null=True, verbose_name='Debit Reference')),
                ('provider', models.CharField(blank=True, help_text='Upstream Debit provider, set by provider module', max_length=50, null=True, verbose_name='Provider')),
                ('provider_reference', models.CharField(blank=True, help_text='Upstream Debit provider reference for lookups', max_length=200, null=True, verbose_name='Provider Reference')),
                ('provider_status', models.CharField(blank=True, help_text='Upstream Debit provider status for error/success checks', max_length=200, null=True, verbose_name='Provider Status')),
                ('scheduled_at', models.DateTimeField(blank=True, help_text='Date and time after which pending debits will be loaded', null=True, verbose_name='Scheduled at')),
                ('loaded_at', models.DateTimeField(blank=True, help_text='Date and time that debit was loaded to provider', null=True, verbose_name='Loaded at')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='debits_created', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='debits_updated', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
