payservedb 9.6.4 → 9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "9.6.4",
3
+ "version": "9.6.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -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