payservedb 6.2.3 → 6.2.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
@@ -198,7 +198,8 @@ const models = {
198
198
  PowerMeterMonthlyReading: require("./src/models/powerMeterMonthlyReading"),
199
199
  PowerMeterSettings: require("./src/models/powerMeterSettings"),
200
200
  FacilityWalletTransactionsMetadata: require("./src/models/facilityWalletTransactionsMetadata"),
201
- PowerMeterCustomerAccount: require("./src/models/powerMeterCustomerAccount")
201
+ PowerMeterCustomerAccount: require("./src/models/powerMeterCustomerAccount"),
202
+ SmsNotification: require("./src/models/sms_balance_notification")
202
203
  };
203
204
 
204
205
  // Function to get models dynamically from a specific database connection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "6.2.3",
3
+ "version": "6.2.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,27 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const smsNotificationSchema = new mongoose.Schema({
4
+ accountId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'WaterMeterAccount',
7
+ required: true
8
+ },
9
+ currentRange: {
10
+ type: String,
11
+ required: true
12
+ },
13
+ lastNotificationDate: {
14
+ type: Date,
15
+ default: Date.now
16
+ },
17
+ balance: {
18
+ type: Number,
19
+ required: true
20
+ }
21
+ }, {
22
+ timestamps: true
23
+ });
24
+
25
+ const SmsNotification = mongoose.model('SmsNotification', smsNotificationSchema)
26
+
27
+ module.exports = SmsNotification;
@@ -12,6 +12,11 @@ const walletSchema = new mongoose.Schema(
12
12
  required: true,
13
13
  enum: ["User", "Customer", "Facility"],
14
14
  },
15
+ walletType: {
16
+ type: String,
17
+ required: false,
18
+ enum: ["levy", "propertyManagement", "lease", "utility", "vas"],
19
+ },
15
20
  amount: {
16
21
  type: Number,
17
22
  default: 0,
@@ -30,7 +30,7 @@ const concentratorSchema = new mongoose.Schema({
30
30
  type: String,
31
31
  required: true,
32
32
  enum: ['online', 'offline', 'maintenance'],
33
- default: '0ffline'
33
+ default: 'offline'
34
34
  },
35
35
  meter_fails: {
36
36
  type: Number,
@@ -28,6 +28,10 @@ const waterPrepaidCreditSchema = new mongoose.Schema({
28
28
  type: String,
29
29
  required: true,
30
30
  },
31
+ reason: {
32
+ type: String,
33
+ required: true,
34
+ },
31
35
  type: {
32
36
  type: String,
33
37
  enum: ['Mobile Money', 'Bank', 'Manual'],