2015-08-29 10:15:35 -04:00
|
|
|
mongoose = require 'mongoose'
|
|
|
|
config = require '../../server_config'
|
|
|
|
plugins = require '../plugins/plugins'
|
|
|
|
jsonSchema = require '../../app/schemas/models/course_instance.schema'
|
|
|
|
|
2015-11-03 14:18:44 -05:00
|
|
|
CourseInstanceSchema = new mongoose.Schema {
|
|
|
|
ownerID: mongoose.Schema.Types.ObjectId
|
|
|
|
courseID: mongoose.Schema.Types.ObjectId
|
|
|
|
classroomID: mongoose.Schema.Types.ObjectId
|
|
|
|
prepaidID: mongoose.Schema.Types.ObjectId
|
|
|
|
members: [mongoose.Schema.Types.ObjectId]
|
|
|
|
}, {strict: false, minimize: false, read:config.mongo.readpref}
|
2015-08-29 10:15:35 -04:00
|
|
|
|
|
|
|
CourseInstanceSchema.statics.privateProperties = []
|
|
|
|
CourseInstanceSchema.statics.editableProperties = [
|
|
|
|
'description'
|
|
|
|
'name'
|
2015-10-30 18:56:43 -04:00
|
|
|
'aceConfig'
|
2015-08-29 10:15:35 -04:00
|
|
|
]
|
2015-11-03 14:18:44 -05:00
|
|
|
CourseInstanceSchema.statics.postEditableProperties = [
|
|
|
|
'courseID'
|
|
|
|
'classroomID'
|
|
|
|
]
|
2015-08-29 10:15:35 -04:00
|
|
|
|
|
|
|
CourseInstanceSchema.statics.jsonSchema = jsonSchema
|
|
|
|
|
|
|
|
module.exports = CourseInstance = mongoose.model 'course.instance', CourseInstanceSchema, 'course.instances'
|