Skip to content

Commit

Permalink
Cyberleague: [premieroctet#119] Add is_level fields to question schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien-Wappizy committed Sep 6, 2024
1 parent 67a2fa2 commit 9f87916
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/web/server/plugins/cyberleague/schemas/QuestionSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ const QuestionSchema = new Schema({
is_bellwether: {
type: Boolean,
required: [true, `Il est obligatoire de préciser si la question appartient au baromètre`]
},
is_level_1: {
type: Boolean,
required: [function (s) {return (!this.is_level_2 && !this.is_level_3)}, `La question doit être affectée à au moins un niveau de questionnaire`]
},
is_level_2: {
type: Boolean,
required: [function (s) {return (!this.is_level_1 && !this.is_level_3)}, `La question doit être affectée à au moins un niveau de questionnaire`]
},
is_level_3: {
type: Boolean,
required: [function (s) {return (!this.is_level_2 && !this.is_level_1)}, `La question doit être affectée à au moins un niveau de questionnaire`]
}
}, {...schemaOptions})

Expand Down

0 comments on commit 9f87916

Please sign in to comment.