# Generated by Django 5.2.8 on 2026-01-07 05:20

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


class Migration(migrations.Migration):

    dependencies = [
        ('basic_info', '0023_alter_product_segment_size'),
    ]

    operations = [
        migrations.CreateModel(
            name='FrontendPage',
            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)),
                ('key', models.CharField(db_index=True, help_text='前端路由 key，如 plate-order-kanban', max_length=100, unique=True, verbose_name='页面唯一标识')),
                ('label', models.CharField(max_length=100, verbose_name='页面名称')),
                ('page_type', models.CharField(choices=[('main', '主菜单'), ('sub', '子菜单')], default='sub', max_length=10, verbose_name='页面类型')),
                ('sort_order', models.IntegerField(default=0, verbose_name='排序')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='basic_info.frontendpage', verbose_name='父级菜单')),
            ],
            options={
                'verbose_name': '前端页面',
                'verbose_name_plural': '前端页面',
                'ordering': ['sort_order', 'id'],
            },
        ),
        migrations.AddField(
            model_name='employeetype',
            name='visible_pages',
            field=models.ManyToManyField(blank=True, help_text='授予主菜单将自动包含其所有子菜单', related_name='employee_types', to='basic_info.frontendpage', verbose_name='可见页面'),
        ),
    ]
