# Generated by Django 3.2.12 on 2022-03-24 17:34

from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
import simpel_utils.models.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('iso_3166_1_a2', models.CharField(max_length=2, primary_key=True, serialize=False, verbose_name='ISO 3166-1 alpha-2')),
                ('iso_3166_1_a3', models.CharField(blank=True, max_length=3, verbose_name='ISO 3166-1 alpha-3')),
                ('iso_3166_1_numeric', models.CharField(blank=True, max_length=3, verbose_name='ISO 3166-1 numeric')),
                ('printable_name', models.CharField(db_index=True, max_length=128, verbose_name='Country name')),
                ('name', models.CharField(max_length=128, verbose_name='Official name')),
                ('display_order', models.PositiveSmallIntegerField(db_index=True, default=0, help_text='Higher the number, higher the country in the list.', verbose_name='Display order')),
                ('is_shipping_country', models.BooleanField(db_index=True, default=False, verbose_name='Is shipping country')),
            ],
            options={
                'verbose_name': 'Country',
                'verbose_name_plural': 'Countries',
                'ordering': ('-display_order', 'printable_name'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LinkedContact',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('contact_type', models.CharField(choices=[('phone', 'Phone'), ('fax', 'Fax'), ('mobile', 'Mobile'), ('whatsapp', 'Whatsapp'), ('telegram', 'Telegram')], default='phone', help_text='E.g. Phone or mobile', max_length=255, verbose_name='type')),
                ('contact', phonenumber_field.modelfields.PhoneNumberField(blank=True, help_text='Contact number', max_length=128, region=None, verbose_name='Phone number')),
                ('is_verified', models.BooleanField(default=False, editable=False)),
                ('linked_object_id', models.IntegerField(blank=True, help_text='Linked instance primary key.', null=True)),
                ('linked_object_type', models.ForeignKey(blank=True, help_text='Linked object type', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='linked_contacts', to='contenttypes.contenttype')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LinkedAddress',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('primary', models.BooleanField(default=False)),
                ('address_type', models.CharField(choices=[('home', 'Home'), ('office', 'Office'), ('branch_office', 'Branch Office'), ('billing', 'Billing'), ('shipping', 'Shipping'), ('drop_shipping', 'Dropshipping'), ('deliverable', 'Deliverable'), ('else', 'Else')], default='billing', help_text='E.g. Shipping or billing', max_length=255, verbose_name='type')),
                ('title', models.CharField(blank=True, choices=[('Mr', 'Mr'), ('Miss', 'Miss'), ('Mrs', 'Mrs'), ('Ms', 'Ms'), ('Dr', 'Dr')], max_length=64, verbose_name='Title')),
                ('name', models.CharField(help_text='If blank, contact name will be used.', max_length=255, verbose_name='name')),
                ('line_1', models.CharField(max_length=255, null=True, verbose_name='line 1')),
                ('line_2', models.CharField(max_length=255, null=True, verbose_name='line 2')),
                ('line_3', models.CharField(max_length=255, null=True, verbose_name='line 3')),
                ('city', models.CharField(max_length=255, null=True, verbose_name='city')),
                ('province', models.CharField(max_length=255, null=True, verbose_name='province')),
                ('postcode', simpel_utils.models.fields.UppercaseCharField(blank=True, max_length=64, verbose_name='Post/Zip-code')),
                ('zipcode', models.CharField(max_length=10, null=True, verbose_name='zip code')),
                ('phone', phonenumber_field.modelfields.PhoneNumberField(blank=True, help_text='In case we need to call you about your transaction.', max_length=128, region=None, verbose_name='Phone number')),
                ('notes', models.TextField(blank=True, help_text='Tell us anything we should know.', verbose_name='Note')),
                ('linked_object_id', models.IntegerField(blank=True, help_text='Linked instance primary key.', null=True)),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='simpel_contacts.country', verbose_name='Country')),
                ('linked_object_type', models.ForeignKey(blank=True, help_text='Linked object type', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='linked_address', to='contenttypes.contenttype')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
