codecombat/app/schemas/models/trial_request.schema.coffee
Matt Lott 804c62e13b Add created field to trial requests
Necessary for importing external trial requests.
2015-11-19 15:20:42 -08:00

19 lines
695 B
CoffeeScript

c = require './../schemas'
TrialRequestSchema = c.object {
title: 'Trial request',
required: ['type']
}
_.extend TrialRequestSchema.properties,
applicant: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])
created: c.date({readOnly: true})
prepaidCode: c.objectId()
reviewDate: c.date({readOnly: true})
reviewer: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])
properties: {type: 'object', description: 'Data specific to this request.'}
status: {type: 'string', 'enum': ['submitted', 'approved', 'denied']}
type: {type: 'string', 'enum': ['subscription']}
c.extendBasicProperties TrialRequestSchema, 'TrialRequest'
module.exports = TrialRequestSchema