import type { components } from '@/api/types' // Utility mapped types export type Replace = Omit & M export type WithDates = Replace // Common helpers export type Maybe = T | null | undefined export type NonNull = Exclude export type Lookup = Record export type WithRefs = T & { [K in keyof Refs]?: Refs[K] | undefined } // Domain type aliases export type RecipeOut = components['schemas']['Recipe-Output'] export type MealOut = components['schemas']['Meal-Output'] export type Ingredient = components['schemas']['Ingredient'] export type Product = components['schemas']['Product'] export type Person = components['schemas']['Person'] export type RecipeInput = components['schemas']['Recipe-Input'] export type MealInput = components['schemas']['Meal-Input'] export type MealRecipeOut = components['schemas']['MealRecipe-Output'] // Domain shapes: only adjust where UI needs Dates export type Recipe = WithDates // MealRecipe with decoded recipe dates export type MealRecipe = Replace // Meal with decoded dates and nested MealRecipe with decoded recipe dates // Arrays (chefs, consumers, cleanup, recipes, extraIngredients) are non-nullable per OpenAPI spec export type Meal = Replace< WithDates, { recipes: MealRecipe[] chefs: Person[] consumers: Person[] cleanup: Person[] extraIngredients: Ingredient[] } > // Shopping domain shapes with dates normalized export type ShoppingListItem = WithDates type ShoppingListBase = WithDates export type ShoppingList = Replace // Refs attached to shopping list items export type ShoppingListItemWithRefs = WithRefs export type ShoppingListWithRefs = Replace // Lookup maps used by shopping mappings export type ShoppingLookups = { ingredientsLookup?: Lookup mealsLookup?: Lookup recipesLookup?: Lookup shoppingListLookup?: Lookup } // DTO shapes returned by SDK for shopping pages export type CurrentShoppingListDTO = { outstandingItems: ShoppingListItemWithRefs[] requestedMeals: ShoppingListItemWithRefs[] purchasedItems: ShoppingListItemWithRefs[] } & ShoppingLookups export type PurchasedShoppingListDTO = ShoppingLookups & { list?: (ShoppingList & { items?: ShoppingListItemWithRefs[] }) | undefined }