mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Added schema objectIds and bettered the repeatable achievements
This commit is contained in:
parent
f5389fef99
commit
2f5090df8f
1 changed files with 25 additions and 7 deletions
|
@ -10,23 +10,41 @@ module.exports =
|
|||
type: 'number'
|
||||
collection:
|
||||
type: 'string'
|
||||
measurableField:
|
||||
proportionalTo:
|
||||
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']
|
||||
|
||||
EarnedAchievementSchema :
|
||||
type: 'object'
|
||||
properties:
|
||||
# TODO ref to user
|
||||
# TODO ref to original achievement
|
||||
achieved:
|
||||
user: c.objectId
|
||||
links:
|
||||
[
|
||||
{
|
||||
rel: 'extra'
|
||||
href: "/db/user/{($)}"
|
||||
}
|
||||
]
|
||||
achievement: c.objectId
|
||||
links:
|
||||
[
|
||||
{
|
||||
rel: 'extra'
|
||||
href: '/db/user/{($)}'
|
||||
}
|
||||
]
|
||||
achievedAmount:
|
||||
type: 'number'
|
||||
|
||||
MongoFindQuerySchema :
|
||||
title: 'MongoDB Query'
|
||||
id: 'mongoFindQuery'
|
||||
type: object
|
||||
type: 'object'
|
||||
patternProperties:
|
||||
'^[a-zA-Z0-9_\-\$]*$':
|
||||
type: [ 'string', 'object' ]
|
||||
|
@ -40,7 +58,7 @@ module.exports =
|
|||
MongoQueryOperatorSchema :
|
||||
title: 'MongoDB Query operator'
|
||||
id: 'mongoQueryOperator'
|
||||
type: object
|
||||
type: 'object'
|
||||
properties:
|
||||
'$gt': type: 'number'
|
||||
'$gte': type: 'number'
|
||||
|
|
Loading…
Reference in a new issue