payservedb 9.6.4 → 9.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/package.json
CHANGED
package/src/models/facility.js
CHANGED
|
@@ -81,7 +81,38 @@ const facilitySchema = new mongoose.Schema(
|
|
|
81
81
|
|
|
82
82
|
lastTestedAt: Date,
|
|
83
83
|
|
|
84
|
-
lastError: String
|
|
84
|
+
lastError: String,
|
|
85
|
+
|
|
86
|
+
profiles: [{
|
|
87
|
+
_id: {
|
|
88
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
89
|
+
auto: true
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
name: {
|
|
93
|
+
type: String,
|
|
94
|
+
required: true
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
apiKey: {
|
|
98
|
+
type: String,
|
|
99
|
+
required: true
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
enabled: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: true
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
connected: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
connectedAt: Date,
|
|
113
|
+
lastTestedAt: Date,
|
|
114
|
+
lastError: String
|
|
115
|
+
}]
|
|
85
116
|
|
|
86
117
|
},
|
|
87
118
|
},
|
package/src/models/levy.js
CHANGED
|
@@ -173,6 +173,16 @@ const powerInvoiceSchema = new mongoose.Schema(
|
|
|
173
173
|
// e.g. "Domestic Lifeline", "Domestic Ordinary 1", "Domestic Ordinary 2",
|
|
174
174
|
// "Commercial Low Voltage", "Industrial Low Voltage"
|
|
175
175
|
},
|
|
176
|
+
// ── NEW RATE FIELD ──────────────────────────────────────────────────────────
|
|
177
|
+
// The cost per unit (kWh) for electricity consumption
|
|
178
|
+
rate: {
|
|
179
|
+
type: Number,
|
|
180
|
+
required: true,
|
|
181
|
+
min: 0,
|
|
182
|
+
default: 0,
|
|
183
|
+
// This represents the tariff rate in the currency specified below
|
|
184
|
+
// e.g., 15.50 KSh per kWh
|
|
185
|
+
},
|
|
176
186
|
meterReadings: {
|
|
177
187
|
previousReading: {
|
|
178
188
|
type: Number,
|
|
@@ -366,6 +376,8 @@ powerInvoiceSchema.index({ status: 1 });
|
|
|
366
376
|
powerInvoiceSchema.index({ meterNumber: 1 });
|
|
367
377
|
powerInvoiceSchema.index({ accountNumber: 1 });
|
|
368
378
|
powerInvoiceSchema.index({ unitId: 1 });
|
|
379
|
+
// Add index for rate field if you plan to query by rate
|
|
380
|
+
powerInvoiceSchema.index({ rate: 1 });
|
|
369
381
|
|
|
370
382
|
const PowerInvoice = mongoose.model('PowerInvoice', powerInvoiceSchema);
|
|
371
383
|
|