11D recipe preview

This commit is contained in:
Nils-Johan Gynther
2026-04-09 15:12:54 +02:00
parent 8bb7b66274
commit d1870decac
6 changed files with 354 additions and 11 deletions
+61
View File
@@ -53,4 +53,65 @@ export type InventoryConsumption = {
amountUsed: string;
comment: string | null;
createdAt: string;
};
export type RecipeIngredient = {
id: number;
recipeId: number;
productId: number;
quantity: string;
unit: string;
note: string | null;
createdAt: string;
updatedAt: string;
product: Product;
};
export type Recipe = {
id: number;
name: string;
description: string | null;
instructions: string | null;
createdAt: string;
updatedAt: string;
ingredients: RecipeIngredient[];
};
export type RecipePreviewInventoryItem = {
id: number;
quantity: string;
unit: string;
brand: string | null;
location: string | null;
bestBeforeDate: string | null;
};
export type RecipeInventoryPreviewIngredient = {
ingredientId: number;
productId: number;
productName: string;
requiredQuantity: number;
requiredUnit: string;
note: string | null;
availableQuantity: number;
availableUnit: string | null;
matchingInventoryItems: RecipePreviewInventoryItem[];
otherInventoryItems: RecipePreviewInventoryItem[];
status: 'enough' | 'missing' | 'unit_mismatch';
missingQuantity: number;
};
export type RecipeInventoryPreview = {
recipe: {
id: number;
name: string;
description: string | null;
};
ingredients: RecipeInventoryPreviewIngredient[];
summary: {
totalIngredients: number;
enoughCount: number;
missingCount: number;
unitMismatchCount: number;
canCookExactly: boolean;
};
};