payservedb 6.2.5 → 6.2.7

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
@@ -199,7 +199,8 @@ const models = {
199
199
  PowerMeterSettings: require("./src/models/powerMeterSettings"),
200
200
  FacilityWalletTransactionsMetadata: require("./src/models/facilityWalletTransactionsMetadata"),
201
201
  PowerMeterCustomerAccount: require("./src/models/powerMeterCustomerAccount"),
202
- SmsNotification: require("./src/models/sms_balance_notification")
202
+ SmsNotification: require("./src/models/sms_balance_notification"),
203
+ NegativeBalance: require("./src/models/water_meter_negative_amounts")
203
204
  };
204
205
 
205
206
  // 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.5",
3
+ "version": "6.2.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,39 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const negativeBalanceSchema = 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: 'WaterMeterAccount',
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
+ dateRecorded: {
29
+ type: Date,
30
+ required: true,
31
+ default: Date.now
32
+ }
33
+ }, {
34
+ timestamps: true
35
+ });
36
+
37
+ const NegativeBalance = mongoose.model('NegativeBalance', negativeBalanceSchema);
38
+
39
+ module.exports = NegativeBalance;
@@ -75,6 +75,12 @@ const waterMeterSchema = new mongoose.Schema({
75
75
  enum: ['opened', 'closed', 'maintenance', 'faulty'],
76
76
  default: 'opened',
77
77
  },
78
+ installationStatus: {
79
+ type: String,
80
+ required: true,
81
+ enum: ['installed', 'not installed'],
82
+ default: 'installed',
83
+ },
78
84
  customerType: {
79
85
  type: String,
80
86
  enum: ['postpaid', 'prepaid'],