#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2025/04/03 10:25
# @File           : project_info.py
# @IDE            : PyCharm
# @desc           : pydantic 模型，用于数据库序列化操作

from pydantic import BaseModel, Field, ConfigDict
from typing import Optional


class ProjectInfoIn(BaseModel):
    """项目信息输入"""
    project_name: Optional[str] = Field(..., description="项目名称")
    type_code: Optional[str] = Field(..., description="项目类型编码")
    description: Optional[str] = Field(None, description="项目描述")

    model_config = ConfigDict(from_attributes=True)


class ProjectInfoOut(BaseModel):
    """项目信息输出"""
    id: Optional[int] = Field(None, description="项目id")
    project_no: Optional[str] = Field(..., description="项目编号")
    project_name: Optional[str] = Field(..., description="项目名称")
    type_code: Optional[str] = Field(..., description="项目类型编码")
    description: Optional[str] = Field(None, description="项目描述")
    train_version: Optional[int] = Field(None, description="训练版本号")
    project_status: Optional[str] = Field(None, description="项目状态")

    model_config = ConfigDict(from_attributes=True)


class ProjectInfoPagerOut(BaseModel):
    """项目信息输出"""
    id: Optional[int] = Field(None, description="项目id")
    project_no: Optional[str] = Field(None, description="项目编号")
    project_name: Optional[str] = Field(None, description="项目名称")
    type_code: Optional[str] = Field(None, description="项目类型编码")
    description: Optional[str] = Field(None, description="项目描述")
    train_version: Optional[int] = Field(None, description="训练版本号")
    project_status: Optional[str] = Field(None, description="项目状态")
    mark_count: Optional[int] = Field(0, description="已标记数量")
    no_mark_count: Optional[int] = Field(0, description="未标记数量")

    model_config = ConfigDict(from_attributes=True)
