payservedb 6.6.4 → 6.6.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.
package/index.js
CHANGED
|
@@ -189,6 +189,7 @@ const models = {
|
|
|
189
189
|
EmailSmsQueue: require("./src/models/email_sms_queue"),
|
|
190
190
|
PurchaseOrderInvoice: require("./src/models/purchaseOrderInvoice"),
|
|
191
191
|
PowerMeterCustomerBand: require("./src/models/powerMeterCustomerBand"),
|
|
192
|
+
PowerMeterCommunicationProtocol: require("./src/models/powerMeterCommunicationProtocol"),
|
|
192
193
|
PowerMeterDailyReading: require("./src/models/powerMeterDailyReading"),
|
|
193
194
|
PowerMeterPowerCharge: require("./src/models/powerMeterPowerCharges"),
|
|
194
195
|
PowerMeterGateway: require("./src/models/powerMeterGateways"),
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const powerMeterCommunicationProtocolSchema = new mongoose.Schema({
|
|
4
|
+
name: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
unique: true,
|
|
8
|
+
trim: true,
|
|
9
|
+
uppercase: true,
|
|
10
|
+
// Example: Acrel, Mqtt, LAN, etc.
|
|
11
|
+
}
|
|
12
|
+
}, {
|
|
13
|
+
timestamps: true
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const PowerMeterCommunicationProtocol = mongoose.model('PowerMeterCommunicationProtocol', powerMeterCommunicationProtocolSchema);
|
|
17
|
+
|
|
18
|
+
module.exports = PowerMeterCommunicationProtocol;
|
|
@@ -6,6 +6,14 @@ const powerMeterSchema = new mongoose.Schema({
|
|
|
6
6
|
ref: 'Facility',
|
|
7
7
|
required: true
|
|
8
8
|
},
|
|
9
|
+
gatewayId: {
|
|
10
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
+
ref: 'PowerMeterGateway'
|
|
12
|
+
},
|
|
13
|
+
communicationProtocol: {
|
|
14
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
+
ref: 'PowerMeterCommunicationProtocol'
|
|
16
|
+
},
|
|
9
17
|
meterSerialNumber: {
|
|
10
18
|
type: String,
|
|
11
19
|
required: true
|
|
@@ -18,10 +26,6 @@ const powerMeterSchema = new mongoose.Schema({
|
|
|
18
26
|
type: Number,
|
|
19
27
|
required: false
|
|
20
28
|
},
|
|
21
|
-
gatewayId: {
|
|
22
|
-
type: String,
|
|
23
|
-
required: true
|
|
24
|
-
},
|
|
25
29
|
mqttId: {
|
|
26
30
|
type: String,
|
|
27
31
|
required: true
|
package/src/models/visitLog.js
CHANGED
|
@@ -15,12 +15,16 @@ const visitLogSchema = new mongoose.Schema({
|
|
|
15
15
|
type: String,
|
|
16
16
|
required: false
|
|
17
17
|
},
|
|
18
|
+
phoneNumber: {
|
|
19
|
+
type: String,
|
|
20
|
+
trim: true
|
|
21
|
+
},
|
|
18
22
|
residentId: {
|
|
19
23
|
type: mongoose.Schema.Types.ObjectId,
|
|
20
24
|
},
|
|
21
|
-
qrCode:{
|
|
22
|
-
type:Boolean,
|
|
23
|
-
required:false
|
|
25
|
+
qrCode: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: false
|
|
24
28
|
},
|
|
25
29
|
houseNumber: {
|
|
26
30
|
type: String,
|
|
@@ -34,26 +38,26 @@ const visitLogSchema = new mongoose.Schema({
|
|
|
34
38
|
type: Date, // Changed to Date for better handling of time
|
|
35
39
|
required: false
|
|
36
40
|
},
|
|
37
|
-
days:{
|
|
38
|
-
type:Number,
|
|
39
|
-
required:false
|
|
41
|
+
days: {
|
|
42
|
+
type: Number,
|
|
43
|
+
required: false
|
|
40
44
|
},
|
|
41
|
-
division:{
|
|
42
|
-
type:String,
|
|
43
|
-
required:false
|
|
45
|
+
division: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: false
|
|
44
48
|
},
|
|
45
|
-
entryPoint:{
|
|
46
|
-
type:String,
|
|
47
|
-
required:false
|
|
49
|
+
entryPoint: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: false
|
|
48
52
|
},
|
|
49
|
-
exitPoint:{
|
|
50
|
-
type:String,
|
|
51
|
-
required:false
|
|
53
|
+
exitPoint: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: false
|
|
52
56
|
},
|
|
53
57
|
status: {
|
|
54
58
|
type: String,
|
|
55
59
|
required: true,
|
|
56
|
-
enum: ['Visit Confirmation', 'Scheduled', 'Checked In','Checked Out', 'Cancelled'] // Define valid statuses
|
|
60
|
+
enum: ['Visit Confirmation', 'Scheduled', 'Checked In', 'Checked Out', 'Cancelled'] // Define valid statuses
|
|
57
61
|
// Define valid statuses
|
|
58
62
|
},
|
|
59
63
|
vehicle: {
|
|
@@ -66,10 +70,10 @@ const visitLogSchema = new mongoose.Schema({
|
|
|
66
70
|
type: Number,
|
|
67
71
|
required: false
|
|
68
72
|
},
|
|
69
|
-
requestedBy:{
|
|
70
|
-
type:mongoose.Schema.Types.ObjectId,
|
|
71
|
-
ref:"User",
|
|
72
|
-
required:false
|
|
73
|
+
requestedBy: {
|
|
74
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
75
|
+
ref: "User",
|
|
76
|
+
required: false
|
|
73
77
|
},
|
|
74
78
|
facilityId: {
|
|
75
79
|
type: mongoose.Schema.Types.ObjectId,
|