# Generated by Django 5.2.7 on 2025-11-06 05:33

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Merchant',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='商户名称')),
                ('type', models.IntegerField(choices=[(1, '布行'), (2, '印花厂')], verbose_name='商户类型')),
                ('area', models.CharField(blank=True, max_length=100, null=True, verbose_name='地区')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='电子邮箱')),
                ('mobile', models.CharField(blank=True, max_length=20, null=True, verbose_name='手机')),
                ('contact', models.TextField(blank=True, null=True, verbose_name='联系人')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
            ],
            options={
                'verbose_name': '商户资料',
                'verbose_name_plural': '商户资料',
            },
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='员工姓名')),
                ('job_type', models.CharField(choices=[('打纸', '打纸'), ('滚筒', '滚筒'), ('仓库', '仓库'), ('送货', '送货')], default='打纸', max_length=20, verbose_name='职位')),
                ('mobile', models.CharField(blank=True, max_length=20, null=True, verbose_name='手机')),
                ('area', models.CharField(blank=True, max_length=100, null=True, verbose_name='地区')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('status', models.CharField(choices=[('在职', '在职'), ('离职', '离职')], default='在职', max_length=20, verbose_name='员工状态')),
                ('sys_user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='employee', to=settings.AUTH_USER_MODEL, verbose_name='系统用户')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='employees', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '员工资料',
                'verbose_name_plural': '员工资料',
            },
        ),
        migrations.CreateModel(
            name='DeviceInfo',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='设备名称')),
                ('type', models.CharField(choices=[('滚筒', '滚筒'), ('打印', '打印')], default='滚筒', max_length=20, verbose_name='设备类型')),
                ('status', models.CharField(choices=[('使用中', '使用中'), ('停用', '停用'), ('维修中', '维修中')], default='使用中', max_length=20, verbose_name='设备状态')),
                ('start_working_at', models.DateField(blank=True, null=True, verbose_name='开始服役日期')),
                ('stop_working_at', models.DateField(blank=True, null=True, verbose_name='停止服役日期')),
                ('is_occupied', models.BooleanField(default=False, verbose_name='是否被占用')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '设备资料',
                'verbose_name_plural': '设备资料',
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='客户名称')),
                ('mobile', models.CharField(max_length=20, verbose_name='手机')),
                ('area', models.CharField(blank=True, max_length=100, null=True, verbose_name='地区')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='电子邮箱')),
                ('contact', models.CharField(blank=True, null=True, verbose_name='联系人')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='customers', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '客户资料',
                'verbose_name_plural': '客户资料',
            },
        ),
        migrations.CreateModel(
            name='BankAccount',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='名称')),
                ('auto_number', models.CharField(max_length=50, verbose_name='自动编号')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('attachment', models.FileField(blank=True, null=True, upload_to='bank_accounts/', verbose_name='附件')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='bank_accounts', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '银行账户',
                'verbose_name_plural': '银行账户',
            },
        ),
        migrations.CreateModel(
            name='ProductCategory',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='类别名称')),
                ('description', models.TextField(blank=True, null=True, verbose_name='类别描述')),
                ('product_prefix', models.CharField(max_length=5, verbose_name='产品编号前缀')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='product_categories', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '产品类别',
                'verbose_name_plural': '产品类别',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='产品名')),
                ('human_id', models.CharField(blank=True, max_length=100, verbose_name='产品编号')),
                ('color', models.CharField(blank=True, max_length=50, null=True, verbose_name='颜色')),
                ('width_size', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='宽幅')),
                ('single_price_in', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='参考进价')),
                ('single_price_out', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='参考售价')),
                ('unit', models.IntegerField(choices=[(1, '米'), (2, '码'), (3, '公斤')], default=1, verbose_name='单位')),
                ('spec', models.CharField(blank=True, max_length=100, null=True, verbose_name='规格')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('image', models.ImageField(blank=True, null=True, upload_to='product_images/', verbose_name='产品图片')),
                ('transform_rate', models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True, verbose_name='公斤转换率')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='products', to='basic_info.merchant', verbose_name='所属商户')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='products', to='basic_info.productcategory', verbose_name='产品类别')),
            ],
            options={
                'verbose_name': '产品资料',
                'verbose_name_plural': '产品资料',
            },
        ),
        migrations.CreateModel(
            name='Supplier',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='供应商名称')),
                ('area', models.CharField(blank=True, max_length=100, null=True, verbose_name='地区')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='电子邮箱')),
                ('mobile', models.CharField(blank=True, max_length=20, null=True, verbose_name='手机')),
                ('contact', models.TextField(blank=True, null=True, verbose_name='联系人')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='suppliers', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '供应商',
                'verbose_name_plural': '供应商',
            },
        ),
        migrations.CreateModel(
            name='VehicleType',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50, verbose_name='车辆类型名称')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vehicle_types', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '车辆类型',
                'verbose_name_plural': '车辆类型',
            },
        ),
        migrations.CreateModel(
            name='VehicleTransportRecord',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('driver_name', models.CharField(max_length=100, verbose_name='司机姓名')),
                ('contact_number', models.CharField(blank=True, max_length=20, null=True, verbose_name='联系电话')),
                ('license_plate', models.CharField(blank=True, max_length=20, null=True, verbose_name='车牌号码')),
                ('delivery_date', models.DateField(verbose_name='送货日期')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vehicle_transport_records', to='basic_info.merchant', verbose_name='所属商户')),
                ('vehicle_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vehicles', to='basic_info.vehicletype', verbose_name='车次')),
            ],
            options={
                'verbose_name': '司机车次',
                'verbose_name_plural': '司机车次',
            },
        ),
        migrations.CreateModel(
            name='WareHouse',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='仓库名称')),
                ('location', models.CharField(blank=True, max_length=200, null=True, verbose_name='仓库地址')),
                ('contact', models.CharField(blank=True, max_length=100, null=True, verbose_name='联系人')),
                ('mobile', models.CharField(blank=True, max_length=20, null=True, verbose_name='手机')),
                ('area', models.CharField(blank=True, max_length=100, null=True, verbose_name='地区')),
                ('description', models.TextField(blank=True, null=True, verbose_name='备注描述')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='warehouses', to='basic_info.merchant', verbose_name='所属商户')),
            ],
            options={
                'verbose_name': '仓库资料',
                'verbose_name_plural': '仓库资料',
            },
        ),
    ]
