/// 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?,
      );
}
