refactor(server): 单号规则收紧为 A/R/D+8 位紧凑格式

- DOCUMENT_NUMBER_PREFIXES 改为 A/R/D,新增短格式与旧格式正则并存识别,提取正则加边界锚定避免误匹配
- build_document_number 去掉时间戳段,统一生成 A+token 等紧凑单号,is_application_claim_no 兼容旧 AP-/APP- 前缀
- access_policy/status_registry/reimbursements/expense_claims/budget_support 统一复用 is_application_claim_no 判定申请单
- 同步 document_numbering 单元测试覆盖新旧两种格式
This commit is contained in:
caoxiaozhu
2026-06-20 21:44:06 +08:00
parent 96c2e1099a
commit 47c6a4bb73
6 changed files with 77 additions and 33 deletions

View File

@@ -14,6 +14,7 @@ from app.services.expense_claim_workflow_constants import (
PAYMENT_PAID_STAGE,
PAYMENT_PENDING_STAGE,
)
from app.services.document_numbering import is_application_claim_no
@dataclass(frozen=True, slots=True)
@@ -158,7 +159,7 @@ def is_application_claim_reference(
normalized_no = str(claim_no or "").strip().upper()
normalized_type = str(expense_type or "").strip().lower()
return (
normalized_no.startswith(("AP-", "APP-"))
is_application_claim_no(normalized_no)
or normalized_type == "application"
or normalized_type.endswith("_application")
)