mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
fec3ac38e9
Admins can generate a prepaid code, which a user can use to subscribe for free via the account/subscription page. The subscription will be identical to the normal monthly subscription (e.g. 3500 gems per month), except they won’t be charged. Does not require the recipient to enter billing information. Can be applied to an existing subscription, which will be converted to free. Prepaid code can only be used once. Prepaid subscription cannot be unsubscribed via the UI.
14 lines
521 B
CoffeeScript
14 lines
521 B
CoffeeScript
c = require './../schemas'
|
|
|
|
PrepaidSchema = c.object({title: 'Prepaid', required: ['creator', 'redeemer', 'type']}, {
|
|
creator: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ])
|
|
redeemer: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ])
|
|
code: c.shortString(title: "Unique code to redeem")
|
|
type: { type: 'string' }
|
|
status: { enum: ['active', 'used'], default: 'active' }
|
|
properties: {type: 'object'}
|
|
})
|
|
|
|
c.extendBasicProperties(PrepaidSchema, 'prepaid')
|
|
|
|
module.exports = PrepaidSchema
|