feat: implement AI recipe suggestions; add endpoint and UI for generating suggestions based on inventory
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:
@@ -10,6 +10,7 @@ class IngredientPreview {
|
||||
final double availableQuantity;
|
||||
final IngredientStatus status;
|
||||
final double missingQuantity;
|
||||
final bool fromPantry;
|
||||
|
||||
const IngredientPreview({
|
||||
required this.ingredientId,
|
||||
@@ -21,6 +22,7 @@ class IngredientPreview {
|
||||
required this.availableQuantity,
|
||||
required this.status,
|
||||
required this.missingQuantity,
|
||||
this.fromPantry = false,
|
||||
});
|
||||
|
||||
factory IngredientPreview.fromJson(Map<String, dynamic> json) {
|
||||
@@ -40,6 +42,7 @@ class IngredientPreview {
|
||||
availableQuantity: (json['availableQuantity'] as num? ?? 0).toDouble(),
|
||||
status: status,
|
||||
missingQuantity: (json['missingQuantity'] as num? ?? 0).toDouble(),
|
||||
fromPantry: json['fromPantry'] as bool? ?? false,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -50,6 +53,7 @@ class PreviewSummary {
|
||||
final int missingCount;
|
||||
final int unitMismatchCount;
|
||||
final bool canCookExactly;
|
||||
final int pantryCount;
|
||||
|
||||
const PreviewSummary({
|
||||
required this.totalIngredients,
|
||||
@@ -57,6 +61,7 @@ class PreviewSummary {
|
||||
required this.missingCount,
|
||||
required this.unitMismatchCount,
|
||||
required this.canCookExactly,
|
||||
this.pantryCount = 0,
|
||||
});
|
||||
|
||||
factory PreviewSummary.fromJson(Map<String, dynamic> json) {
|
||||
@@ -66,6 +71,7 @@ class PreviewSummary {
|
||||
missingCount: json['missingCount'] as int,
|
||||
unitMismatchCount: json['unitMismatchCount'] as int,
|
||||
canCookExactly: json['canCookExactly'] as bool? ?? false,
|
||||
pantryCount: json['pantryCount'] as int? ?? 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user