diff --git a/src/lib/server/shopping/repository.ts b/src/lib/server/shopping/repository.ts new file mode 100644 index 0000000..bc0efd7 --- /dev/null +++ b/src/lib/server/shopping/repository.ts @@ -0,0 +1,67 @@ +import type Database from 'better-sqlite3'; + +export type ShoppingCartRecipe = { + recipe_id: number; + title: string; + image_path: string | null; + servings: number; + servings_default: number; +}; + +export type ShoppingListRow = { + name_key: string; + unit_key: string; + display_name: string; + display_unit: string | null; + total_quantity: number | null; + from_recipes: string; + checked: 0 | 1; +}; + +export type ShoppingListSnapshot = { + recipes: ShoppingCartRecipe[]; + rows: ShoppingListRow[]; + uncheckedCount: number; +}; + +export function addRecipeToCart( + _db: Database.Database, + _recipeId: number, + _profileId: number | null, + _servings?: number +): void { + throw new Error('not implemented'); +} + +export function removeRecipeFromCart(_db: Database.Database, _recipeId: number): void { + throw new Error('not implemented'); +} + +export function setCartServings( + _db: Database.Database, + _recipeId: number, + _servings: number +): void { + throw new Error('not implemented'); +} + +export function listShoppingList(_db: Database.Database): ShoppingListSnapshot { + throw new Error('not implemented'); +} + +export function toggleCheck( + _db: Database.Database, + _nameKey: string, + _unitKey: string, + _checked: boolean +): void { + throw new Error('not implemented'); +} + +export function clearCheckedItems(_db: Database.Database): void { + throw new Error('not implemented'); +} + +export function clearCart(_db: Database.Database): void { + throw new Error('not implemented'); +}