feat: 完成P6-P8前端能力闭环(V3,D2,D3,B3)

这个提交包含在:
2026-02-10 11:28:51 +08:00
父节点 6bc09f557b
当前提交 4e5a7793fe
共修改 14 个文件,包含 1151 行新增和 62 行删除
+44
查看文件
@@ -2,6 +2,22 @@ import { apiRequestData } from "./http";
export type InvoicePoolStatus = "pending_ocr" | "ocr_failed" | "available" | "bound" | "archived";
export type InvoiceVerificationRecord = {
id: string;
provider: string;
status: string;
resultCode: string | null;
resultMessage: string | null;
errorCode: string | null;
errorMessage: string | null;
durationMs: number | null;
requestedBy: string | null;
requestedAt: string | null;
completedAt: string | null;
retryOfId: string | null;
attempts: number;
};
export type InvoicePoolListItem = {
id: string;
status: InvoicePoolStatus;
@@ -21,6 +37,7 @@ export type InvoicePoolListItem = {
originalName: string;
mimeType: string;
fileSize: number;
verification: InvoiceVerificationRecord | null;
owner: {
id: string;
employeeNo: string;
@@ -75,6 +92,7 @@ export type InvoicePoolDetail = {
overrideRefFormNumber: string | null;
overrideReason: string | null;
overriddenBy: string | null;
verification: InvoiceVerificationRecord | null;
createdAt: string | null;
updatedAt: string | null;
};
@@ -193,3 +211,29 @@ export async function overrideInvoiceDuplicate(invoiceId: string, payload: { ref
body: JSON.stringify(payload),
});
}
export async function triggerInvoiceVerification(invoiceId: string) {
return apiRequestData<{ invoiceId: string; verificationId: string; provider: string; triggerMode: string }>(
`/api/invoice-pool/${invoiceId}/verify`,
{
method: "POST",
body: JSON.stringify({}),
},
);
}
export async function fetchInvoiceVerifications(invoiceId: string, limit = 20) {
return apiRequestData<{ invoiceId: string; items: InvoiceVerificationRecord[] }>(
`/api/invoice-pool/${invoiceId}/verification?limit=${limit}`,
);
}
export async function retryInvoiceVerification(invoiceId: string) {
return apiRequestData<{ invoiceId: string; verificationId: string; status: string }>(
`/api/invoice-pool/${invoiceId}/verification/retry`,
{
method: "POST",
body: JSON.stringify({}),
},
);
}