payservedb 6.9.1 → 6.9.2

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
@@ -201,6 +201,9 @@ const models = {
201
201
  PowerMeterSettings: require("./src/models/powerMeterSettings"),
202
202
  FacilityWalletTransactionsMetadata: require("./src/models/facilityWalletTransactionsMetadata"),
203
203
  PowerMeterCustomerAccount: require("./src/models/powerMeterCustomerAccount"),
204
+ PowerPrepaidCredit: require("./src/models/power_prepaid_credits"),
205
+ PowerPrepaidDebit: require("./src/models/power_prepaid_debits"),
206
+ PowerNegativeBalance: require("./src/models/power_meter_negative_balance"),
204
207
  SmsNotification: require("./src/models/sms_balance_notification"),
205
208
  NegativeBalance: require("./src/models/water_meter_negative_amounts"),
206
209
  MasterWorkplan: require("./src/models/master_workplan"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "6.9.1",
3
+ "version": "6.9.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -19,7 +19,7 @@ const powerMeterDailyReadingSchema = new mongoose.Schema({
19
19
  },
20
20
  status: {
21
21
  type: String,
22
- enum: ['On', '0ff', 'Maintenance', 'Faulty'],
22
+ enum: ['On', 'Off', 'Maintenance', 'Faulty'],
23
23
  default: 'On',
24
24
  }
25
25
  }, {
@@ -17,7 +17,7 @@ const powerMeterSingleDayReadingSchema = new mongoose.Schema({
17
17
  },
18
18
  status: {
19
19
  type: String,
20
- enum: ['On', '0ff', 'Maintenance', 'Faulty'],
20
+ enum: ['On', 'Off', 'Maintenance', 'Faulty'],
21
21
  default: 'On',
22
22
  },
23
23
  time: {
@@ -81,13 +81,13 @@ const powerMeterSchema = new mongoose.Schema({
81
81
  },
82
82
  liveStatus: {
83
83
  type: String,
84
- enum: ['on', 'off', 'maintenance', 'faulty'],
85
- default: 'on'
84
+ enum: ['Off', 'On', 'Maintenance', 'Faulty'],
85
+ default: 'On'
86
86
  },
87
87
  gatewayLiveStatus: {
88
88
  type: String,
89
- enum: ['ON', 'OFF'],
90
- default: 'OFF'
89
+ enum: ['on', 'off'],
90
+ default: 'off'
91
91
  },
92
92
  meterStatus: {
93
93
  type: String,
@@ -0,0 +1,44 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const powerNegativeBalanceSchema = new mongoose.Schema({
4
+ customerId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Customer',
7
+ required: true
8
+ },
9
+ accountId: {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'PowerMeterCustomerAccount',
12
+ required: true
13
+ },
14
+ customerName: {
15
+ type: String,
16
+ required: true,
17
+ trim: true
18
+ },
19
+ meterNumber: {
20
+ type: String,
21
+ required: true,
22
+ trim: true
23
+ },
24
+ amount: {
25
+ type: Number,
26
+ required: true
27
+ },
28
+ type: {
29
+ type: String,
30
+ enum: ['Credit', 'Debit'],
31
+ required: true
32
+ },
33
+ dateRecorded: {
34
+ type: Date,
35
+ required: true,
36
+ default: Date.now
37
+ }
38
+ }, {
39
+ timestamps: true
40
+ });
41
+
42
+ const PowerNegativeBalance = mongoose.model('PowerNegativeBalance', powerNegativeBalanceSchema);
43
+
44
+ module.exports = PowerNegativeBalance;
@@ -0,0 +1,47 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const powerPrepaidCreditSchema = new mongoose.Schema({
4
+ accountId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'PowerMeterCustomerAccount',
7
+ required: true,
8
+ },
9
+ meterId: {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'PowerMeters',
12
+ required: true,
13
+ },
14
+ ref: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ amount: {
19
+ type: Number,
20
+ required: true,
21
+ default: 0
22
+ },
23
+ time: {
24
+ type: String,
25
+ required: true,
26
+ },
27
+ addedOn: {
28
+ type: String,
29
+ required: true,
30
+ },
31
+ reason: {
32
+ type: String,
33
+ required: true,
34
+ },
35
+ type: {
36
+ type: String,
37
+ enum: ['Mobile Money', 'Bank', 'Manual'],
38
+ required: true
39
+ },
40
+
41
+ }, {
42
+ timestamps: true
43
+ });
44
+
45
+ const PowerPrepaidCredit = mongoose.model('PowerPrepaidCredit', powerPrepaidCreditSchema);
46
+
47
+ module.exports = PowerPrepaidCredit;
@@ -0,0 +1,50 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const waterPrepaidDebitSchema = new mongoose.Schema({
4
+ accountId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'PowerMeterCustomerAccount',
7
+ required: true,
8
+ },
9
+ meterId: {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'PowerMeters',
12
+ required: true,
13
+ },
14
+ prev_reading: {
15
+ type: Number,
16
+ required: true,
17
+ },
18
+ current_reading: {
19
+ type: Number,
20
+ required: true,
21
+ default: 0
22
+ },
23
+ consumption: {
24
+ type: Number,
25
+ required: true,
26
+ },
27
+ rate: {
28
+ type: String,
29
+ required: true,
30
+ },
31
+ totalAmount: {
32
+ type: Number,
33
+ required: true,
34
+ },
35
+ date: {
36
+ type: String,
37
+ required: true
38
+ },
39
+ time: {
40
+ type: String,
41
+ required: true
42
+ },
43
+
44
+ }, {
45
+ timestamps: true
46
+ });
47
+
48
+ const PowerPrepaidDebit = mongoose.model('PowerPrepaidDebit', powerPrepaidDebitSchema);
49
+
50
+ module.exports = PowerPrepaidDebit;
File without changes