Initial Commit
This commit is contained in:
24
models/dish.js
Normal file
24
models/dish.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const dishSchema = mongoose.Schema({
|
||||
id: mongoose.Types.ObjectId,
|
||||
name: String,
|
||||
category: String,
|
||||
price: Number,
|
||||
notes: String,
|
||||
imgUrl: String,
|
||||
weight: Number,
|
||||
allergens: {
|
||||
gluten: Boolean,
|
||||
lactose: Boolean,
|
||||
soy: Boolean,
|
||||
eggs: Boolean,
|
||||
seaFood: Boolean,
|
||||
peanuts: Boolean,
|
||||
sesame: Boolean,
|
||||
},
|
||||
vegan: Boolean,
|
||||
vegetarian: Boolean,
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Dish", dishSchema);
|
||||
13
models/restaurant.js
Normal file
13
models/restaurant.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const restaurantSchema = mongoose.Schema({
|
||||
id: mongoose.Types.ObjectId,
|
||||
name: String,
|
||||
city: String,
|
||||
imgUrl: String,
|
||||
workingHours: String,
|
||||
hidden: Boolean,
|
||||
dishes: [mongoose.Types.ObjectId],
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Restaurant", restaurantSchema);
|
||||
11
models/users.js
Normal file
11
models/users.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const userSchema = mongoose.Schema({
|
||||
id: mongoose.Types.ObjectId,
|
||||
email: String,
|
||||
password: String,
|
||||
restaurantId: mongoose.Types.ObjectId,
|
||||
subscriptionActive: Boolean,
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("User", userSchema);
|
||||
Reference in New Issue
Block a user