feat: implement matchedVia tracking for receipt items and enhance user alias management
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user