summaryrefslogtreecommitdiff
path: root/server/lib/schemas/Plan.js
blob: 3e7499705ac2f979ab5f1be1cc0897192ff7c88d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;