2021-04-10 00:47:40 -07:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
|
|
|
|
const Schema = mongoose.Schema ;
|
|
|
|
|
|
|
|
const courseSchema = new Schema({
|
|
|
|
name : {
|
|
|
|
type : String ,
|
|
|
|
required : true
|
|
|
|
} ,
|
|
|
|
mentor : {
|
|
|
|
type : String ,
|
|
|
|
required : true
|
|
|
|
} ,
|
|
|
|
totalLectures : {
|
|
|
|
type : Number ,
|
|
|
|
required : true
|
|
|
|
} ,
|
2021-05-05 05:56:43 -07:00
|
|
|
route: {
|
|
|
|
type : String ,
|
|
|
|
required : true
|
|
|
|
} ,
|
2021-04-10 00:47:40 -07:00
|
|
|
meetings : [
|
|
|
|
{
|
|
|
|
startTime : {
|
|
|
|
type : String ,
|
|
|
|
required : true
|
|
|
|
} ,
|
|
|
|
endTime : {
|
|
|
|
type : String ,
|
|
|
|
required : true
|
|
|
|
} ,
|
|
|
|
link : {
|
|
|
|
type : String ,
|
|
|
|
required : true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
] ,
|
|
|
|
types : {
|
|
|
|
tier1: {
|
|
|
|
type : mongoose.Types.ObjectId ,
|
|
|
|
ref : 'CourseType'
|
|
|
|
} ,
|
|
|
|
tier2 : {
|
|
|
|
type : mongoose.Types.ObjectId ,
|
|
|
|
ref : 'CourseType'
|
|
|
|
} ,
|
|
|
|
tier3: {
|
|
|
|
type : mongoose.Types.ObjectId ,
|
|
|
|
ref : 'CourseType'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}) ;
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Course' , courseSchema) ;
|