feat: 完成错误原因合同与付款就绪提示(09-05-error-explainability-payment-readiness)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-09-05 19:00:35 +08:00
父节点 ab82fe30c0
当前提交 a837912638
共修改 42 个文件,包含 2867 行新增和 876 行删除
+9 -2
查看文件
@@ -1,4 +1,5 @@
import { formatInvoiceOcrFieldLabels } from "../lib/invoiceOcr";
import { resolveErrorReasonMessage, UNKNOWN_VALIDATION_MESSAGE } from "./errorReasons";
function readStringList(value: unknown): string[] {
if (!Array.isArray(value)) {
@@ -71,7 +72,13 @@ export function mapApiErrorMessage(
code: string,
details?: Record<string, unknown>,
fallbackMessage?: string,
) {
): string {
if (code === "VALID_001" && details?.reasonCode === "reimbursement.items_invoice_item_guard_failed") {
return mapApiErrorMessage(code, { ...details, reasonCode: undefined, items: "invoice_item_guard_failed" });
}
if (code === "VALID_001" && details?.reasonCode !== undefined) {
return resolveErrorReasonMessage(details.reasonCode) ?? UNKNOWN_VALIDATION_MESSAGE;
}
if (code === "AUTH_001") {
return "账号或密码错误,请检查后重试。";
}
@@ -512,5 +519,5 @@ export function mapApiErrorMessage(
}
}
return fallbackMessage || "请求失败,请稍后重试。";
return code === "VALID_001" ? UNKNOWN_VALIDATION_MESSAGE : fallbackMessage || "请求失败,请稍后重试。";
}