database-connector 2.3.4 → 2.3.6

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]
72
+ * enum: [increase_revenue, attract_new_clients, 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'],
193
+ enum: ['increase_revenue', 'attract_new_clients', null],
194
194
  default: null,
195
195
  },
196
196
  targetUserIds: [
package/models/Offer.js CHANGED
@@ -65,7 +65,7 @@ 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]
68
+ * enum: [increase_revenue, attract_new_clients, null]
69
69
  * description: Campaign purpose (only when type is 'all')
70
70
  * userIds:
71
71
  * type: array
@@ -165,7 +165,7 @@ const OfferSchema = new mongoose.Schema(
165
165
  },
166
166
  campaignPurpose: {
167
167
  type: String,
168
- enum: ['increase_revenue', 'attract_new_clients'],
168
+ enum: ['increase_revenue', 'attract_new_clients', null],
169
169
  default: null,
170
170
  },
171
171
  userIds: {
@@ -0,0 +1,41 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ /**
4
+ * @swagger
5
+ * components:
6
+ * schemas:
7
+ * Settings:
8
+ * type: object
9
+ * properties:
10
+ * id:
11
+ * type: string
12
+ * description: The settings identifier
13
+ * max_pollution_threshold:
14
+ * type: number
15
+ * default: 20
16
+ * description: Maximum pollution threshold for notification system (notifications per day)
17
+ * createdAt:
18
+ * type: string
19
+ * format: date-time
20
+ * updatedAt:
21
+ * type: string
22
+ * format: date-time
23
+ * example:
24
+ * id: "507f1f77bcf86cd799439011"
25
+ * max_pollution_threshold: 20
26
+ * createdAt: "2025-11-01T10:30:00.000Z"
27
+ * updatedAt: "2025-12-01T15:45:00.000Z"
28
+ */
29
+ const SettingsSchema = new mongoose.Schema(
30
+ {
31
+ max_pollution_threshold: {
32
+ type: Number,
33
+ default: 20,
34
+ },
35
+ },
36
+ {
37
+ timestamps: true,
38
+ }
39
+ );
40
+
41
+ module.exports = mongoose.model('Settings', SettingsSchema);
package/models/User.js CHANGED
@@ -109,6 +109,29 @@ const { policySchema } = require('database-connector/models/Policy');
109
109
  * items:
110
110
  * type: string
111
111
  * description: Subscribed stores
112
+ * notification:
113
+ * type: object
114
+ * properties:
115
+ * orderNotifications:
116
+ * type: boolean
117
+ * offerNotification:
118
+ * type: boolean
119
+ * mail:
120
+ * type: boolean
121
+ * sms:
122
+ * type: boolean
123
+ * platforme:
124
+ * type: boolean
125
+ * popup:
126
+ * type: boolean
127
+ * vibration:
128
+ * type: boolean
129
+ * ringing:
130
+ * type: boolean
131
+ * maxNotif:
132
+ * type: number
133
+ * default: null
134
+ * description: Maximum number of notifications per day (null = unlimited)
112
135
  * createdAt:
113
136
  * type: string
114
137
  * format: date-time
@@ -261,6 +284,7 @@ const userSchema = new mongoose.Schema(
261
284
  popup: { type: Boolean, default: null },
262
285
  vibration: { type: Boolean, default: null },
263
286
  ringing: { type: Boolean, default: null },
287
+ maxNotif: { type: Number, default: null },
264
288
  },
265
289
 
266
290
  pickupPersons: [
package/models/index.js CHANGED
@@ -62,6 +62,7 @@ const Sale = require('./Sale');
62
62
  const StoreCategory = require('./StoreCategory');
63
63
  const UserAction = require('./UserAction.js');
64
64
  const Advertisement = require('./Advertisement');
65
+ const Settings = require('./Settings');
65
66
 
66
67
 
67
68
  module.exports = {
@@ -95,5 +96,6 @@ module.exports = {
95
96
  SubscriptionOffer,
96
97
  UserAction,
97
98
  Advertisement,
99
+ Settings,
98
100
  ObjectId: mongoose.Types.ObjectId,
99
101
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "database-connector",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
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": {