codecombat/app/schemas/models/course.schema.coffee

23 lines
1 KiB
CoffeeScript
Raw Normal View History

2015-08-29 10:15:35 -04:00
c = require './../schemas'
CourseSchema = c.object {title: 'Course', required: ['name']}
c.extendNamedProperties CourseSchema # name first
_.extend CourseSchema.properties,
i18n: {type: 'object', title: 'i18n', format: 'i18n', props: ['name', 'description' ]}
2015-08-29 10:15:35 -04:00
campaignID: c.objectId()
concepts: c.array {title: 'Programming Concepts', uniqueItems: true}, c.concept
description: {type: 'string'}
2015-09-25 18:28:43 -04:00
duration: {type: 'number', description: 'Approximate hours of content'}
pricePerSeat: {type: 'number', description: 'Price per seat in USD cents.'} # deprecated
free: { type: 'boolean' }
screenshot: c.path { title: 'URL', description: 'Link to course screenshot.'}
adminOnly: { type: 'boolean', description: 'Deprecated in favor of releasePhase.' }
releasePhase: { enum: ['beta', 'released'], description: "How far along the course's development is, determining who sees it." }
2015-08-29 10:15:35 -04:00
c.extendBasicProperties CourseSchema, 'Course'
c.extendTranslationCoverageProperties CourseSchema
c.extendPatchableProperties CourseSchema
2015-08-29 10:15:35 -04:00
module.exports = CourseSchema