From f108034742d9d3a291192f7ea46f8e25d742ea80 Mon Sep 17 00:00:00 2001 From: Nils-Johan Gynther Date: Sat, 2 May 2026 23:36:19 +0200 Subject: [PATCH] fix(receipt-import): upgrade confidence level for next suggestion based on rule application --- backend/src/receipt-import/receipt-import.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/receipt-import/receipt-import.service.ts b/backend/src/receipt-import/receipt-import.service.ts index 0836f96e..15a0a910 100644 --- a/backend/src/receipt-import/receipt-import.service.ts +++ b/backend/src/receipt-import/receipt-import.service.ts @@ -349,7 +349,10 @@ export class ReceiptImportService { if (byRule?.confidence === 'high') { const sameAsCurrent = nextSuggestion != null && nextSuggestion.categoryId === byRule.categoryId; - if (!sameAsCurrent && (!isTrustedSuggestion || nextSuggestion == null)) { + if (sameAsCurrent && nextSuggestion && nextSuggestion.confidence !== 'high') { + nextSuggestion = { ...nextSuggestion, confidence: 'high' }; + pushTrace(`rule applied -> "${byRule.path}" (confidence upgraded to high)`); + } else if (!sameAsCurrent && (!isTrustedSuggestion || nextSuggestion == null)) { nextSuggestion = byRule; pushTrace(`rule applied -> "${byRule.path}"`); }