# Generated by Django 3.1.4 on 2021-11-28 19:47

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('product', '0029_auto_20211104_1105'),
        ('company', '0260_auto_20211126_1954'),
        ('sales', '0265_channelpromotions_is_delete'),
    ]

    operations = [
        migrations.CreateModel(
            name='Apply',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.CharField(max_length=500, verbose_name='宴会地址')),
                ('table_num', models.SmallIntegerField(verbose_name='宴席桌数')),
                ('user_name', models.CharField(max_length=20, verbose_name='宴会人名称')),
                ('user_phone', models.CharField(max_length=20, verbose_name='宴会人手机')),
                ('use_tm', models.DateTimeField(verbose_name='宴会时间')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='申请时间')),
                ('permit_tm', models.DateTimeField(blank=True, null=True, verbose_name='审核时间')),
                ('finish_tm', models.DateTimeField(blank=True, null=True, verbose_name='完成时间')),
                ('ancestor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='apply_ancestor', to='company.company', verbose_name='体系名称')),
                ('applyer', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='申请人')),
                ('award', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='sales.award', verbose_name='奖品')),
                ('businessman', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='apply_businessman', to=settings.AUTH_USER_MODEL, verbose_name='业务员')),
            ],
            options={
                'verbose_name': '宴会申请',
                'verbose_name_plural': '宴会申请',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='分类名称')),
                ('remark', models.CharField(blank=True, max_length=100, 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='banquet_company', to='company.company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '宴会分类',
                'verbose_name_plural': '宴会分类',
            },
        ),
        migrations.CreateModel(
            name='Apply_Pictures',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', models.CharField(max_length=300, verbose_name='标签序号')),
                ('apply', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='banquet.apply', verbose_name='宴会申请记录')),
            ],
            options={
                'verbose_name': '宴会申请图片',
                'verbose_name_plural': '宴会申请图片',
            },
        ),
        migrations.CreateModel(
            name='Apply_Codes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=20, verbose_name='标签序号')),
                ('package_id', models.SmallIntegerField(default=1, verbose_name='包装单位ID')),
                ('apply', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='banquet.apply', verbose_name='宴会申请记录')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='product.product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '宴会申请标签序号',
                'verbose_name_plural': '宴会申请标签序号',
            },
        ),
        migrations.AddField(
            model_name='apply',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='banquet.category', verbose_name='宴会类别'),
        ),
        migrations.AddField(
            model_name='apply',
            name='company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.company', verbose_name='申请公司'),
        ),
        migrations.AddField(
            model_name='apply',
            name='permiter',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='apply_permiter', to=settings.AUTH_USER_MODEL, verbose_name='审核人'),
        ),
    ]
