R92 A2 修复发票 OCR provider 与二进制写库
这个提交包含在:
@@ -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,
|
||||
|
||||
在新工单中引用
屏蔽一个用户