R92 A2 修复发票 OCR provider 与二进制写库

这个提交包含在:
2026-05-05 22:16:13 +08:00
父节点 fced77a567
当前提交 abba3371dd
共修改 7 个文件,包含 113 行新增和 17 行删除
+4 -1
查看文件
@@ -356,7 +356,8 @@ async function invoicePoolRoutes(fastify) {
contentType: fileMimeType,
});
const status = isOcrEnabledForType(fastify.config, ocrType) ? "pending_ocr" : "available";
const ocrEnabled = isOcrEnabledForType(fastify.config, ocrType);
const status = ocrEnabled ? "pending_ocr" : "available";
const invoice = await fastify.prisma.$transaction(async (tx) => {
const now = new Date();
@@ -369,6 +370,7 @@ async function invoicePoolRoutes(fastify) {
mime_type: fileMimeType,
file_size: fileSize,
file_sha256: fileSha256,
ocr_provider: ocrEnabled ? fastify.config.ocrProvider : undefined,
ocr_type: ocrType,
status,
ocr_last_requested_at: status === "pending_ocr" ? now : null,
@@ -1036,6 +1038,7 @@ async function invoicePoolRoutes(fastify) {
where: { id: invoiceId },
data: {
status: "pending_ocr",
ocr_provider: fastify.config.ocrProvider,
ocr_last_requested_at: now,
ocr_last_error: null,
ocr_completed_at: null,