codecombat/app/schemas/models/earned_achievement.coffee
Scott Erickson d8e89f31b1 Fixed #1967.
2015-01-08 11:29:10 -08:00

35 lines
955 B
CoffeeScript

c = require './../schemas'
module.exports =
EarnedAchievementSchema =
type: 'object'
default:
previouslyAchievedAmount: 0
properties:
user: c.objectId
links:
[
{
rel: 'extra'
href: '/db/user/{($)}'
}
]
achievement: c.objectId
links:
[
{
rel: 'extra'
href: '/db/achievement/{($)}'
}
]
collection: type: 'string'
triggeredBy: c.objectId()
achievementName: type: 'string'
created: type: 'date'
changed: type: ['date', 'string', 'number'] # TODO: migrate timestamps and Date objects all to ISO strings
achievedAmount: type: 'number'
earnedPoints: type: 'number'
previouslyAchievedAmount: {type: 'number'}
earnedRewards: c.RewardSchema 'awarded by this achievement to this user'
notified: type: 'boolean'