codecombat/app/schemas/models/earned_achievement.coffee

36 lines
977 B
CoffeeScript
Raw Normal View History

c = require './../schemas'
module.exports =
EarnedAchievementSchema =
type: 'object'
2014-08-23 18:51:59 -04:00
default:
previouslyAchievedAmount: 0
properties:
user: c.objectId
links:
[
{
rel: 'extra'
2014-06-30 22:16:26 -04:00
href: '/db/user/{($)}'
}
]
achievement: c.objectId
links:
[
{
rel: 'extra'
href: '/db/achievement/{($)}'
}
]
collection: type: 'string'
triggeredBy: c.objectId()
achievementName: type: 'string'
created: type: ['date', 'string', 'number']
2015-01-08 14:28:52 -05:00
changed: type: ['date', 'string', 'number'] # TODO: migrate timestamps and Date objects all to ISO strings
achievedAmount: type: 'number'
2014-06-03 16:54:56 -04:00
earnedPoints: type: 'number'
2014-08-23 18:51:59 -04:00
previouslyAchievedAmount: {type: 'number'}
earnedRewards: c.RewardSchema 'awarded by this achievement to this user'
notified: type: 'boolean'