Added schema objectIds and bettered the repeatable achievements

This commit is contained in:
Ruben Vereecken 2014-05-11 17:16:16 +02:00
parent f5389fef99
commit 2f5090df8f

View file

@ -10,23 +10,41 @@ module.exports =
type: 'number' type: 'number'
collection: collection:
type: 'string' type: 'string'
measurableField: proportionalTo:
type: 'string' type: 'string'
description: 'This field denotes the field a repeatable achievement needs for its calculations' description: 'For repeatables only. Denotes the field a repeatable achievement needs for its calculations'
ratio:
type: 'integer'
description: 'For repeatables only. Denotes how many proportionalTo\'s trigger an achievement. Usually 1.'
minimum: 1
required: ['name', 'query', 'worth', 'collection'] required: ['name', 'query', 'worth', 'collection']
EarnedAchievementSchema : EarnedAchievementSchema :
type: 'object' type: 'object'
properties: properties:
# TODO ref to user user: c.objectId
# TODO ref to original achievement links:
achieved: [
{
rel: 'extra'
href: "/db/user/{($)}"
}
]
achievement: c.objectId
links:
[
{
rel: 'extra'
href: '/db/user/{($)}'
}
]
achievedAmount:
type: 'number' type: 'number'
MongoFindQuerySchema : MongoFindQuerySchema :
title: 'MongoDB Query' title: 'MongoDB Query'
id: 'mongoFindQuery' id: 'mongoFindQuery'
type: object type: 'object'
patternProperties: patternProperties:
'^[a-zA-Z0-9_\-\$]*$': '^[a-zA-Z0-9_\-\$]*$':
type: [ 'string', 'object' ] type: [ 'string', 'object' ]
@ -40,7 +58,7 @@ module.exports =
MongoQueryOperatorSchema : MongoQueryOperatorSchema :
title: 'MongoDB Query operator' title: 'MongoDB Query operator'
id: 'mongoQueryOperator' id: 'mongoQueryOperator'
type: object type: 'object'
properties: properties:
'$gt': type: 'number' '$gt': type: 'number'
'$gte': type: 'number' '$gte': type: 'number'