# Generated by Django 4.0.5 on 2022-06-23 13:42

import accounts_shared.enums
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('team_common', '0001_initial'),
        ('team', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('profilePicture', models.ImageField(blank=True, default='defaultImage.jpg', null=True, upload_to='accounts-profile-pictures')),
                ('createdOn', models.DateTimeField(auto_now_add=True)),
                ('isActive', models.BooleanField(default=False)),
                ('balance', models.DecimalField(decimal_places=2, default=0, max_digits=10, null=True)),
                ('notes', models.TextField(blank=True, default='', max_length=1000)),
                ('accountType', models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Consumerclient'), (1, 'Businessclient'), (2, 'Supplier'), (3, 'Company'), (4, 'Certificationenttiy')], null=True)),
                ('name', models.CharField(max_length=60, null=True)),
                ('customerId', models.CharField(blank=True, max_length=200, null=True)),
                ('createdBy', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='accountsCreatedByMe', to='team_common.user')),
            ],
            options={
                'verbose_name': 'Account',
                'verbose_name_plural': 'Accounts',
            },
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60, null=True)),
                ('addressLine1', models.CharField(max_length=60)),
                ('addressLine2', models.CharField(blank=True, max_length=60)),
                ('region', models.CharField(max_length=60, verbose_name='State / Province / Region')),
                ('postalCode', models.CharField(max_length=12, verbose_name='ZIP / Postal code')),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='addresses', to='accounts_shared.account')),
            ],
            options={
                'verbose_name': 'Address',
                'verbose_name_plural': 'Addresses',
            },
        ),
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('code', models.CharField(blank=True, max_length=3, null=True)),
            ],
            options={
                'verbose_name': 'City',
                'verbose_name_plural': 'Cities',
            },
        ),
        migrations.CreateModel(
            name='ClientCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60)),
            ],
            options={
                'verbose_name': 'Client Category',
                'verbose_name_plural': 'Client Categories',
            },
        ),
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('firstName', models.CharField(max_length=50)),
                ('lastName', models.CharField(max_length=50)),
                ('email', models.EmailField(max_length=254)),
                ('phoneNumber', models.CharField(max_length=20)),
                ('description', models.TextField(blank=True, null=True)),
                ('createdOn', models.DateTimeField(auto_now_add=True)),
                ('isActive', models.BooleanField(default=False)),
                ('profilePicture', models.ImageField(blank=True, default='../media/defaultImage.jpg', null=True, upload_to='contact-profile-pictures')),
                ('title', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='team_common.title')),
            ],
            options={
                'verbose_name': 'Contact',
                'verbose_name_plural': 'Contacts',
            },
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=60, null=True)),
                ('code', models.CharField(blank=True, max_length=3, null=True)),
            ],
            options={
                'verbose_name': 'Country',
                'verbose_name_plural': 'Countries',
            },
        ),
        migrations.CreateModel(
            name='Store',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(max_length=254)),
                ('phoneNumber', models.CharField(max_length=20)),
                ('title', models.CharField(max_length=200)),
                ('image', models.ImageField(blank=True, default='../media/defaultImage.jpg', null=True, upload_to='store-pictures')),
            ],
            options={
                'verbose_name': 'Store',
                'verbose_name_plural': 'Stores',
            },
        ),
        migrations.CreateModel(
            name='SupplierCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60)),
            ],
            options={
                'verbose_name': 'Supplier Category',
                'verbose_name_plural': 'Supplier Categories',
            },
        ),
        migrations.CreateModel(
            name='TestAccount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createdOn', models.DateTimeField(auto_now_add=True)),
                ('isActive', models.BooleanField(default=False)),
                ('balance', models.DecimalField(decimal_places=2, default=0, max_digits=10, null=True)),
                ('notes', models.TextField(blank=True, default='', max_length=1000)),
                ('name', models.CharField(max_length=60, null=True)),
            ],
            options={
                'verbose_name': 'Test Account',
                'verbose_name_plural': 'Test Accounts',
            },
        ),
        migrations.CreateModel(
            name='BillingAddress',
            fields=[
                ('address_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.address')),
                ('addressType', models.CharField(choices=[('BILLING', 'Billing'), ('SHIPPING', 'Shipping')], default=accounts_shared.enums.AddressTypeChoices['BILLING'], max_length=10)),
            ],
            options={
                'verbose_name': 'Billing Address',
                'verbose_name_plural': 'Billing Addresses',
            },
            bases=('accounts_shared.address',),
        ),
        migrations.CreateModel(
            name='BusinessAccount',
            fields=[
                ('account_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.account')),
                ('email', models.EmailField(max_length=254)),
                ('phoneNumber', models.CharField(max_length=20)),
                ('website', models.URLField(blank=True, max_length=500, null=True)),
            ],
            options={
                'verbose_name': 'Business Account',
                'verbose_name_plural': 'Business Accounts',
            },
            bases=('accounts_shared.account',),
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('account_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.account')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, unique=True)),
                ('phoneNumber', models.CharField(blank=True, max_length=20, null=True)),
                ('website', models.URLField(blank=True, max_length=500, null=True)),
            ],
            options={
                'verbose_name': 'Company',
                'verbose_name_plural': 'Companies',
            },
            bases=('accounts_shared.account',),
        ),
        migrations.CreateModel(
            name='ShippingAddress',
            fields=[
                ('address_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.address')),
                ('addressType', models.CharField(choices=[('BILLING', 'Billing'), ('SHIPPING', 'Shipping')], default=accounts_shared.enums.AddressTypeChoices['SHIPPING'], max_length=10)),
            ],
            options={
                'verbose_name': 'Shipping Address',
                'verbose_name_plural': 'Shipping Addresses',
            },
            bases=('accounts_shared.address',),
        ),
        migrations.CreateModel(
            name='Lead',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('firstName', models.CharField(max_length=50)),
                ('lastName', models.CharField(max_length=50)),
                ('email', models.EmailField(max_length=254)),
                ('phoneNumber', models.CharField(blank=True, max_length=50, null=True)),
                ('status', models.CharField(blank=True, choices=[('assigned', 'Assigned'), ('in process', 'In Process'), ('converted', 'Converted'), ('recycled', 'Recycled'), ('closed', 'Closed')], max_length=255, null=True)),
                ('source', models.CharField(blank=True, choices=[('call', 'Call'), ('email', 'Email'), ('existing customer', 'Existing Customer'), ('partner', 'Partner'), ('public relations', 'Public Relations'), ('compaign', 'Campaign'), ('other', 'Other')], max_length=255, null=True)),
                ('website', models.CharField(blank=True, max_length=255, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('opportunityAmount', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
                ('createdOn', models.DateTimeField(auto_now_add=True)),
                ('isActive', models.BooleanField(default=False)),
                ('addresses', models.ManyToManyField(related_name='leads', to='accounts_shared.address')),
                ('assignedTo', models.ManyToManyField(related_name='myLeads', to='team.employee')),
                ('createdBy', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='team.employee')),
            ],
            options={
                'verbose_name': 'Lead',
                'verbose_name_plural': 'Leads',
                'ordering': ['-createdOn'],
            },
        ),
        migrations.CreateModel(
            name='CompanyLocation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(max_length=254)),
                ('phoneNumber', models.CharField(max_length=20)),
                ('title', models.CharField(max_length=200)),
                ('image', models.ImageField(blank=True, default='../media/defaultImage.jpg', null=True, upload_to='company-location-pictures')),
                ('address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts_shared.address')),
            ],
            options={
                'verbose_name': 'Company Location',
                'verbose_name_plural': 'Company Locations',
            },
        ),
        migrations.AddField(
            model_name='address',
            name='city',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts_shared.city'),
        ),
        migrations.AddField(
            model_name='address',
            name='country',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts_shared.country'),
        ),
        migrations.CreateModel(
            name='BusinessClient',
            fields=[
                ('businessaccount_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.businessaccount')),
                ('bio', models.TextField(blank=True, default='', max_length=1000)),
                ('isReseller', models.BooleanField(default=False)),
                ('clientCategories', models.ManyToManyField(blank=True, related_name='businessClients', to='accounts_shared.clientcategory')),
            ],
            options={
                'verbose_name': 'Business Client',
                'verbose_name_plural': 'Business Clients',
            },
            bases=('accounts_shared.businessaccount',),
        ),
        migrations.CreateModel(
            name='CertificationEntity',
            fields=[
                ('businessaccount_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.businessaccount')),
                ('code', models.CharField(max_length=30)),
                ('description', models.TextField(blank=True, default='', max_length=1000)),
            ],
            options={
                'verbose_name': 'CertificationEntity',
                'verbose_name_plural': 'CertificationEntities',
            },
            bases=('accounts_shared.businessaccount',),
        ),
        migrations.CreateModel(
            name='Supplier',
            fields=[
                ('businessaccount_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.businessaccount')),
                ('description', models.TextField(blank=True, default='', max_length=1000)),
                ('supplierCategories', models.ManyToManyField(blank=True, related_name='suppliers', to='accounts_shared.suppliercategory')),
            ],
            options={
                'verbose_name': 'Supplier',
                'verbose_name_plural': 'Suppliers',
            },
            bases=('accounts_shared.businessaccount',),
        ),
        migrations.AddField(
            model_name='businessaccount',
            name='belongsTo',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='businessAccounts', to='accounts_shared.company'),
        ),
        migrations.CreateModel(
            name='SupplierContact',
            fields=[
                ('contact_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.contact')),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contacts', to='accounts_shared.supplier')),
            ],
            options={
                'verbose_name': 'Supplier Contact',
                'verbose_name_plural': 'Supplier Contacts',
            },
            bases=('accounts_shared.contact',),
        ),
        migrations.CreateModel(
            name='ConsumerClient',
            fields=[
                ('account_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.account')),
                ('email', models.EmailField(max_length=254)),
                ('phoneNumber', models.CharField(max_length=20)),
                ('age', models.PositiveIntegerField(default=0)),
                ('dateOfBirth', models.DateField(blank=True, null=True)),
                ('sex', models.CharField(choices=[('MALE', 'Male'), ('FEMALE', 'Female')], max_length=10)),
                ('belongsTo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='consumerClients', to='accounts_shared.company')),
                ('clientCategories', models.ManyToManyField(blank=True, related_name='consumerClients', to='accounts_shared.clientcategory')),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='account', to='team_common.user')),
            ],
            options={
                'verbose_name': 'Consumer Client',
                'verbose_name_plural': 'Consumer Clients',
                'unique_together': {('belongsTo', 'email')},
            },
            bases=('accounts_shared.account',),
        ),
        migrations.AddField(
            model_name='company',
            name='businessClient',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='company', to='accounts_shared.businessclient'),
        ),
        migrations.CreateModel(
            name='BusinessClientContact',
            fields=[
                ('contact_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='accounts_shared.contact')),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contact', to='team_common.user')),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contacts', to='accounts_shared.businessclient')),
            ],
            options={
                'verbose_name': 'Business Client Contact',
                'verbose_name_plural': 'Business Client Contacts',
            },
            bases=('accounts_shared.contact',),
        ),
    ]
