# Generated by Django 3.2.6 on 2021-08-10 13:29

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Tax',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('income', models.FloatField(default=0, verbose_name='Income Amount')),
                ('status', models.CharField(choices=[('NEW', 'NEW'), ('PAID', 'PAID'), ('DELAYED', 'DELAYED')], default='NEW', max_length=7, verbose_name='Status Tax')),
                ('tax_amount', models.FloatField(blank=True, null=True, verbose_name='Tax Amount')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deadline', models.DateTimeField(blank=True, null=True)),
                ('fines', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('total_amount', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('payment_status', models.BooleanField(default=False)),
                ('payment_date', models.DateTimeField(blank=True, null=True)),
                ('tax_accountant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='user_tax_accountant', to=settings.AUTH_USER_MODEL)),
                ('tax_payer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='user_tax_payer', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Tax',
                'verbose_name_plural': 'Taxs',
                'ordering': ['-created_at', '-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='HistoricalTax',
            fields=[
                ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('income', models.FloatField(default=0, verbose_name='Income Amount')),
                ('status', models.CharField(choices=[('NEW', 'NEW'), ('PAID', 'PAID'), ('DELAYED', 'DELAYED')], default='NEW', max_length=7, verbose_name='Status Tax')),
                ('tax_amount', models.FloatField(blank=True, null=True, verbose_name='Tax Amount')),
                ('created_at', models.DateTimeField(blank=True, editable=False)),
                ('updated_at', models.DateTimeField(blank=True, editable=False)),
                ('deadline', models.DateTimeField(blank=True, null=True)),
                ('fines', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('total_amount', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('payment_status', models.BooleanField(default=False)),
                ('payment_date', models.DateTimeField(blank=True, null=True)),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('tax_accountant', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('tax_payer', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical Tax',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
