diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-01-23 14:46:44 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-01-23 14:46:44 -0500 |
| commit | 74fb7a313b4d9ad3517e97133febff9cada96fe0 (patch) | |
| tree | 3328866297c8c6087ea2cec962a9600510ff42a0 /server/lib/schemas/Subscription.js | |
| parent | e0debd761bc24cd42f4140d2b6cc32a4271fe975 (diff) | |
handle subscribe and payment events with webhook
Diffstat (limited to 'server/lib/schemas/Subscription.js')
| -rw-r--r-- | server/lib/schemas/Subscription.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/server/lib/schemas/Subscription.js b/server/lib/schemas/Subscription.js index 7f2579b..99e4ebf 100644 --- a/server/lib/schemas/Subscription.js +++ b/server/lib/schemas/Subscription.js @@ -8,14 +8,15 @@ var mongoose = require('mongoose'), 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 }, - projects: [{ type: mongoose.Schema.ObjectId }], + + plan_level: { type: Number, default: 0 }, + plan_type: { type: String, default: "free" }, + last_charged: { type: Date, default: null }, + + subscription_uuid: { type: String }, + subscription_add_ons: [{ + name: { type: String }, + quantity: { type: Number }, }], created_at: { type: Date, default: Date.now }, |
