refactor(server): split oversized backend services
This commit is contained in:
207
server/src/app/services/agent_foundation_constants.py
Normal file
207
server/src/app/services/agent_foundation_constants.py
Normal file
@@ -0,0 +1,207 @@
|
||||
from __future__ import annotations
|
||||
|
||||
PLATFORM_DESTINATION_LOCATION_RULE_CODE = "risk.travel.destination_receipt_location"
|
||||
|
||||
PLATFORM_DESTINATION_LOCATION_RULE_FILENAME = "risk.travel.destination_receipt_location.json"
|
||||
|
||||
DEMO_EXPENSE_CLAIM_SIGNATURES = {
|
||||
|
||||
(
|
||||
|
||||
"EXP-202605-001",
|
||||
|
||||
"张三",
|
||||
|
||||
"华南客户拜访差旅报销",
|
||||
|
||||
"3280.00",
|
||||
|
||||
"submitted",
|
||||
|
||||
),
|
||||
|
||||
(
|
||||
|
||||
"EXP-202605-002",
|
||||
|
||||
"李四",
|
||||
|
||||
"客户路演餐费",
|
||||
|
||||
"860.00",
|
||||
|
||||
"approved",
|
||||
|
||||
),
|
||||
|
||||
(
|
||||
|
||||
"EXP-202605-003",
|
||||
|
||||
"王五",
|
||||
|
||||
"市场活动会务差旅",
|
||||
|
||||
"3280.00",
|
||||
|
||||
"review",
|
||||
|
||||
),
|
||||
|
||||
}
|
||||
|
||||
DEMO_RECEIVABLE_SIGNATURES = {
|
||||
|
||||
("AR-202605-001", "客户A", "50000.00", "partial"),
|
||||
|
||||
("AR-202605-002", "客户B", "78000.00", "overdue"),
|
||||
|
||||
}
|
||||
|
||||
DEMO_PAYABLE_SIGNATURES = {
|
||||
|
||||
("AP-202605-001", "供应商A", "33000.00", "scheduled"),
|
||||
|
||||
("AP-202605-002", "供应商B", "96000.00", "overdue"),
|
||||
|
||||
}
|
||||
|
||||
LEGACY_RULE_CODES = (
|
||||
|
||||
"rule.expense.duplicate_expense_check",
|
||||
|
||||
"rule.expense.travel_receipt_requirements",
|
||||
|
||||
"rule.ap.payment_dual_review",
|
||||
|
||||
)
|
||||
|
||||
ATTACHMENT_RULE_ASSET_CODE = "rule.expense.attachment_submission_requirements"
|
||||
|
||||
COMPANY_TRAVEL_RULE_VERSION = "v1.0.0"
|
||||
|
||||
COMPANY_COMMUNICATION_RULE_VERSION = "v1.0.0"
|
||||
|
||||
COMPANY_TRAVEL_RULE_SCENARIO_JSON = ("差旅",)
|
||||
|
||||
COMPANY_COMMUNICATION_RULE_SCENARIO_JSON = ("费用科目",)
|
||||
|
||||
ATTACHMENT_RULE_RUNTIME_CONFIG = {
|
||||
|
||||
"kind": "policy_rule_draft",
|
||||
|
||||
"version": 1,
|
||||
|
||||
"template_key": "attachment_requirement_v1",
|
||||
|
||||
"rule_name": "报销附件与单据完整性规则",
|
||||
|
||||
"scenario": "attachment_policy",
|
||||
|
||||
"source_document_name": "报销制度 / 单据与附件要求",
|
||||
|
||||
"review_required": True,
|
||||
|
||||
"target": {
|
||||
|
||||
"expense_types": [
|
||||
|
||||
"travel",
|
||||
|
||||
"hotel",
|
||||
|
||||
"transport",
|
||||
|
||||
"meal",
|
||||
|
||||
"office",
|
||||
|
||||
"meeting",
|
||||
|
||||
"training",
|
||||
|
||||
"communication",
|
||||
|
||||
"welfare",
|
||||
|
||||
"other",
|
||||
|
||||
],
|
||||
|
||||
"scene_codes": ["expense", "attachment_policy", "invoice_anomaly"],
|
||||
|
||||
},
|
||||
|
||||
"attachment_requirements": {
|
||||
|
||||
"min_attachment_count": 1,
|
||||
|
||||
"items": [
|
||||
|
||||
{
|
||||
|
||||
"document_type": "vat_invoice",
|
||||
|
||||
"required": True,
|
||||
|
||||
"min_count": 1,
|
||||
|
||||
"description": "金额类报销原则上必须提供合法票据。",
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"document_type": "receipt",
|
||||
|
||||
"required": False,
|
||||
|
||||
"min_count": 1,
|
||||
|
||||
"description": "特殊场景无发票时需补充收据与情况说明。",
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"document_type": "flight_itinerary",
|
||||
|
||||
"required": False,
|
||||
|
||||
"min_count": 1,
|
||||
|
||||
"description": "差旅交通报销需提供行程单或等效凭证。",
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"document_type": "hotel_invoice",
|
||||
|
||||
"required": False,
|
||||
|
||||
"min_count": 1,
|
||||
|
||||
"description": "住宿报销需提供酒店票据或等效住宿凭证。",
|
||||
|
||||
},
|
||||
|
||||
],
|
||||
|
||||
"manual_fill_required": False,
|
||||
|
||||
},
|
||||
|
||||
"missing_attachment_action": "block",
|
||||
|
||||
"output": {
|
||||
|
||||
"risk_code": "invoice_anomaly",
|
||||
|
||||
"action": "block",
|
||||
|
||||
"message": "附件或单据不完整,需补件后再提交。",
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user