payservedb 9.6.3 → 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
|
@@ -124,7 +124,9 @@ const bookingInvoiceSchema = new mongoose.Schema({
|
|
|
124
124
|
},
|
|
125
125
|
paymentMethod: {
|
|
126
126
|
type: String,
|
|
127
|
-
|
|
127
|
+
// Card is not offered - card payment processing is not yet
|
|
128
|
+
// integrated for bookings.
|
|
129
|
+
enum: ['Cash', 'Bank Transfer', 'Mobile Money', 'Other'],
|
|
128
130
|
required: true
|
|
129
131
|
},
|
|
130
132
|
paymentStatus: {
|
|
@@ -139,7 +141,9 @@ const bookingInvoiceSchema = new mongoose.Schema({
|
|
|
139
141
|
},
|
|
140
142
|
paymentMethod: {
|
|
141
143
|
type: String,
|
|
142
|
-
|
|
144
|
+
// Card is not offered - card payment processing is not yet
|
|
145
|
+
// integrated for bookings.
|
|
146
|
+
enum: ['Cash', 'Bank Transfer', 'Mobile Money', 'Other'],
|
|
143
147
|
required: true
|
|
144
148
|
},
|
|
145
149
|
transactionId: String,
|
|
@@ -162,7 +162,9 @@ const bookingReservationSchema = new mongoose.Schema({
|
|
|
162
162
|
},
|
|
163
163
|
paymentMethod: {
|
|
164
164
|
type: String,
|
|
165
|
-
|
|
165
|
+
// Card is not offered - card payment processing is not yet
|
|
166
|
+
// integrated for bookings.
|
|
167
|
+
enum: ['Cash', 'Bank Transfer', 'Mobile Money', 'Other'],
|
|
166
168
|
required: false
|
|
167
169
|
},
|
|
168
170
|
paymentTiming: {
|
|
@@ -296,4 +298,5 @@ const bookingReservationSchema = new mongoose.Schema({
|
|
|
296
298
|
// Create model from schema
|
|
297
299
|
const BookingReservation = mongoose.model('BookingReservation', bookingReservationSchema);
|
|
298
300
|
|
|
299
|
-
module.exports = BookingReservation;
|
|
301
|
+
module.exports = BookingReservation;
|
|
302
|
+
|
|
@@ -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
|
|