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}"`); }