# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2020-06-08 19:46
from __future__ import unicode_literals

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
import utils.file_validator


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('supplier_app', '0024_ebentitycompany'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalTaxPayerUnitedStates',
            fields=[
                ('taxpayer_ptr', models.ForeignKey(auto_created=True, blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, parent_link=True, related_name='+', to='supplier_app.TaxPayer')),
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('workday_id', models.CharField(max_length=50)),
                ('business_name', models.CharField(max_length=200, verbose_name='Business name')),
                ('taxpayer_state', models.CharField(choices=[('APPROVED', 'Approved'), ('CHANGE REQUIRED', 'Change required'), ('PENDING', 'Pending'), ('DENIED', 'Denied'), ('CHANGES PENDING', 'Changes pending'), ('IN PROGRESS', 'In Progress')], default='PENDING', max_length=200)),
                ('country', models.CharField(choices=[('AR', 'Argentina'), ('USA', 'United States')], max_length=50, verbose_name='Country')),
                ('taxpayer_date', models.DateField(blank=True, editable=False, verbose_name='Creation date')),
                ('taxpayer_id_number', models.CharField(db_index=True, max_length=9, validators=[django.core.validators.RegexValidator('^[0-9]+$', code='invalid_id', message='Id number must only have numbers'), django.core.validators.MaxLengthValidator(9), django.core.validators.MinLengthValidator(9)])),
                ('taxpayer_id_number_type', models.IntegerField(choices=[(1, 'EIN'), (2, 'SSN')], verbose_name='Taxpayer id type')),
                ('payment_type', models.CharField(choices=[('BANK', 'Bank')], default='BANK', max_length=20, verbose_name='Payment type')),
                ('payment_term', models.IntegerField(choices=[(15, '15 days'), (30, '30 days')], verbose_name='Payment term')),
                ('w9_file', models.TextField(max_length=100, validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['pdf']), utils.file_validator.FileSizeValidator(code='invalid_file_size', limit_size=26214400)], verbose_name='W9 certificate')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.TextField(null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('company', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='supplier_app.Company')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical tax payer united states',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='TaxPayerUnitedStates',
            fields=[
                ('taxpayer_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='supplier_app.TaxPayer')),
                ('taxpayer_id_number', models.CharField(max_length=9, unique=True, validators=[django.core.validators.RegexValidator('^[0-9]+$', code='invalid_id', message='Id number must only have numbers'), django.core.validators.MaxLengthValidator(9), django.core.validators.MinLengthValidator(9)])),
                ('taxpayer_id_number_type', models.IntegerField(choices=[(1, 'EIN'), (2, 'SSN')], verbose_name='Taxpayer id type')),
                ('payment_type', models.CharField(choices=[('BANK', 'Bank')], default='BANK', max_length=20, verbose_name='Payment type')),
                ('payment_term', models.IntegerField(choices=[(15, '15 days'), (30, '30 days')], verbose_name='Payment term')),
                ('w9_file', models.FileField(upload_to='file', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['pdf']), utils.file_validator.FileSizeValidator(code='invalid_file_size', limit_size=26214400)], verbose_name='W9 certificate')),
            ],
            bases=('supplier_app.taxpayer',),
        ),
        migrations.AlterField(
            model_name='address',
            name='country',
            field=models.CharField(choices=[('AR', 'Argentina'), ('USA', 'United States')], max_length=50, verbose_name='Country'),
        ),
        migrations.AlterField(
            model_name='ebentity',
            name='eb_country',
            field=models.CharField(choices=[('AR', 'Argentina'), ('USA', 'United States')], default=None, max_length=15, verbose_name='Country'),
        ),
        migrations.AlterField(
            model_name='ebentitycompany',
            name='eb_entity',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='supplier_app.EBEntity'),
        ),
        migrations.AlterField(
            model_name='historicaladdress',
            name='country',
            field=models.CharField(choices=[('AR', 'Argentina'), ('USA', 'United States')], max_length=50, verbose_name='Country'),
        ),
        migrations.AlterField(
            model_name='historicaltaxpayer',
            name='country',
            field=models.CharField(choices=[('AR', 'Argentina'), ('USA', 'United States')], max_length=50, verbose_name='Country'),
        ),
        migrations.AlterField(
            model_name='historicaltaxpayerargentina',
            name='country',
            field=models.CharField(choices=[('AR', 'Argentina'), ('USA', 'United States')], max_length=50, verbose_name='Country'),
        ),
        migrations.AlterField(
            model_name='taxpayer',
            name='country',
            field=models.CharField(choices=[('AR', 'Argentina'), ('USA', 'United States')], max_length=50, verbose_name='Country'),
        ),
    ]
