payservedb 5.8.9 → 5.9.0
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/index.js +3 -1
- package/package.json +1 -1
- package/src/models/email_sms_queue.js +53 -0
package/index.js
CHANGED
|
@@ -184,7 +184,9 @@ const models = {
|
|
|
184
184
|
WalletTransaction: require("./src/models/wallet_transactions"),
|
|
185
185
|
GoodsReceivedNote: require("./src/models/goodsReceivedNotes"),
|
|
186
186
|
MeterCommandQueue: require("./src/models/water_meter_Command_Queue"),
|
|
187
|
-
FacilityDepartment: require("./src/models/facility_departements")
|
|
187
|
+
FacilityDepartment: require("./src/models/facility_departements"),
|
|
188
|
+
EmailSmsQueue: require("./src/models/email_sms_queue"),
|
|
189
|
+
CommunicationStatus: require("./src/models/communication_status"),
|
|
188
190
|
};
|
|
189
191
|
|
|
190
192
|
// Function to get models dynamically from a specific database connection
|
package/package.json
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
|
+
|
|
3
|
+
const EmailSmsQueueSchema = new mongoose.Schema(
|
|
4
|
+
{
|
|
5
|
+
email: {
|
|
6
|
+
to: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
subject: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
text: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
sms: {
|
|
20
|
+
to: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
message: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
type: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
enum: ["email", "sms"],
|
|
33
|
+
},
|
|
34
|
+
status: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true,
|
|
37
|
+
enum: ["pending", "sent", "failed"],
|
|
38
|
+
},
|
|
39
|
+
facilityId: {
|
|
40
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
41
|
+
ref: "Facility",
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
timestamps: true,
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const EmailSmsQueue = mongoose.model("EmailSmsQueue", EmailSmsQueueSchema);
|
|
51
|
+
|
|
52
|
+
module.exports = { EmailSmsQueue };
|
|
53
|
+
|