From 3f34ab97ff5aca22d3a394434c7ff401ca145eae Mon Sep 17 00:00:00 2001 From: Bastien Seree Date: Mon, 9 Dec 2024 12:01:59 +0100 Subject: [PATCH] EDF: [#79] add staff field in table schema --- .../plugins/entreprisedufutur/schemas/TableSchema.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js b/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js index 2c243e166d..52504a6835 100644 --- a/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js +++ b/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js @@ -56,6 +56,16 @@ const TableSchema = new Schema({ 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: [] }, + staff: { + type: [{ + type: Schema.Types.ObjectId, + ref: 'user', + required: true + }], + required: false, + validate: [function (value) {return value.length <= this.staff_number}, function () { return `Le nombre d'invité.e.s ne peut pas dépasser ${this.staff_number}`}], + default: [] + }, }, {...schemaOptions}) /* eslint-disable prefer-arrow-callback */