codecombat/app/schemas/models/prepaid.schema.coffee
Scott Erickson f0fa88206d Add Enrollment start/end dates, remove self-serve
* Refactor several related endpoints and views
* Redesign EnrollmentView, add TeacherContactModal
* Add "Enrollment Status" tab to TeacherClassView
* Delete PurchaseCoursesView and related files
* Style-flatten RemoveStudentModal
* Fix error handling in ActivateLicensesModal
* TeacherCoursesView loads faster by only loading course campaigns, and not load prepaids
2016-05-24 14:07:28 -07:00

20 lines
733 B
CoffeeScript

c = require './../schemas'
PrepaidSchema = c.object({title: 'Prepaid', required: ['creator', 'type']}, {
creator: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ])
redeemers: c.array {title: 'Users who have redeemed this code'},
c.object {required: ['date', 'userID']},
date: c.date {title: 'Redeemed date'}
userID: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ])
maxRedeemers: { type: 'integer' }
code: c.shortString(title: "Unique code to redeem")
type: { type: 'string' }
properties: {type: 'object' }
exhausted: { type: 'boolean' }
startDate: c.stringDate()
endDate: c.stringDate()
})
c.extendBasicProperties(PrepaidSchema, 'prepaid')
module.exports = PrepaidSchema