Skip to content

Commit

Permalink
Remove dietary restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
am9zZWY committed Jun 28, 2024
1 parent 183d01f commit e695ef9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/app/api/manage/db/prepare/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
6 changes: 2 additions & 4 deletions src/model/food.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand All @@ -30,12 +30,10 @@ const foodSchema = new Schema<FoodDocument>({
},
type: {
type: String,
enum: ['pizza', 'grill'],
required: true
},
dietary: {
type: String,
enum: ['vegan', 'vegetarian', 'gluten-free', 'lactose-free', 'halal', 'kosher', 'organic'],
required: false
},
size: {
Expand Down

0 comments on commit e695ef9

Please sign in to comment.