database-connector 2.4.1 → 2.4.3

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.
@@ -69,7 +69,7 @@ const mongoose = require('mongoose');
69
69
  * description: Campaign objective - target followers, specific users, or all users
70
70
  * campaignPurpose:
71
71
  * type: string
72
- * enum: [increase_revenue, attract_new_clients, null]
72
+ * enum: [increase_revenue, attract_new_clients, both, null]
73
73
  * description: Campaign purpose (only when campaignObjective is 'all')
74
74
  * targetUserIds:
75
75
  * type: array
@@ -190,7 +190,7 @@ const FlashDealSchema = new mongoose.Schema(
190
190
  },
191
191
  campaignPurpose: {
192
192
  type: String,
193
- enum: ['increase_revenue', 'attract_new_clients', null],
193
+ enum: ['increase_revenue', 'attract_new_clients', 'both', null],
194
194
  default: null,
195
195
  },
196
196
  targetUserIds: [
package/models/Offer.js CHANGED
@@ -65,13 +65,18 @@ const mongoose = require('mongoose');
65
65
  * description: Who can see this offer
66
66
  * campaignPurpose:
67
67
  * type: string
68
- * enum: [increase_revenue, attract_new_clients, null]
68
+ * enum: [increase_revenue, attract_new_clients, both, null]
69
69
  * description: Campaign purpose (only when type is 'all')
70
70
  * userIds:
71
71
  * type: array
72
72
  * items:
73
73
  * type: string
74
74
  * description: Array of user IDs (used when type is 'specific')
75
+ * blacklist:
76
+ * type: array
77
+ * items:
78
+ * type: string
79
+ * description: Array of user IDs blacklisted from this offer
75
80
  * addToSlider:
76
81
  * type: boolean
77
82
  * default: false
@@ -165,7 +170,7 @@ const OfferSchema = new mongoose.Schema(
165
170
  },
166
171
  campaignPurpose: {
167
172
  type: String,
168
- enum: ['increase_revenue', 'attract_new_clients', null],
173
+ enum: ['increase_revenue', 'attract_new_clients', 'both', null],
169
174
  default: null,
170
175
  },
171
176
  userIds: {
@@ -173,6 +178,11 @@ const OfferSchema = new mongoose.Schema(
173
178
  ref: 'User',
174
179
  default: [],
175
180
  },
181
+ blacklist: {
182
+ type: [mongoose.Schema.Types.ObjectId],
183
+ ref: 'User',
184
+ default: [],
185
+ },
176
186
  addToSlider: {
177
187
  type: Boolean,
178
188
  default: false,
@@ -207,5 +217,6 @@ OfferSchema.index({ createdAt: -1 });
207
217
  OfferSchema.index({ offerDeleted: 1 });
208
218
  OfferSchema.index({ type: 1 });
209
219
  OfferSchema.index({ userIds: 1 });
220
+ OfferSchema.index({ blacklist: 1 });
210
221
 
211
222
  module.exports = mongoose.model('Offer', OfferSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "database-connector",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
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": {