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
```
This commit is contained in:
2026-07-08 14:08:03 +08:00
parent 92f490b97e
commit 19e59e83cc
59 changed files with 3271 additions and 247 deletions

View File

@@ -64,6 +64,8 @@ class FeishuResponseKey(StrEnum):
RESULT = "result"
CHALLENGE = "challenge"
PROVIDER_RESPONSE = "provider_response"
STATUS = "status"
APPROVER = "approver"
class FeishuCommandResultKey(StrEnum):
@@ -96,6 +98,24 @@ class FeishuEventReceiptKey(StrEnum):
MESSAGE_ID = "message_id"
class FeishuApprovalAction(StrEnum):
APPROVE = "approve"
REJECT = "reject"
class FeishuApprovalValueKey(StrEnum):
TICKET_ID = "ticket_id"
DECISION = "decision"
ACTION = "action"
COMMENT = "comment"
class FeishuCardKey(StrEnum):
ACTIONS = "actions"
BUTTON_TYPE = "type"
VALUE = "value"
FEISHU_TENANT_TOKEN_PATH = "/auth/v3/tenant_access_token/internal"
FEISHU_MESSAGE_PATH = "/im/v1/messages"
FEISHU_DEFAULT_OPEN_API_DOMAIN = "https://open.feishu.cn"
@@ -103,6 +123,10 @@ FEISHU_AUTH_MISSING = "Feishu app credentials are not configured"
FEISHU_VERIFICATION_TOKEN_REQUIRED = "FEISHU_VERIFICATION_TOKEN is required"
FEISHU_INVALID_TOKEN = "Invalid Feishu token"
FEISHU_RECEIVE_ID_MISSING = "receive_id or FEISHU_DEFAULT_CHAT_ID is required"
FEISHU_APPROVAL_ACTION_INVALID = "Invalid Feishu approval action payload"
FEISHU_APPROVAL_APPROVER_IDS_REQUIRED = "FEISHU_APPROVAL_APPROVER_IDS is required"
FEISHU_APPROVER_NOT_ALLOWED = "Feishu approver is not allowed"
FEISHU_APPROVAL_CARD_ACTION_TARGET = "approval_card_action"
FEISHU_SUCCESS_CODE = 0
FEISHU_DEFAULT_TOKEN_EXPIRE_SECONDS = 7200
FEISHU_TOKEN_EXPIRE_SAFETY_SECONDS = 300