codecombat/app/schemas/models/user-polls-record.schema.coffee

21 lines
850 B
CoffeeScript
Raw Normal View History

2015-03-07 19:30:25 -05:00
c = require './../schemas'
UserPollsRecordSchema = c.object {title: 'UserPollsRecord'}
_.extend UserPollsRecordSchema.properties,
user: c.stringID {links: [{rel: 'extra', href: '/db/user/{($)}'}]}
polls: # Poll ID strings -> answer key strings
type: 'object'
additionalProperties: c.shortString {pattern: '^[a-z0-9-]+$'}
rewards: # Poll ID strings -> reward objects, for calculating gems
type: 'object'
additionalProperties: c.object {},
random: {type: 'number', minimum: 0, maximum: 1}
level: {type: 'integer', minimum: 1}
level: {type: 'integer', minimum: 1, description: 'The player level when last saved.'}
changed: c.date title: 'Changed', readOnly: true # Controls when next poll is available
2015-03-07 19:30:25 -05:00
c.extendBasicProperties UserPollsRecordSchema, 'user-polls-record'
module.exports = UserPollsRecordSchema