# Generated by Django 3.1.4 on 2021-12-13 14:26

from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0264_auto_20211208_1424'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sales', '0270_auto_20211213_1120'),
    ]

    operations = [
        migrations.CreateModel(
            name='Action',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.SmallIntegerField(choices=[(0, '未审核'), (1, '通过'), (2, '未通过')], default=0, verbose_name='状态')),
                ('digest', models.CharField(blank=True, max_length=300, null=True, verbose_name='摘要')),
                ('budget', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='费用预算')),
                ('address', models.CharField(blank=True, max_length=300, null=True, verbose_name='地址')),
                ('lng_lat', django.contrib.postgres.fields.ArrayField(base_field=models.DecimalField(decimal_places=8, max_digits=12, verbose_name='经纬度'), blank=True, null=True, size=None)),
                ('product_series', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None, verbose_name='产品系列')),
                ('permit_tm', models.DateTimeField(blank=True, null=True, verbose_name='审核时间')),
                ('reason', models.CharField(blank=True, max_length=500, null=True, verbose_name='原因')),
                ('forms', models.TextField(blank=True, null=True, verbose_name='表单内容')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('agent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='actions_agent', to='company.company', verbose_name='客户')),
                ('applyer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='申请人')),
            ],
            options={
                'verbose_name': '核心动作',
                'verbose_name_plural': '核心动作',
            },
        ),
        migrations.CreateModel(
            name='Action_Picture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', models.CharField(blank=True, max_length=300, null=True, verbose_name='照片')),
                ('remark', models.CharField(blank=True, max_length=200, null=True, verbose_name='备注')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('action', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sales.action', verbose_name='核心动作')),
            ],
            options={
                'verbose_name': '核心动作照片',
                'verbose_name_plural': '核心动作照片',
            },
        ),
        migrations.CreateModel(
            name='Action_Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='名称')),
                ('forms', models.TextField(blank=True, null=True, verbose_name='表单内容')),
                ('remark', models.CharField(blank=True, max_length=200, null=True, verbose_name='备注')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='action_category_company', to='company.company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '核心动作类别',
                'verbose_name_plural': '核心动作类别',
            },
        ),
        migrations.AddField(
            model_name='action',
            name='category',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sales.action_category', verbose_name='类别'),
        ),
        migrations.AddField(
            model_name='action',
            name='company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.company', verbose_name='公司名称'),
        ),
        migrations.AddField(
            model_name='action',
            name='permiter',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='actions_permiter', to=settings.AUTH_USER_MODEL, verbose_name='审核人'),
        ),
    ]
