summaryrefslogtreecommitdiff
path: root/server/lib/schemas/Plan.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-01-07 13:53:27 -0500
committerJules Laplace <jules@okfoc.us>2015-01-07 13:53:27 -0500
commit2d4ed7d888727e1b973c2581b694d900e30c2ebd (patch)
tree7abb511540677fd50cdb3e85cffb8e182a2a9b41 /server/lib/schemas/Plan.js
parentf7475059dadf25161471e8b3086d127a1d1545f9 (diff)
plan/subscription schemas
Diffstat (limited to 'server/lib/schemas/Plan.js')
-rw-r--r--server/lib/schemas/Plan.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/server/lib/schemas/Plan.js b/server/lib/schemas/Plan.js
new file mode 100644
index 0000000..3e74997
--- /dev/null
+++ b/server/lib/schemas/Plan.js
@@ -0,0 +1,36 @@
+/* jshint node: true */
+
+var mongoose = require('mongoose'),
+ _ = require('lodash'),
+ crypto = require('crypto'),
+ config = require('../../../config.json'),
+ util = require('../util');
+
+var PlanSchema = new mongoose.Schema({
+ name: { type: String },
+ slug: { type: String },
+
+ monthly_price: { type: Number },
+ yearly_price: { type: Number },
+
+ basic_layout_limit: { type: Number },
+ pro_layout_limit: { type: Number },
+
+ stock_layout_project_limit: { type: Number },
+ basic_layout_project_limit: { type: Number },
+ pro_layout_project_limit: { type: Number },
+
+ permissions: {
+ basic_editor: { type: Boolean, default: false },
+ pro_editor: { type: Boolean, default: false },
+ solids: { type: Boolean, default: false },
+ collaborators: { type: Boolean, default: false },
+ no_logo: { type: Boolean, default: false },
+ },
+
+ created_at: { type: Date, default: Date.now },
+ updated_at: { type: Date, default: Date.now },
+})
+
+module.exports = exports = mongoose.model('plan', PlanSchema);
+exports.schema = PlanSchema;