feat: implement matchedVia tracking for receipt items and enhance user alias management
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-07 13:57:41 +02:00
parent f7446cc2df
commit d92272e554
9 changed files with 287 additions and 8 deletions
@@ -16,6 +16,8 @@ class ParsedReceiptItem {
final String? categorySuggestionName;
final String? categorySuggestionPath;
final int? categorySuggestionId;
// matchkälla för UI-visning: 'alias' | 'wordmatch' | 'ai' | 'none'
final String? matchedVia;
ParsedReceiptItem({
required this.rawName,
@@ -31,6 +33,7 @@ class ParsedReceiptItem {
this.categorySuggestionName,
this.categorySuggestionPath,
this.categorySuggestionId,
this.matchedVia,
});
factory ParsedReceiptItem.fromJson(Map<String, dynamic> json) {
@@ -49,6 +52,7 @@ class ParsedReceiptItem {
categorySuggestionName: cat?['categoryName'] as String?,
categorySuggestionPath: cat?['path'] as String?,
categorySuggestionId: (cat?['categoryId'] as num?)?.toInt(),
matchedVia: json['matchedVia'] as String?,
);
}
@@ -72,6 +76,7 @@ class ParsedReceiptItem {
'categoryName': categorySuggestionName,
'path': categorySuggestionPath,
},
if (matchedVia != null) 'matchedVia': matchedVia,
};
}
}