diff --git a/src/app/api/manage/db/prepare/route.ts b/src/app/api/manage/db/prepare/route.ts index 8996d8f..3cd32b3 100644 --- a/src/app/api/manage/db/prepare/route.ts +++ b/src/app/api/manage/db/prepare/route.ts @@ -42,16 +42,16 @@ export async function POST() { // Add pizzas const pizzas = [ - { name: 'Salami half', price: 4, type: 'pizza', ingredients: pizza_by_name('Salami'), size: 0.5 }, - { name: 'Salami full', price: 8, type: 'pizza', ingredients: pizza_by_name('Salami'), size: 1 }, - { name: 'Ham and mushrooms half', price: 4, type: 'pizza', ingredients: pizza_by_name('Ham and mushrooms'), size: 0.5 }, - { name: 'Ham and mushrooms full', price: 8, type: 'pizza', ingredients: pizza_by_name('Ham and mushrooms'), size: 1 }, - { name: 'Capriccosa half', price: 4, type: 'pizza', ingredients: pizza_by_name('Capriccosa'), size: 0.5 }, - { name: 'Capriccosa full', price: 8, type: 'pizza', ingredients: pizza_by_name('Capriccosa'), size: 1 }, - { name: 'Margherita half', price: 3, dietary: 'vegetarian', type: 'pizza', ingredients: pizza_by_name('Margherita'), size: 0.5 }, - { name: 'Margherita full', price: 6, dietary: 'vegetarian', type: 'pizza', ingredients: pizza_by_name('Margherita'), size: 1 }, - { name: 'Veggies half', price: 3, dietary: 'vegetarian', type: 'pizza', ingredients: pizza_by_name('Veggies'), size: 0.5 }, - { name: 'Veggies full', price: 6, dietary: 'vegetarian', type: 'pizza', ingredients: pizza_by_name('Veggies'), size: 1 }, + { name: 'Salami half', price: 4, dietary: 'meat', type: 'pizza', ingredients: pizza_by_name('Salami'), size: 0.5 }, + { name: 'Salami full', price: 8, dietary: 'meat', type: 'pizza', ingredients: pizza_by_name('Salami'), size: 1 }, + { name: 'Ham and mushrooms half', price: 4, dietary: 'meat', type: 'pizza', ingredients: pizza_by_name('Ham and mushrooms'), size: 0.5 }, + { name: 'Ham and mushrooms full', price: 8, dietary: 'meat', type: 'pizza', ingredients: pizza_by_name('Ham and mushrooms'), size: 1 }, + { name: 'Capriccosa half', price: 4, type: 'pizza', dietary: 'meat', ingredients: pizza_by_name('Capriccosa'), size: 0.5 }, + { name: 'Capriccosa full', price: 8, type: 'pizza', dietary: 'meat', ingredients: pizza_by_name('Capriccosa'), size: 1 }, + { name: 'Margherita half', price: 3, type: 'pizza', ingredients: pizza_by_name('Margherita'), size: 0.5 }, + { name: 'Margherita full', price: 6, type: 'pizza', ingredients: pizza_by_name('Margherita'), size: 1 }, + { name: 'Veggies half', price: 3, type: 'pizza', ingredients: pizza_by_name('Veggies'), size: 0.5 }, + { name: 'Veggies full', price: 6, type: 'pizza', ingredients: pizza_by_name('Veggies'), size: 1 }, { name: 'Margherita vegan half', price: 3, dietary: 'vegan', type: 'pizza', ingredients: pizza_by_name('Margherita vegan'), size: 0.5 }, { name: 'Margherita vegan full', price: 6, dietary: 'vegan', type: 'pizza', ingredients: pizza_by_name('Margherita vegan'), size: 1 }, { name: 'Capriccosa vegan half', price: 3, dietary: 'vegan', type: 'pizza', ingredients: pizza_by_name('Capriccosa vegan'), size: 0.5 }, diff --git a/src/model/food.ts b/src/model/food.ts index 79d018f..7bf25ab 100644 --- a/src/model/food.ts +++ b/src/model/food.ts @@ -7,9 +7,9 @@ export interface FoodDocument extends Document { name: string; price: number; // Type of food - type: 'pizza' | 'drink' | 'dessert'; + type: string; // Dietary requirements - dietary?: 'vegan' | 'vegetarian' | 'gluten-free' | 'lactose-free' | 'halal' | 'kosher' | 'organic'; + dietary?: string; // Size, e.g., 0.5 for half a pizza size: number ingredients: string[]; @@ -30,12 +30,10 @@ const foodSchema = new Schema({ }, type: { type: String, - enum: ['pizza', 'grill'], required: true }, dietary: { type: String, - enum: ['vegan', 'vegetarian', 'gluten-free', 'lactose-free', 'halal', 'kosher', 'organic'], required: false }, size: {