Skip to content

Commit

Permalink
EDF: [premieroctet#78] add quests field in table schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien-Wappizy committed Dec 9, 2024
1 parent 31021a1 commit fae1acc
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ const TableSchema = new Schema({
default: 0,
validate: [function (value) {return value => 0 && (value + this.staff_number <= this.capacity)}, `Le nombre de places pour le partenaire doit être compris entre 1 et la taille de la table`]
},
guests: {
type: [{
type: Schema.Types.ObjectId,
ref: 'user',
required: true
}],
required: false,
validate: [function (value) {return value.length <= this.guest_number}, function () { return `Le nombre d'invité.e.s ne peut pas dépasser ${this.guest_number}`}],
default: []
},
}, {...schemaOptions})

/* eslint-disable prefer-arrow-callback */
Expand Down

0 comments on commit fae1acc

Please sign in to comment.