33b4c734aa
后端: - 新增认证(auth)、任务(tasks)、映射(mappings)、对账(reconciliation)、异常(exceptions)、导出(exports) API - 新增核心模块: database, security, permissions, tenant, exceptions, error_handlers - 新增数据模型: user, company, reconciliation_task, field_mapping, uploaded_file 等 - 新增服务层: ai_recognizer, file_parser, file_storage, mapping, reconciliation 等 - 添加数据库迁移脚本 前端: - 新增登录页面和仪表盘页面 - 新增任务列表、任务详情、字段映射页面 - 新增异常处理页面和规则设置页面 - 新增 API 代理路由 /api/[...path] - 新增 UI 组件库 (button, card, dialog, input, table 等) - 新增 auth 组件 (ProtectedRoute, PermissionGate) - 新增 layout 组件 (Header, Sidebar) - 新增 mapping 组件 (FieldMappingTable, AISuggestionPanel) - 新增 API 客户端和 hooks (useAsync, useToast, usePermission 等) - 新增状态管理 (auth-store, company-store, ui-store) - 集成 Tailwind CSS 和 shadcn/ui 组件库 其他: - 添加 Alembic 数据库迁移配置 - 添加初始化示例数据脚本 - 更新项目文档
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class CompanyBase(BaseModel):
|
|
"""Company 基础 Schema"""
|
|
name: str = Field(..., min_length=1, max_length=200, description="企业名称")
|
|
plan: str = Field(default="免费版", description="套餐类型")
|
|
data_retention_months: int = Field(default=12, ge=1, le=120, description="数据保留月数")
|
|
max_users: int = Field(default=5, ge=1, description="最大用户数")
|
|
|
|
|
|
class CompanyCreate(CompanyBase):
|
|
"""创建 Company 的 Schema"""
|
|
pass
|
|
|
|
|
|
class CompanyUpdate(BaseModel):
|
|
"""更新 Company 的 Schema"""
|
|
name: Optional[str] = Field(None, min_length=1, max_length=200)
|
|
plan: Optional[str] = None
|
|
data_retention_months: Optional[int] = Field(None, ge=1, le=120)
|
|
status: Optional[str] = None
|
|
max_users: Optional[int] = Field(None, ge=1)
|
|
is_trial: Optional[bool] = None
|
|
|
|
|
|
class CompanyResponse(CompanyBase):
|
|
"""Company 响应 Schema"""
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
status: str
|
|
is_trial: bool
|
|
created_at: datetime
|
|
updated_at: datetime |