{ "openapi": "3.1.0", "info": { "title": "AI-Agent 财务审计系统", "description": "按课程设计:四节点审核、独立反馈、持久事件与人工审批。", "version": "1.0.0" }, "paths": { "/api/v1/auth/login": { "post": { "tags": [ "认证" ], "summary": "Login", "description": "功能:验证密码并创建会话。参数:登录名/密码。返回:双令牌与用户。异常:401凭据错误,422参数错误。", "operationId": "login_api_v1_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/refresh": { "post": { "tags": [ "认证" ], "summary": "Refresh", "description": "功能:刷新并撤销旧凭据。参数:refresh_token。返回:新双令牌。异常:401已撤销/过期/停用。", "operationId": "refresh_api_v1_auth_refresh_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Refresh" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/logout": { "post": { "tags": [ "认证" ], "summary": "Logout", "description": "功能:撤销本人刷新会话。参数:refresh_token。返回:撤销状态。异常:401失效,403非本人。", "operationId": "logout_api_v1_auth_logout_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Refresh" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/auth/me": { "get": { "tags": [ "认证" ], "summary": "Me", "description": "功能:返回当前身份。参数:Bearer令牌。返回:无敏感字段的用户。异常:401失效或未登录。", "operationId": "me_api_v1_auth_me_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/users": { "get": { "tags": [ "用户" ], "summary": "Users", "description": "功能:经理查看用户用于审批配置。参数:分页。返回:无密码用户列表。异常:403权限不足。", "operationId": "users_api_v1_users_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "用户" ], "summary": "Create User", "description": "功能:管理员创建有效用户。参数:用户/部门/角色/密码。返回:用户。异常:403权限,409重名,422弱密码。", "operationId": "create_user_api_v1_users_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserCreate" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/users/{identifier}": { "patch": { "tags": [ "用户" ], "summary": "Patch User", "description": "功能:修改身份/停用。参数:ID和允许字段。返回:更新用户。异常:403权限,404不存在,409停用自己。", "operationId": "patch_user_api_v1_users__identifier__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/departments": { "get": { "tags": [ "部门" ], "summary": "Departments", "description": "功能:提供部门选项。参数:当前身份。返回:部门列表。异常:401未登录。", "operationId": "departments_api_v1_departments_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } }, "security": [ { "HTTPBearer": [] } ] }, "post": { "tags": [ "部门" ], "summary": "Create Department", "description": "功能:创建部门。参数:名称/启用。返回:部门。异常:403权限,409重名。", "operationId": "create_department_api_v1_departments_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DepartmentBody" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/departments/{identifier}": { "patch": { "tags": [ "部门" ], "summary": "Patch Department", "description": "功能:更名或停用。参数:ID/名称/active。返回:部门。异常:403权限,404不存在,409重名。", "operationId": "patch_department_api_v1_departments__identifier__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DepartmentBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/agents": { "get": { "tags": [ "Agent" ], "summary": "Agents", "description": "功能:查看节点配置和实际统计。参数:当前身份。返回:五节点列表。异常:403权限不足。", "operationId": "agents_api_v1_agents_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/agents/{node_name}": { "get": { "tags": [ "Agent" ], "summary": "Agent Detail", "description": "功能:查看节点全部版本。参数:固定节点名。返回:当前配置/历史。异常:403权限,404未知节点。", "operationId": "agent_detail_api_v1_agents__node_name__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "node_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Node Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "Agent" ], "summary": "Patch Agent", "description": "功能:创建不可变配置版本。参数:节点/预期版本/参数。返回:新配置。异常:403权限,409版本冲突,422非法配置。", "operationId": "patch_agent_api_v1_agents__node_name__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "node_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Node Name" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConfigPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/agents/{node_name}/test": { "post": { "tags": [ "Agent" ], "summary": "Test Agent", "description": "功能:真实连接或确定性节点测试。参数:节点名。返回:可用/降级原因。异常:403权限,404未知节点。", "operationId": "test_agent_api_v1_agents__node_name__test_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "node_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Node Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/rules": { "get": { "tags": [ "规则" ], "summary": "Rules", "description": "功能:查看生效规则。参数:分页/code/enabled。返回:最新版本列表。异常:403权限不足。", "operationId": "rules_api_v1_rules_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } }, { "name": "code", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Code" } }, { "name": "enabled", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Enabled" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/rules/{code}": { "get": { "tags": [ "规则" ], "summary": "Rule Detail", "description": "功能:追踪规则历史。参数:规则code。返回:当前及所有版本。异常:403权限,404未知规则。", "operationId": "rule_detail_api_v1_rules__code__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "code", "in": "path", "required": true, "schema": { "type": "string", "title": "Code" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "规则" ], "summary": "Patch Rule", "description": "功能:保存规则新版本。参数:预期版本/参数/范围/开关。返回:新版本。异常:403权限,409并发,422核心检查绕过。", "operationId": "patch_rule_api_v1_rules__code__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "code", "in": "path", "required": true, "schema": { "type": "string", "title": "Code" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RulePatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/rules/{code}/test": { "post": { "tags": [ "规则" ], "summary": "Test Rule", "description": "功能:独立试算不改变正式结果。参数:invoice/context。返回:规则证据。异常:403权限,404规则,422上下文非法。", "operationId": "test_rule_api_v1_rules__code__test_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "code", "in": "path", "required": true, "schema": { "type": "string", "title": "Code" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleTest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/reimbursements": { "get": { "tags": [ "报销" ], "summary": "Reimbursements", "description": "功能:按授权范围列单。参数:分页/状态/类型。返回:报销分页。异常:401未登录,422非法分页。", "operationId": "reimbursements_api_v1_reimbursements_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Type" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "报销" ], "summary": "Create Reimbursement", "description": "功能:创建本人草稿。参数:标题/类型/含税额。返回:草稿。异常:422金额,409序号耗尽。", "operationId": "create_reimbursement_api_v1_reimbursements_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReimbursementCreate" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/reimbursements/{identifier}": { "get": { "tags": [ "报销" ], "summary": "Reimbursement Detail", "description": "功能:查看单据全历史。参数:ID。返回:发票/审核/审批。异常:403无权,404不存在。", "operationId": "reimbursement_detail_api_v1_reimbursements__identifier__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "报销" ], "summary": "Patch Reimbursement", "description": "功能:修改本人可编辑单。参数:revision及业务字段。返回:新版本。异常:403所有权,409状态/版本,422金额。", "operationId": "patch_reimbursement_api_v1_reimbursements__identifier__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReimbursementPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/reimbursements/{identifier}/invoices": { "post": { "tags": [ "发票" ], "summary": "Upload Invoices", "description": "功能:逐文件上传并流式留痕。参数:multipart files/revision/metadata数组。返回:SSE真实进度。异常:前置403/409/422;流内error含部分成功ID。", "operationId": "upload_invoices_api_v1_reimbursements__identifier__invoices_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/invoices/{identifier}": { "patch": { "tags": [ "发票" ], "summary": "Patch Invoice", "description": "功能:用户补录未知字段。参数:ID/单据revision/fields。返回:发票与新revision。异常:403非本人,409状态,422字段。", "operationId": "patch_invoice_api_v1_invoices__identifier__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvoicePatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "发票" ], "summary": "Delete Invoice", "description": "功能:从可编辑单移除发票并保留历史证据。参数:ID/revision。返回:新版本。异常:403/404/409。", "operationId": "delete_invoice_api_v1_invoices__identifier__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } }, { "name": "revision", "in": "query", "required": true, "schema": { "type": "integer", "minimum": 1, "title": "Revision" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/invoices/{identifier}/file": { "get": { "tags": [ "发票" ], "summary": "Download Invoice", "description": "功能:按所有权读取原始文件。参数:ID。返回:文件流。异常:403权限,404文件不存在;不接受磁盘路径。", "operationId": "download_invoice_api_v1_invoices__identifier__file_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/reimbursements/{identifier}/submit": { "post": { "tags": [ "报销" ], "summary": "Submit", "description": "功能:异步提交。参数:revision/Idempotency-Key。返回:202审核ID。异常:403所有权,409版本/活动任务,422无发票。", "operationId": "submit_api_v1_reimbursements__identifier__submit_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } }, { "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "type": "string", "minLength": 8, "maxLength": 80, "title": "Idempotency-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Revision" } } } }, "responses": { "202": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/reimbursements/{identifier}/withdraw": { "post": { "tags": [ "报销" ], "summary": "Withdraw", "description": "功能:撤回待审单使旧任务失效。参数:ID/revision。返回:终态。异常:403非本人,409非待审核/过期版本。", "operationId": "withdraw_api_v1_reimbursements__identifier__withdraw_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Revision" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/audit": { "get": { "tags": [ "审核" ], "summary": "Audits", "description": "功能:列出有权查看的历史审核。参数:状态/风险/决策/单据/分页。返回:审核分页。异常:401身份。", "operationId": "audits_api_v1_audit_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "risk_level", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Risk Level" } }, { "name": "decision", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Decision" } }, { "name": "reimbursement_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Reimbursement Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/audit/{identifier}": { "get": { "tags": [ "审核" ], "summary": "Get Audit", "description": "功能:完整证据与版本详情。参数:审核ID。返回:快照/节点/规则/反馈。异常:403无权,404不存在。", "operationId": "get_audit_api_v1_audit__identifier__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/audit/{identifier}/events": { "get": { "tags": [ "审核" ], "summary": "Audit Events", "description": "功能:实时审核进度。参数:ID/Last-Event-ID。返回:SSE节点/完成/失败/心跳。异常:前置403/404;断线用详情恢复。", "operationId": "audit_events_api_v1_audit__identifier__events_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } }, { "name": "Last-Event-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last-Event-Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/audit/{identifier}/rerun": { "post": { "tags": [ "审核" ], "summary": "Rerun", "description": "功能:授权重跑保留旧结果。参数:审核ID/理由/幂等键。返回:新审核ID。异常:403权限,409终态/在途审批。", "operationId": "rerun_api_v1_audit__identifier__rerun_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } }, { "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "type": "string", "minLength": 8, "maxLength": 80, "title": "Idempotency-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Rerun" } } } }, "responses": { "202": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/audit/{identifier}/feedback": { "post": { "tags": [ "反馈" ], "summary": "Feedback", "description": "功能:人工审批后独立反馈。参数:已处理审批ID/纠正/理由。返回:反馈及迭代建议。异常:403非签署人,409轮次不匹配。", "operationId": "feedback_api_v1_audit__identifier__feedback_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Feedback" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/approvals/chains": { "get": { "tags": [ "审批链" ], "summary": "Chains", "description": "功能:查看链配置。参数:分页。返回:审批链列表。异常:403经理权限不足。", "operationId": "chains_api_v1_approvals_chains_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "审批链" ], "summary": "Create Chain", "description": "功能:创建匹配条件与顺序链。参数:route/范围/nodes。返回:链配置。异常:403权限,422非法人员或金额范围。", "operationId": "create_chain_api_v1_approvals_chains_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChainBody" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/approvals/chains/{identifier}": { "patch": { "tags": [ "审批链" ], "summary": "Patch Chain", "description": "功能:更新下一轮链配置。参数:ID/expected_version/完整链。返回:新版本。异常:403、404、409版本、422非法链。", "operationId": "patch_chain_api_v1_approvals_chains__identifier__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChainBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/approvals": { "get": { "tags": [ "审批" ], "summary": "Approvals", "description": "功能:查看本人待办与授权历史。参数:pending/单据/分页。返回:记录与关联信息。异常:401身份。", "operationId": "approvals_api_v1_approvals_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } }, { "name": "pending", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Pending" } }, { "name": "reimbursement_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Reimbursement Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/approvals/{identifier}/decide": { "post": { "tags": [ "审批" ], "summary": "Approval Decision", "description": "功能:处理指定审批并原子推进下一棒。参数:ID/action/opinion。返回:记录/轮次/单据。异常:403自审/非指定人,409重签。", "operationId": "approval_decision_api_v1_approvals__identifier__decide_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Decide" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/knowledge/documents/import": { "post": { "tags": [ "知识库" ], "summary": "Import Document", "description": "功能:导入真实文本政策。参数:UTF-8 txt/md文件。返回:政策和索引状态。异常:403权限,422文件类型/大小/编码。", "operationId": "import_document_api_v1_knowledge_documents_import_post", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_import_document_api_v1_knowledge_documents_import_post" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/knowledge/documents": { "get": { "tags": [ "知识库" ], "summary": "Documents", "description": "功能:阅读政策与索引状态。参数:分页。返回:含正文政策列表。异常:401未登录。", "operationId": "documents_api_v1_knowledge_documents_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "知识库" ], "summary": "Create Document", "description": "功能:保存用户制度原文并分块。参数:标题/分类/正文。返回:未索引文档。异常:403权限,422正文不合法。", "operationId": "create_document_api_v1_knowledge_documents_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/KnowledgeBody" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/knowledge/documents/{identifier}": { "patch": { "tags": [ "知识库" ], "summary": "Patch Document", "description": "功能:修订正文使旧向量失效。参数:ID/预期版本/正文。返回:新版本。异常:403权限,404不存在,409并发。", "operationId": "patch_document_api_v1_knowledge_documents__identifier__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/KnowledgeBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/knowledge/documents/{identifier}/reindex": { "post": { "tags": [ "知识库" ], "summary": "Reindex Document", "description": "功能:排队真实向量化。参数:文档ID。返回:索引任务ID。异常:403权限,404不存在,409已有任务,503无模型。", "operationId": "reindex_document_api_v1_knowledge_documents__identifier__reindex_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "responses": { "202": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/knowledge/search": { "post": { "tags": [ "知识库" ], "summary": "Search", "description": "功能:显式关键词/语义试验。参数:query/mode/top_k/category。返回:模式及原文出处。异常:503真实向量不可用。", "operationId": "search_api_v1_knowledge_search_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchBody" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/logs/export": { "get": { "tags": [ "日志" ], "summary": "Logs Export", "description": "功能:导出授权日志。参数:与列表相同筛选。返回:UTF-8 BOM CSV。异常:403权限,422时间格式。", "operationId": "logs_export_api_v1_logs_export_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "action", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Action" } }, { "name": "trace", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Trace" } }, { "name": "actor_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Actor Id" } }, { "name": "resource", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Resource" } }, { "name": "since", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Since" } }, { "name": "until", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Until" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/logs": { "get": { "tags": [ "日志" ], "summary": "Logs", "description": "功能:按人/动作/资源/追踪查证。参数:筛选和分页。返回:只读日志。异常:403权限,422时间格式。", "operationId": "logs_api_v1_logs_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } }, { "name": "action", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Action" } }, { "name": "trace", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Trace" } }, { "name": "actor_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Actor Id" } }, { "name": "resource", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Resource" } }, { "name": "since", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Since" } }, { "name": "until", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Until" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/alerts": { "get": { "tags": [ "告警" ], "summary": "Alerts", "description": "功能:查询授权告警。参数:状态/严重度/类型/分页。返回:持久告警。异常:403权限不足。", "operationId": "alerts_api_v1_alerts_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "severity", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Severity" } }, { "name": "type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Type" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/alerts/{identifier}/acknowledge": { "post": { "tags": [ "告警" ], "summary": "Acknowledge", "description": "功能:确认异常负责人。参数:ID/意见。返回:已确认告警。异常:403范围,404不存在,409已处理。", "operationId": "acknowledge_api_v1_alerts__identifier__acknowledge_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Opinion" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/alerts/{identifier}/resolve": { "post": { "tags": [ "告警" ], "summary": "Resolve", "description": "功能:记录告警处理完成。参数:ID/意见。返回:已解决告警,原风险不变。异常:403范围,409未确认。", "operationId": "resolve_api_v1_alerts__identifier__resolve_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "integer", "title": "Identifier" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Opinion" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/stats/overview": { "get": { "tags": [ "统计" ], "summary": "Overview", "description": "功能:实时授权统计。参数:时间/部门。返回:数量、金额、状态、风险、部门。异常:401身份,422时间。", "operationId": "overview_api_v1_stats_overview_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "since", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Since" } }, { "name": "until", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Until" } }, { "name": "department_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Department Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/stats/export": { "get": { "tags": [ "统计" ], "summary": "Stats Export", "description": "功能:导出授权财务明细。参数:format/时间/部门。返回:Excel或中文PDF。异常:403权限,422格式,503字体问题。", "operationId": "stats_export_api_v1_stats_export_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "format", "in": "query", "required": false, "schema": { "type": "string", "pattern": "^(xlsx|pdf)$", "default": "xlsx", "title": "Format" } }, { "name": "since", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Since" } }, { "name": "until", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Until" } }, { "name": "department_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Department Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/health": { "get": { "tags": [ "健康" ], "summary": "Health", "description": "功能:报告实际数据库和消费者状态。参数:无。返回:组件状态,无凭据。异常:503数据库不可用。", "operationId": "health_api_v1_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } } }, "components": { "schemas": { "Body_import_document_api_v1_knowledge_documents_import_post": { "properties": { "file": { "type": "string", "contentMediaType": "application/octet-stream", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_import_document_api_v1_knowledge_documents_import_post" }, "Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post": { "properties": { "revision": { "type": "integer", "title": "Revision" }, "metadata": { "type": "string", "title": "Metadata", "default": "[]" }, "files": { "items": { "type": "string", "contentMediaType": "application/octet-stream" }, "type": "array", "title": "Files" } }, "type": "object", "required": [ "revision", "files" ], "title": "Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post" }, "ChainBody": { "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Name", "description": "审批链显示名" }, "route": { "type": "string", "enum": [ "to_supervisor", "to_finance", "to_manual" ], "title": "Route", "description": "对应确定性审核路由;系统批准不配置人工链" }, "type": { "anyOf": [ { "type": "integer", "enum": [ 1, 2, 3 ] }, { "type": "null" } ], "title": "Type", "description": "适用报销类型,空表示全部" }, "department_id": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Department Id", "description": "匹配历史单据所属有效部门,空表示全部" }, "amount_min": { "anyOf": [ { "type": "number" }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" }, { "type": "null" } ], "title": "Amount Min", "description": "含税金额下限,空不限制" }, "amount_max": { "anyOf": [ { "type": "number" }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" }, { "type": "null" } ], "title": "Amount Max", "description": "含税金额上限,必须大于等于下限" }, "priority": { "type": "integer", "maximum": 100.0, "minimum": 0.0, "title": "Priority", "description": "同具体度链的选择优先级,越大越优先", "default": 0 }, "nodes": { "items": { "$ref": "#/components/schemas/ChainNode" }, "type": "array", "maxItems": 10, "minItems": 1, "title": "Nodes", "description": "有序且非空审批链" }, "active": { "type": "boolean", "title": "Active", "description": "仅影响新轮次,已有冻结链不替换", "default": true }, "expected_version": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Expected Version", "description": "更新时必填" } }, "additionalProperties": false, "type": "object", "required": [ "name", "route", "nodes" ], "title": "ChainBody" }, "ChainNode": { "properties": { "approver_id": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Approver Id", "description": "实际有效用户,而非角色占位符" }, "role": { "type": "string", "enum": [ "supervisor", "auditor", "manager", "admin" ], "title": "Role", "description": "必须与指定人员当前真实身份一致" } }, "additionalProperties": false, "type": "object", "required": [ "approver_id", "role" ], "title": "ChainNode" }, "ConfigPatch": { "properties": { "expected_version": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Expected Version", "description": "乐观并发版本,不覆盖他人的修改" }, "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Enabled", "description": "可选能力开关,核心规则和决策不能停用" }, "config": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Config", "description": "节点白名单参数,禁止密钥或代码" } }, "additionalProperties": false, "type": "object", "required": [ "expected_version" ], "title": "ConfigPatch" }, "Decide": { "properties": { "action": { "type": "string", "enum": [ "approve", "reject", "return" ], "title": "Action", "description": "通过、驳回或退回草稿,不接受任意状态" }, "opinion": { "type": "string", "maxLength": 2000, "minLength": 2, "title": "Opinion", "description": "所有审批动作必须留可读意见" } }, "additionalProperties": false, "type": "object", "required": [ "action", "opinion" ], "title": "Decide" }, "DepartmentBody": { "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Name", "description": "不重复的部门名称" }, "active": { "type": "boolean", "title": "Active", "description": "停用仅影响新业务", "default": true } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "title": "DepartmentBody" }, "Feedback": { "properties": { "approval_record_id": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Approval Record Id", "description": "本人已处理审批记录" }, "corrected_fields": { "additionalProperties": true, "type": "object", "title": "Corrected Fields", "description": "纠正建议,不覆盖原证据" }, "reason": { "type": "string", "maxLength": 2000, "minLength": 2, "title": "Reason", "description": "判断依据" } }, "additionalProperties": false, "type": "object", "required": [ "approval_record_id", "reason" ], "title": "Feedback" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "InvoicePatch": { "properties": { "revision": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Revision", "description": "所属单据当前版本" }, "fields": { "additionalProperties": true, "type": "object", "title": "Fields", "description": "用户填报字段;缺失为未知,不伪造默认金额" } }, "additionalProperties": false, "type": "object", "required": [ "revision", "fields" ], "title": "InvoicePatch" }, "KnowledgeBody": { "properties": { "title": { "type": "string", "maxLength": 200, "minLength": 1, "title": "Title", "description": "政策原文标题,用作引用出处" }, "category": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,40}$", "title": "Category", "description": "policy分类参与正式政策审核", "default": "policy" }, "content": { "type": "string", "maxLength": 200000, "minLength": 1, "title": "Content", "description": "用户提供的政策原文" }, "active": { "type": "boolean", "title": "Active", "description": "停用原文不参与新审核检索", "default": true }, "expected_version": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Expected Version", "description": "修订时必须等于当前正文版本" } }, "additionalProperties": false, "type": "object", "required": [ "title", "content" ], "title": "KnowledgeBody" }, "Login": { "properties": { "username": { "type": "string", "maxLength": 50, "minLength": 1, "title": "Username", "description": "已初始化登录名" }, "password": { "type": "string", "maxLength": 200, "minLength": 1, "title": "Password", "description": "仅传输用于校验,不写入日志" } }, "additionalProperties": false, "type": "object", "required": [ "username", "password" ], "title": "Login" }, "Opinion": { "properties": { "opinion": { "type": "string", "maxLength": 2000, "minLength": 2, "title": "Opinion", "description": "处理意见,不得仅置状态无依据" } }, "additionalProperties": false, "type": "object", "required": [ "opinion" ], "title": "Opinion" }, "Refresh": { "properties": { "refresh_token": { "type": "string", "maxLength": 500, "minLength": 20, "title": "Refresh Token", "description": "轮换或撤销的刷新凭据" } }, "additionalProperties": false, "type": "object", "required": [ "refresh_token" ], "title": "Refresh" }, "ReimbursementCreate": { "properties": { "title": { "type": "string", "maxLength": 200, "minLength": 1, "title": "Title", "description": "报销目的" }, "description": { "type": "string", "maxLength": 5000, "title": "Description", "description": "业务补充说明", "default": "" }, "type": { "type": "integer", "enum": [ 1, 2, 3 ], "title": "Type", "description": "1差旅/2招待/3办公", "default": 1 }, "total_amount": { "anyOf": [ { "type": "number" }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" } ], "title": "Total Amount", "description": "含税总额,以两位小数传输" } }, "additionalProperties": false, "type": "object", "required": [ "title", "total_amount" ], "title": "ReimbursementCreate" }, "ReimbursementPatch": { "properties": { "revision": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Revision", "description": "必须等于当前可编辑版本" }, "title": { "anyOf": [ { "type": "string", "maxLength": 200, "minLength": 1 }, { "type": "null" } ], "title": "Title", "description": "修改业务目的,不能空字符串" }, "description": { "anyOf": [ { "type": "string", "maxLength": 5000 }, { "type": "null" } ], "title": "Description", "description": "修订补充说明" }, "type": { "anyOf": [ { "type": "integer", "enum": [ 1, 2, 3 ] }, { "type": "null" } ], "title": "Type", "description": "修改1差旅/2招待/3办公类型,影响下一轮匹配" }, "total_amount": { "anyOf": [ { "type": "number" }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" }, { "type": "null" } ], "title": "Total Amount", "description": "修订含税额,服务层校验非负及两位精度" } }, "additionalProperties": false, "type": "object", "required": [ "revision" ], "title": "ReimbursementPatch" }, "Rerun": { "properties": { "reason": { "type": "string", "maxLength": 1000, "minLength": 2, "title": "Reason", "description": "重跑理由记录在审计日志" } }, "additionalProperties": false, "type": "object", "required": [ "reason" ], "title": "Rerun" }, "Revision": { "properties": { "revision": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Revision", "description": "预期单据版本,过期返回409" } }, "additionalProperties": false, "type": "object", "required": [ "revision" ], "title": "Revision" }, "RulePatch": { "properties": { "expected_version": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Expected Version", "description": "当前规则版本" }, "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Enabled", "description": "可选规则生效开关,核心检查不允许关闭" }, "severity": { "anyOf": [ { "type": "string", "enum": [ "warning", "error", "critical" ] }, { "type": "null" } ], "title": "Severity", "description": "命中时的处理级别,核心严重程度有下限" }, "params": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Params", "description": "白名单阈值,不接受表达式" }, "scope": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Scope", "description": "可选规则的部门/类型范围" } }, "additionalProperties": false, "type": "object", "required": [ "expected_version" ], "title": "RulePatch" }, "RuleTest": { "properties": { "invoice": { "additionalProperties": true, "type": "object", "title": "Invoice", "description": "待试算字段,不写正式审核" }, "context": { "additionalProperties": true, "type": "object", "title": "Context", "description": "显式试算上下文,不冒充生产历史" } }, "additionalProperties": false, "type": "object", "required": [ "invoice" ], "title": "RuleTest" }, "SearchBody": { "properties": { "query": { "type": "string", "maxLength": 2000, "minLength": 1, "title": "Query", "description": "实际检索问题,不用作系统指令" }, "mode": { "type": "string", "enum": [ "keyword", "semantic" ], "title": "Mode", "description": "显式本地词项或真实向量语义模式", "default": "keyword" }, "top_k": { "type": "integer", "maximum": 20.0, "minimum": 1.0, "title": "Top K", "description": "最多返回的真实片段数量", "default": 5 }, "category": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ], "title": "Category", "description": "可选分类过滤" } }, "additionalProperties": false, "type": "object", "required": [ "query" ], "title": "SearchBody" }, "UserCreate": { "properties": { "username": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_]{2,49}$", "title": "Username", "description": "唯一登录名" }, "real_name": { "type": "string", "maxLength": 80, "minLength": 1, "title": "Real Name", "description": "真实显示名称" }, "password": { "type": "string", "maxLength": 200, "minLength": 10, "title": "Password", "description": "至少大小写、数字和符号" }, "department_id": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Department Id", "description": "有效部门主键" }, "role": { "type": "string", "enum": [ "employee", "supervisor", "auditor", "manager", "admin" ], "title": "Role", "description": "五种固定业务身份,不接受任意角色名" } }, "additionalProperties": false, "type": "object", "required": [ "username", "real_name", "password", "department_id", "role" ], "title": "UserCreate" }, "UserPatch": { "properties": { "real_name": { "anyOf": [ { "type": "string", "maxLength": 80, "minLength": 1 }, { "type": "null" } ], "title": "Real Name", "description": "新显示名称" }, "department_id": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Department Id", "description": "新部门,历史单据部门不变" }, "role": { "anyOf": [ { "type": "string", "enum": [ "employee", "supervisor", "auditor", "manager", "admin" ] }, { "type": "null" } ], "title": "Role", "description": "管理员授权的固定身份;禁止降级自己" }, "active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Active", "description": "停用后立即拒绝现有访问令牌" } }, "additionalProperties": false, "type": "object", "title": "UserPatch" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } }, "securitySchemes": { "HTTPBearer": { "type": "http", "description": "登录返回 access_token,Swagger Authorize 只填令牌值", "scheme": "bearer" } } } }