feat(server): 完成 P2 后端能力(支付幂等、委派回收、OCR异步、审计)
这个提交包含在:
@@ -0,0 +1,22 @@
|
||||
const { runTencentVatOcr } = require("./tencent");
|
||||
|
||||
function isOcrEnabledForType(config, ocrType) {
|
||||
return config.ocrProvider === "tencent" && ocrType === "vat";
|
||||
}
|
||||
|
||||
async function runOcrForInvoice({ config, ocrType, imageBase64 }) {
|
||||
if (config.ocrProvider !== "tencent") {
|
||||
throw new Error(`Unsupported OCR provider: ${config.ocrProvider}`);
|
||||
}
|
||||
|
||||
if (ocrType !== "vat") {
|
||||
throw new Error(`Unsupported OCR type: ${ocrType}`);
|
||||
}
|
||||
|
||||
return runTencentVatOcr(config, imageBase64);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isOcrEnabledForType,
|
||||
runOcrForInvoice,
|
||||
};
|
||||
在新工单中引用
屏蔽一个用户