summaryrefslogtreecommitdiff
path: root/server/lib/schemas/Plan.js
blob: 388ce69d2a495acd712f094166801884214b2acb (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
37
38
39
40
41
42
43
44
/* 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 },

  level: { type: Number },

  monthly_price: { type: Number },
  yearly_price: { type: Number },

  basic_layout_monthly_price: { type: Number },
  basic_layout_yearly_price: { type: Number },

  pro_layout_monthly_price: { type: Number },
  pro_layout_yearly_price: { type: Number },

  basic_layout_limit: { type: Number },
  pro_layout_limit: { type: Number },

  stock_project_limit: { type: Number },
  basic_project_limit: { type: Number },
  pro_project_limit: { type: Number },
  
  permissions: {
    basic_editor: { type: Boolean, default: false },
    pro_editor: { type: Boolean, default: false },
    sculpture: { 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;