diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-10-28 18:07:56 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-10-28 18:07:56 -0400 |
| commit | a9c9d6adf470d0966e6c6bef0803e298fd2d4117 (patch) | |
| tree | 6ccec2a448992a5f43226532051a6df09afbc203 /server/lib/schemas/Subscription.js | |
| parent | 343b0b3dc5bb7dbe762182a486e63a4aff6ef8fc (diff) | |
| parent | 9e7bacd46c1e5d0e1c24433690d421ab3f3a11f2 (diff) | |
merge
Diffstat (limited to 'server/lib/schemas/Subscription.js')
| -rw-r--r-- | server/lib/schemas/Subscription.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/server/lib/schemas/Subscription.js b/server/lib/schemas/Subscription.js new file mode 100644 index 0000000..bf43e8b --- /dev/null +++ b/server/lib/schemas/Subscription.js @@ -0,0 +1,31 @@ +/* jshint node: true */ + +var mongoose = require('mongoose'), + _ = require('lodash'), + crypto = require('crypto'), + config = require('../../../config.json'), + util = require('../util'); + +var SubscriptionSchema = new mongoose.Schema({ + user_id: { type: mongoose.Schema.ObjectId, index: true }, + + plan_code: { type: String, default: "" }, + plan_type: { type: String, default: "free" }, + plan_period: { type: String, default: "monthly" }, + + uuid: { type: String }, + basic_layouts: { type: Number, default: 0 }, + pro_layouts: { type: Number, default: 0 }, + + history: [{ + action: { type: String }, + data: { type: String }, + created_at: { type: Date, default: Date.now }, + }], + + created_at: { type: Date, default: Date.now }, + updated_at: { type: Date, default: Date.now }, +}) + +module.exports = exports = mongoose.model('subscription', SubscriptionSchema); +exports.schema = SubscriptionSchema; |
