"""入口模块管理 DTO。"""

from pydantic import BaseModel, Field


class EntryModuleAreaDTO(BaseModel):
    """入口模块地区配置。"""

    area: str = Field(..., description="地区名称")
    enabled: bool = Field(True, description="是否启用")
    sort_order: int = Field(0, description="排序号")


class EntryModuleCreateDTO(BaseModel):
    """创建入口模块请求。"""

    name: str = Field(..., description="模块名称")
    description: str | None = Field(None, description="模块描述")
    path: str | None = Field(None, description="前端路由路径")
    route_path: str | None = Field(None, description="前端跳转路径")
    areas: list[EntryModuleAreaDTO] | None = Field(None, description="地区配置")


class EntryModuleUpdateDTO(BaseModel):
    """更新入口模块请求。"""

    name: str | None = Field(None, description="模块名称")
    description: str | None = Field(None, description="模块描述")
    path: str | None = Field(None, description="前端路由路径")
    route_path: str | None = Field(None, description="前端跳转路径")
    areas: list[EntryModuleAreaDTO] | None = Field(None, description="地区配置")
