changes in data models

This commit is contained in:
2022-07-21 18:16:33 +02:00
parent b58acdc0c9
commit 0db1d5117e
3 changed files with 23 additions and 74 deletions

View File

@@ -31,50 +31,50 @@ const restaurantSchema = mongoose.Schema({
type: {
type: String,
maxlength: 64,
required: true
required: true,
},
placesId: {
type: String,
maxlength: 128
maxlength: 128,
},
imgUrl: {
type: String,
maxlength: 128,
required: true
required: true,
},
workingHours: {
pn: {
type: String,
maxlength: 24
maxlength: 24,
},
wt: {
type: String,
maxlength: 24
maxlength: 24,
},
sr: {
type: String,
maxlength: 24
maxlength: 24,
},
cz: {
type: String,
maxlength: 24
maxlength: 24,
},
pt: {
type: String,
maxlength: 24
maxlength: 24,
},
sb: {
type: String,
maxlength: 24
maxlength: 24,
},
nd: {
type: String,
maxlength: 24
maxlength: 24,
},
},
description: {
type: String,
maxlength: 400
maxlength: 400,
},
tags: {
cardPayments: Boolean,
@@ -88,49 +88,25 @@ const restaurantSchema = mongoose.Schema({
links: {
facebook: {
type: String,
maxlength: 128
maxlength: 128,
},
instagram: {
type: String,
maxlength: 128
maxlength: 128,
},
www: {
type: String,
maxlength: 128
maxlength: 128,
},
},
phone: {
type: String,
maxlength: 24
maxlength: 24,
},
hidden: Boolean,
indexed: Date,
categories: [String],
lunchHours: {
type: String,
maxlength: 24
},
lunchMenu: [
{
lunchSetName: {
type: String,
maxlength: 30
},
lunchSetPrice: Number,
lunchSetDishes: [{
dishId: mongoose.Types.ObjectId,
quantity: Number
}],
},
],
dishes: [mongoose.Types.ObjectId],
ratings: [
{
rate: Number,
owner: mongoose.Types.ObjectId,
id: mongoose.Types.ObjectId
}
]
});
module.exports = mongoose.model("Restaurant", restaurantSchema);