database-connector 2.4.2 → 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.
Files changed (2) hide show
  1. package/models/Offer.js +11 -0
  2. package/package.json +1 -1
package/models/Offer.js CHANGED
@@ -72,6 +72,11 @@ const mongoose = require('mongoose');
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
@@ -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.2",
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": {