feat(receipt-import): enhance bread category detection and improve session management

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Nils-Johan Gynther
2026-05-03 16:34:15 +02:00
parent a1c4a2f24d
commit fa7f225ee5
7 changed files with 299 additions and 12 deletions
@@ -51,4 +51,27 @@ class ParsedReceiptItem {
categorySuggestionId: (cat?['categoryId'] as num?)?.toInt(),
);
}
Map<String, dynamic> toJson() {
return {
'rawName': rawName,
'quantity': quantity,
'unit': unit,
'price': price,
'brand': brand,
'origin': origin,
'matchedProductId': matchedProductId,
'matchedProductName': matchedProductName,
'suggestedProductId': suggestedProductId,
'suggestedProductName': suggestedProductName,
if (categorySuggestionId != null ||
categorySuggestionName != null ||
categorySuggestionPath != null)
'categorySuggestion': {
'categoryId': categorySuggestionId,
'categoryName': categorySuggestionName,
'path': categorySuggestionPath,
},
};
}
}