diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-01-07 13:53:27 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-01-07 13:53:27 -0500 |
| commit | 2d4ed7d888727e1b973c2581b694d900e30c2ebd (patch) | |
| tree | 7abb511540677fd50cdb3e85cffb8e182a2a9b41 /server/lib/schemas/Subscription.js | |
| parent | f7475059dadf25161471e8b3086d127a1d1545f9 (diff) | |
plan/subscription schemas
Diffstat (limited to 'server/lib/schemas/Subscription.js')
| -rw-r--r-- | server/lib/schemas/Subscription.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/server/lib/schemas/Subscription.js b/server/lib/schemas/Subscription.js new file mode 100644 index 0000000..8d0b10e --- /dev/null +++ b/server/lib/schemas/Subscription.js @@ -0,0 +1,25 @@ +/* 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 }, + + monthly_total: { type: Number }, + yearly_total: { type: Number }, + + plans: [{ + tier: { type: String }, + monthly: { type: Boolean }, + }] + + created_at: { type: Date, default: Date.now }, + updated_at: { type: Date, default: Date.now }, +}) + +module.exports = exports = mongoose.model('subscription', SubscriptionSchema); +exports.schema = SubscriptionSchema; |
