feat(receipt-import): enhance bread category detection and improve session management
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user