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.'}
|
2015-03-09 12:30:51 -04:00
|
|
|
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
|