# Generated by Django 2.2.3 on 2019-07-11 21:15

import core.custom_fields
from decimal import Decimal
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import unixtimestampfield.fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Debtor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', unixtimestampfield.fields.UnixTimeStampField(auto_now_add=True)),
                ('updated_at', unixtimestampfield.fields.UnixTimeStampField(auto_now=True, auto_now_add=True)),
                ('deleted', models.BooleanField(default=False)),
                ('first_name', models.CharField(max_length=20)),
                ('last_name', models.CharField(max_length=20)),
                ('email', core.custom_fields.LowerCaseEmailField(max_length=254, unique=True)),
                ('iban', core.custom_fields.CustomizedIBANField(accept_nordea_extensions=True)),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('id',),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', unixtimestampfield.fields.UnixTimeStampField(auto_now_add=True)),
                ('updated_at', unixtimestampfield.fields.UnixTimeStampField(auto_now=True, auto_now_add=True)),
                ('deleted', models.BooleanField(default=False)),
                ('status', models.IntegerField(choices=[(1, 'Invoice open'), (2, 'Invoice paid'), (3, 'Invoice overdue'), (4, 'Invoice cancelled')], default=1)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])),
                ('due_date', models.DateField()),
                ('debtor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invoices', to='debtors.Debtor')),
            ],
            options={
                'ordering': ('id',),
                'abstract': False,
            },
        ),
    ]

# Generated by Django 2.2.3 on 2019-07-11 21:15

import core.custom_fields
from decimal import Decimal
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import unixtimestampfield.fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Debtor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', unixtimestampfield.fields.UnixTimeStampField(auto_now_add=True)),
                ('updated_at', unixtimestampfield.fields.UnixTimeStampField(auto_now=True, auto_now_add=True)),
                ('deleted', models.BooleanField(default=False)),
                ('first_name', models.CharField(max_length=20)),
                ('last_name', models.CharField(max_length=20)),
                ('email', core.custom_fields.LowerCaseEmailField(max_length=254, unique=True)),
                ('iban', core.custom_fields.CustomizedIBANField(accept_nordea_extensions=True)),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('id',),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', unixtimestampfield.fields.UnixTimeStampField(auto_now_add=True)),
                ('updated_at', unixtimestampfield.fields.UnixTimeStampField(auto_now=True, auto_now_add=True)),
                ('deleted', models.BooleanField(default=False)),
                ('status', models.IntegerField(choices=[(1, 'Invoice open'), (2, 'Invoice paid'), (3, 'Invoice overdue'), (4, 'Invoice cancelled')], default=1)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])),
                ('due_date', models.DateField()),
                ('debtor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invoices', to='debtors.Debtor')),
            ],
            options={
                'ordering': ('id',),
                'abstract': False,
            },
        ),
    ]

# Generated by Django 2.2.3 on 2019-07-11 21:15