payservedb 6.6.4 → 6.6.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/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
|