Initial Commit

This commit is contained in:
2020-07-08 15:37:09 +02:00
commit 549ecd137f
1746 changed files with 292109 additions and 0 deletions

24
models/dish.js Normal file
View 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
View 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
View 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);