database-connector 2.4.16 → 2.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/models/PlanType.js +14 -5
- package/models/ReductionOffer.js +0 -9
- package/package.json +1 -1
package/models/PlanType.js
CHANGED
|
@@ -15,14 +15,17 @@ const mongoose = require('mongoose');
|
|
|
15
15
|
* name:
|
|
16
16
|
* type: string
|
|
17
17
|
* description: Unique name for the plan type
|
|
18
|
-
*
|
|
18
|
+
* scheduled:
|
|
19
19
|
* type: string
|
|
20
20
|
* format: date-time
|
|
21
|
-
* description:
|
|
21
|
+
* description: Scheduled date to toggle active status (can be null). When this date is reached, active status is toggled and scheduled is reset to null.
|
|
22
22
|
* active:
|
|
23
23
|
* type: boolean
|
|
24
24
|
* default: true
|
|
25
|
-
* description: Whether this plan type is currently active
|
|
25
|
+
* description: Whether this plan type is currently active (has priority over monthsEnabled)
|
|
26
|
+
* monthsEnabled:
|
|
27
|
+
* type: number
|
|
28
|
+
* description: Number of months the plan type is available/visible (can be null). Active attribute has priority.
|
|
26
29
|
* features:
|
|
27
30
|
* type: object
|
|
28
31
|
* additionalProperties:
|
|
@@ -44,8 +47,9 @@ const mongoose = require('mongoose');
|
|
|
44
47
|
* example:
|
|
45
48
|
* id: "507f1f77bcf86cd799439011"
|
|
46
49
|
* name: "Premium"
|
|
47
|
-
*
|
|
50
|
+
* scheduled: null
|
|
48
51
|
* active: true
|
|
52
|
+
* monthsEnabled: 12
|
|
49
53
|
* features:
|
|
50
54
|
* socialMedia: true
|
|
51
55
|
* BIanalytics: false
|
|
@@ -60,7 +64,7 @@ const planTypeSchema = new mongoose.Schema(
|
|
|
60
64
|
required: true,
|
|
61
65
|
unique: true,
|
|
62
66
|
},
|
|
63
|
-
|
|
67
|
+
scheduled: {
|
|
64
68
|
type: Date,
|
|
65
69
|
required: false,
|
|
66
70
|
default: null,
|
|
@@ -69,6 +73,11 @@ const planTypeSchema = new mongoose.Schema(
|
|
|
69
73
|
type: Boolean,
|
|
70
74
|
default: true,
|
|
71
75
|
},
|
|
76
|
+
monthsEnabled: {
|
|
77
|
+
type: Number,
|
|
78
|
+
required: false,
|
|
79
|
+
default: null,
|
|
80
|
+
},
|
|
72
81
|
features: {
|
|
73
82
|
type: Map,
|
|
74
83
|
of: mongoose.Schema.Types.Mixed,
|
package/models/ReductionOffer.js
CHANGED
|
@@ -20,9 +20,6 @@ const mongoose = require('mongoose');
|
|
|
20
20
|
* discount:
|
|
21
21
|
* type: number
|
|
22
22
|
* description: Discount amount or percentage
|
|
23
|
-
* additionalStoreReductionPercentage:
|
|
24
|
-
* type: number
|
|
25
|
-
* description: Percentage of reduction on each new store added (can be null for no reduction)
|
|
26
23
|
* plan:
|
|
27
24
|
* type: string
|
|
28
25
|
* description: Reference to the plan
|
|
@@ -67,12 +64,6 @@ const ReductionOfferSchema = new mongoose.Schema(
|
|
|
67
64
|
type: Number,
|
|
68
65
|
required: true,
|
|
69
66
|
},
|
|
70
|
-
additionalStoreReductionPercentage: {
|
|
71
|
-
type: Number,
|
|
72
|
-
default: null,
|
|
73
|
-
min: 0,
|
|
74
|
-
max: 100,
|
|
75
|
-
},
|
|
76
67
|
plan: {
|
|
77
68
|
type: mongoose.Schema.Types.ObjectId,
|
|
78
69
|
required: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "database-connector",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.17",
|
|
4
4
|
"description": "MongoDB models package with Mongoose schemas for e-commerce applications. Includes User, Product, Store, Order and more with built-in validation and virtual properties.",
|
|
5
5
|
"main": "models/index.js",
|
|
6
6
|
"scripts": {
|