"""认证 DTO（仅控制器层使用）。"""

from pydantic import BaseModel, Field


class PasswordLoginDTO(BaseModel):
    """账密登录请求。"""

    sub: str = Field(..., description="账号")
    password: str = Field(..., description="密码")


class OAuthUserInfo(BaseModel):
    """OAuth 用户信息。"""

    sub: str = Field(..., description="IDaaS 用户唯一标识")
    username: str | None = Field(None, description="用户名/工号")
    nickname: str | None = Field(None, description="用户昵称")
    email: str | None = Field(None, description="邮箱")
    phone_number: str | None = Field(None, description="手机号")
    ou_id: str | None = Field(None, description="组织单位ID")
    ou_name: str | None = Field(None, description="组织单位名称")
    is_leader: bool | None = Field(False, description="是否为负责人")


class OAuthLoginDTO(BaseModel):
    """OAuth 登录请求。"""

    userInfo: OAuthUserInfo = Field(..., description="OAuth 用户信息")
    expiresIn: int = Field(..., description="OAuth token 过期时间（秒）")
    area: str | None = Field(None, description="用户所属地区")
