Skip to content

Commit

Permalink
Cyberleague: [premieroctet#156] add expertise_levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien-Wappizy committed Sep 26, 2024
1 parent c1b975e commit 6c009d1
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions backend/web/server/plugins/cyberleague/schemas/ProgramSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,32 @@ const {schemaOptions} = require('../../../utils/schemas')
const Schema = mongoose.Schema

const ProgramSchema = new Schema({
modules: {
type: Schema.Types.ObjectId,
ref: 'cLModule',
required: [true, 'Les modules sont obligatoires'],
},
name: {
type: String,
required: [true, 'Le nom du programme est obligatoire'],
},
picture: {
type: String,
required: false,
},
creator: {
type: Schema.Types.ObjectId,
ref: 'user',
required: [true, 'Le créateur du programme est obligatoire']
}
modules: {
type: Schema.Types.ObjectId,
ref: 'cLModule',
required: [true, 'Les modules sont obligatoires'],
},
name: {
type: String,
required: [true, 'Le nom du programme est obligatoire'],
},
picture: {
type: String,
required: false,
},
expertise_levels: {
type: [{
type: Schema.Types.ObjectId,
ref: 'expertiseLevel',
required: [true, `Les expertises et leurs niveaux sont obligatoires`]
}],
default: []
},
creator: {
type: Schema.Types.ObjectId,
ref: 'user',
required: [true, 'Le créateur du programme est obligatoire']
}
}, {...schemaOptions})

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

0 comments on commit 6c009d1

Please sign in to comment.