feat: 添加数据库迁移脚本并更新Dockerfile配置 - 在Dockerfile中添加alembic配置文件和目录的复制指令 - 更新alembic/env.py注册新的模块模型:events、workflows、writebacks - 生成完整的初始数据库schema迁移脚本,包含以下表: - approval_requests, attendance_records, audit_logs, domain_events - expenses, feishu_event_receipts, fund_accounts, legacy_sync_runs - official_writeback_runs, performance_metrics, policies, procurements - projects, report_push_runs, risk_event_actions, risk_events - standards, suppliers, work_reports, work_tasks, workflow_actions - workflow_instances等21个数据表结构定义 - 在API路由器中添加新模块的路由:events、workflows、writebacks、observability ```
35 lines
865 B
Python
35 lines
865 B
Python
from typing import Any
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from app.core.constants import ActorValue
|
|
|
|
|
|
class DomainRecordCreate(BaseModel):
|
|
data: dict[str, Any] = Field(..., description="Domain fields to create.")
|
|
actor: str = ActorValue.API
|
|
approval_ticket_id: str | None = Field(
|
|
default=None,
|
|
description="Required by policy for business record creates.",
|
|
)
|
|
|
|
|
|
class DomainRecordUpdate(BaseModel):
|
|
data: dict[str, Any] = Field(..., description="Domain fields to update.")
|
|
actor: str = ActorValue.API
|
|
approval_ticket_id: str | None = Field(
|
|
default=None,
|
|
description="Required by policy for business record updates.",
|
|
)
|
|
|
|
|
|
class DomainRecordRead(BaseModel):
|
|
domain: str
|
|
data: dict[str, Any]
|
|
|
|
|
|
class DomainListRead(BaseModel):
|
|
domain: str
|
|
total: int
|
|
items: list[dict[str, Any]]
|