# Generated by Django 3.1.2 on 2020-10-19 00:09

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('teams', '0001_initial'),
        ('contacts', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, verbose_name='Name')),
                ('email', models.EmailField(max_length=254)),
                ('phone', phonenumber_field.modelfields.PhoneNumberField(max_length=128, null=True, region=None)),
                ('industry', models.CharField(blank=True, choices=[('AGRO-PROCESSING', 'AGRO-PROCESSING'), ('LEATHER', 'LEATHER'), ('MINING', 'MINING'), ('PROJECTS (INFRASTRUCTURE)', 'PROJECTS (INFRASTRUCTURE)'), ('TEXTILES', 'TEXTILES')], max_length=255, null=True, verbose_name='Industry Type')),
                ('accounttype', models.CharField(blank=True, choices=[('BUYER', 'BUYER'), ('SUPPLIER', 'SUPPLIER')], max_length=255, null=True, verbose_name='Account Type')),
                ('employees', models.IntegerField(verbose_name='Number of Employees')),
                ('billing_address_line', models.CharField(blank=True, max_length=255, null=True, verbose_name='Address')),
                ('billing_street', models.CharField(blank=True, max_length=55, null=True, verbose_name='Street')),
                ('billing_city', models.CharField(blank=True, choices=[('Gaborone', 'Gaborone'), ('Francistown', 'Francistown'), ('Molepolole', 'Molepolole'), ('Serowe', 'Serowe'), ('Selibe Phikwe', 'Selibe Phikwe'), ('Maun', 'Maun')], max_length=255, null=True, verbose_name='City')),
                ('billing_state', models.CharField(blank=True, max_length=255, null=True, verbose_name='State')),
                ('billing_postcode', models.CharField(blank=True, max_length=64, null=True, verbose_name='Post/Zip-code')),
                ('billing_country', models.CharField(blank=True, choices=[('Botswana', 'Botswana')], max_length=20, null=True)),
                ('website', models.URLField(blank=True, null=True, verbose_name='Website')),
                ('description', models.TextField(blank=True, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, verbose_name='Created on')),
                ('is_active', models.BooleanField(default=False)),
                ('status', models.CharField(choices=[('open', 'Open'), ('close', 'Close')], default='open', max_length=64)),
                ('contact_name', models.CharField(max_length=120, verbose_name='Contact Name')),
                ('assigned_to', models.ManyToManyField(related_name='account_assigned_users', to=settings.AUTH_USER_MODEL)),
                ('contacts', models.ManyToManyField(related_name='account_contacts', to='contacts.Contact')),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='account_created_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_on'],
            },
        ),
        migrations.CreateModel(
            name='Email',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message_subject', models.TextField(null=True)),
                ('message_body', models.TextField(null=True)),
                ('timezone', models.CharField(default='UTC', max_length=100)),
                ('scheduled_date_time', models.DateTimeField(null=True)),
                ('scheduled_later', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('from_email', models.EmailField(max_length=254)),
                ('rendered_message_body', models.TextField(null=True)),
                ('from_account', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sent_email', to='dbms.account')),
                ('recipients', models.ManyToManyField(related_name='recieved_email', to='contacts.Contact')),
            ],
        ),
        migrations.CreateModel(
            name='Tags',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('slug', models.CharField(blank=True, max_length=20, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='EmailLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_sent', models.BooleanField(default=False)),
                ('contact', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contact_email_log', to='contacts.contact')),
                ('email', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='email_log', to='dbms.email')),
            ],
        ),
        migrations.AddField(
            model_name='account',
            name='tags',
            field=models.ManyToManyField(blank=True, to='dbms.Tags'),
        ),
        migrations.AddField(
            model_name='account',
            name='teams',
            field=models.ManyToManyField(related_name='account_teams', to='teams.Teams'),
        ),
    ]
