refactor: 移除审批和回写功能模块

移除了整个审批(approvals)和官方回写(writebacks)功能模块,
包括相关模型、路由、服务和配置项。更新了数据库迁移文件,
删除了相关的审批请求表和官方回写运行表。同时从API路由器中
移除了相应的路由,并调整了安全常量和字段验证器以匹配变更。
```
This commit is contained in:
2026-07-08 17:08:59 +08:00
parent 19e59e83cc
commit 0a153b264a
48 changed files with 135 additions and 2225 deletions

View File

@@ -4,6 +4,7 @@ from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from app.core.database import get_db
from app.core.operation_guard import require_operations_enabled
from app.core.security import ApiPrincipal, require_api_key
from app.core.task_queue import enqueue_daily_brief_push, enqueue_project_weekly_push
from app.modules.reports.schemas import (
@@ -82,6 +83,8 @@ def generate_work_report(
db: Session = Depends(get_db),
principal: ApiPrincipal = Depends(require_api_key),
) -> dict:
if payload.persist:
require_operations_enabled()
return ReportService(db).generate_work_report(
report_type=payload.report_type,
reporter=payload.reporter,

View File

@@ -26,5 +26,5 @@ class WorkReportGenerateRequest(BaseModel):
project_code: str | None = None
period_start: date | None = None
period_end: date | None = None
persist: bool = True
persist: bool = False
actor: str = ActorValue.API