feat: Add receipt import functionality with file upload and parsing
- Implemented receipt file upload in ImportRepository with multipart request handling. - Created ParsedReceiptItem model for parsed receipt data. - Added ReceiptImportTab for user interface to upload and review receipts. - Updated ImportScreen to include the new ReceiptImportTab alongside RecipeImportTab. - Introduced flutter_bootstrap.js and index.html for web app initialization. - Added wimp.wasm and flutter.js for enhanced web performance and capabilities.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/// Model for a parsed receipt item from the receipt import API.
|
||||
class ParsedReceiptItem {
|
||||
final String rawName;
|
||||
final double? quantity;
|
||||
final String? unit;
|
||||
final String? suggestedProductId;
|
||||
final String? suggestedProductName;
|
||||
final String? categorySuggestion;
|
||||
|
||||
ParsedReceiptItem({
|
||||
required this.rawName,
|
||||
this.quantity,
|
||||
this.unit,
|
||||
this.suggestedProductId,
|
||||
this.suggestedProductName,
|
||||
this.categorySuggestion,
|
||||
});
|
||||
|
||||
factory ParsedReceiptItem.fromJson(Map<String, dynamic> json) => ParsedReceiptItem(
|
||||
rawName: json['rawName'] as String,
|
||||
quantity: (json['quantity'] as num?)?.toDouble(),
|
||||
unit: json['unit'] as String?,
|
||||
suggestedProductId: json['suggestedProductId'] as String?,
|
||||
suggestedProductName: json['suggestedProductName'] as String?,
|
||||
categorySuggestion: json['categorySuggestion'] as String?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user