Skip to content

Commit

Permalink
Aftral[premieroctet#25]: added certifications and templates for later…
Browse files Browse the repository at this point in the history
… use
  • Loading branch information
SeghirOumo committed Aug 20, 2024
1 parent 443cbf0 commit d7d7518
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const mongoose = require('mongoose')
const {schemaOptions} = require('../../../utils/schemas')

const Schema = mongoose.Schema

const CertificationSchema = new Schema({
name: {
type: String,
required: [true, `Le nom est obligatoire`],
},
url: {
type: String,
required: [true, `Le lien est obligatoire`],
},
}, {...schemaOptions})

/* eslint-disable prefer-arrow-callback */
/* eslint-enable prefer-arrow-callback */

module.exports = CertificationSchema
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const ProgramSchema = new Schema({
enum: Object.keys(DURATION_UNIT),
required: function() {return this.duration!=null ? [true, `L'unité de temps est obligatoire`] : false}
},
template: {
type: Schema.Types.ObjectId,
ref: 'certification',
required: false,
},
certificate: {
type: String,
required: false,
Expand Down

0 comments on commit d7d7518

Please sign in to comment.