mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-29 18:45:48 -05:00
c3735ba0eb
It is true when redeemers.length >= maxRedeemers
18 lines
677 B
CoffeeScript
18 lines
677 B
CoffeeScript
c = require './../schemas'
|
|
|
|
PrepaidSchema = c.object({title: 'Prepaid', required: ['creator', 'type']}, {
|
|
creator: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ])
|
|
redeemers: c.array {title: 'Users who have redeemed this code'},
|
|
c.object {required: ['date', 'userID']},
|
|
date: c.date {title: 'Redeemed date'}
|
|
userID: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ])
|
|
maxRedeemers: { type: 'integer'}
|
|
code: c.shortString(title: "Unique code to redeem")
|
|
type: { type: 'string' }
|
|
properties: {type: 'object'}
|
|
exhausted: { type: 'boolean' }
|
|
})
|
|
|
|
c.extendBasicProperties(PrepaidSchema, 'prepaid')
|
|
|
|
module.exports = PrepaidSchema
|