payservedb 5.6.6 → 5.6.7
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/package.json +1 -1
- package/src/models/notification.js +28 -20
package/package.json
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
const mongoose = require(
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
2
|
|
|
3
3
|
// Define the schema for Notifications
|
|
4
|
-
const notificationSchema = new mongoose.Schema(
|
|
4
|
+
const notificationSchema = new mongoose.Schema(
|
|
5
|
+
{
|
|
5
6
|
userId: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
facilityId: {
|
|
12
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
13
|
+
ref: "Facility",
|
|
14
|
+
required: true,
|
|
9
15
|
},
|
|
10
16
|
message: {
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
13
19
|
},
|
|
14
20
|
read: {
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
17
23
|
},
|
|
18
24
|
dateRead: {
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
type: Date,
|
|
26
|
+
default: null,
|
|
21
27
|
},
|
|
22
28
|
dateUpdated: {
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
type: Date,
|
|
30
|
+
default: null,
|
|
25
31
|
},
|
|
26
32
|
dateSent: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
type: Date,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
timestamps: true,
|
|
39
|
+
},
|
|
40
|
+
);
|
|
33
41
|
|
|
34
|
-
const Notification = mongoose.model(
|
|
42
|
+
const Notification = mongoose.model("Notification", notificationSchema);
|
|
35
43
|
|
|
36
44
|
module.exports = Notification;
|