codecombat/server/levels/feedbacks/level_feedback_schema.coffee
Sébastien Moratinos 729cd300b7 server reorganize files and folder by features
- move and rename files
- use associative arrays which store handlers for 'dynamically'
  load module from de db route
- store models_path in test/server/common,
  a global model variable has the same name that the filename of the model
2014-01-23 01:01:40 +01:00

27 lines
804 B
CoffeeScript

c = require '../../commons/schemas'
LevelFeedbackLevelSchema = c.object {required: ['original', 'majorVersion']}, {
original: c.objectId({})
majorVersion: {type: 'integer', minimum: 0, default: 0}}
LevelFeedbackSchema = c.object {
title: "Feedback"
description: "Feedback on a level."
}
_.extend LevelFeedbackSchema.properties,
# denormalization
creatorName: { type: 'string' }
levelName: { type: 'string' }
levelID: { type: 'string' }
creator: c.objectId(links: [{rel: 'extra', href: "/db/user/{($)}"}])
created: c.date( { title: 'Created', readOnly: true })
level: LevelFeedbackLevelSchema
rating: { type: 'number', minimum: 1, maximum: 5 }
review: { type: 'string' }
c.extendBasicProperties LevelFeedbackSchema, 'level.feedback'
module.exports = LevelFeedbackSchema