database-connector 2.3.4 → 2.3.5
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/Settings.js +41 -0
- package/models/User.js +24 -0
- package/models/index.js +2 -0
- package/package.json +1 -1
|
@@ -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.
|
|
3
|
+
"version": "2.3.5",
|
|
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": {
|