payservedb 7.8.7 → 7.8.9

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
@@ -203,8 +203,8 @@ const models = {
203
203
  PowerPrepaidCredit: require("./src/models/power_prepaid_credits"),
204
204
  PowerNegativeBalance: require("./src/models/power_meter_negative_balance"),
205
205
  PowerCommandQueue: require("./src/models/power_meter_command_queue"),
206
+ PowerNotification: require("./src/models/power_sms_notification"),
206
207
  FacilityWalletTransactionsMetadata: require("./src/models/facilityWalletTransactionsMetadata"),
207
- SmsNotification: require("./src/models/sms_balance_notification"),
208
208
  NegativeBalance: require("./src/models/water_meter_negative_amounts"),
209
209
  MasterWorkplan: require("./src/models/master_workplan"),
210
210
  MasterWorkplanChild: require("./src/models/master_workplan_child"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "7.8.7",
3
+ "version": "7.8.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -72,6 +72,10 @@ const billerAddressSchema = new mongoose.Schema(
72
72
  type: String, // Will store the file path/URL of the uploaded logo
73
73
  required: false,
74
74
  },
75
+ digitalSignature: {
76
+ type: String, // Will store the file path/URL of the uploaded digital signature
77
+ required: false,
78
+ },
75
79
  isDefault: {
76
80
  type: Boolean,
77
81
  default: false,
@@ -117,4 +121,4 @@ billerAddressSchema.pre('save', async function (next) {
117
121
  // Compile the model from the schema
118
122
  const BillerAddress = mongoose.model("BillerAddress", billerAddressSchema);
119
123
 
120
- module.exports = BillerAddress;
124
+ module.exports = BillerAddress;
@@ -7,7 +7,7 @@ const powerMeterSettingsSchema = new mongoose.Schema({
7
7
  required: true,
8
8
  unique: true // Ensure one settings record per facility
9
9
  },
10
-
10
+
11
11
  // Billing Amounts
12
12
  minAmount: {
13
13
  type: Number,
@@ -19,7 +19,7 @@ const powerMeterSettingsSchema = new mongoose.Schema({
19
19
  default: 50000,
20
20
  min: 0
21
21
  },
22
-
22
+
23
23
  // Suspicious Meter Reading Thresholds
24
24
  lowThreshold: {
25
25
  type: Number,
@@ -31,7 +31,7 @@ const powerMeterSettingsSchema = new mongoose.Schema({
31
31
  default: 0,
32
32
  min: 0
33
33
  },
34
-
34
+
35
35
  // Billing Schedule
36
36
  gracePeriod: {
37
37
  type: Number,
@@ -44,7 +44,7 @@ const powerMeterSettingsSchema = new mongoose.Schema({
44
44
  min: 0,
45
45
  max: 30
46
46
  },
47
-
47
+
48
48
  // Payment Enforcement
49
49
  enforcePayment: {
50
50
  type: String,
@@ -56,7 +56,7 @@ const powerMeterSettingsSchema = new mongoose.Schema({
56
56
  default: 0,
57
57
  min: 0
58
58
  },
59
-
59
+
60
60
  // Tariff Settings
61
61
  tariff: {
62
62
  type: String,
@@ -78,7 +78,7 @@ const powerMeterSettingsSchema = new mongoose.Schema({
78
78
  default: 0,
79
79
  min: 0
80
80
  },
81
-
81
+
82
82
  // GL Account Configuration (following your sample pattern)
83
83
  glAccounts: {
84
84
  invoice: {
@@ -106,7 +106,28 @@ const powerMeterSettingsSchema = new mongoose.Schema({
106
106
  }
107
107
  }
108
108
  },
109
-
109
+ // Discounts
110
+ discounts: [{
111
+ name: {
112
+ type: String,
113
+ required: true,
114
+ trim: true
115
+ },
116
+ type: {
117
+ type: String,
118
+ enum: ['percentage', 'fixed_amount'],
119
+ required: true
120
+ },
121
+ value: {
122
+ type: Number,
123
+ required: true,
124
+ min: 0
125
+ },
126
+ yearMonth: {
127
+ type: String,
128
+ required: true
129
+ }
130
+ }],
110
131
  // Other Charges
111
132
  otherCharges: {
112
133
  type: String,
@@ -0,0 +1,27 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const PowerNotificationSchema = new mongoose.Schema({
4
+ accountId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'PowerMeterAccount',
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 PowerNotification = mongoose.model('PowerNotification', PowerNotificationSchema)
26
+
27
+ module.exports = PowerNotification;
@@ -165,6 +165,29 @@ const waterMeterSettingsSchema = new mongoose.Schema({
165
165
  }
166
166
  }
167
167
  },
168
+
169
+ // Discounts
170
+ discounts: [{
171
+ name: {
172
+ type: String,
173
+ required: true,
174
+ trim: true
175
+ },
176
+ type: {
177
+ type: String,
178
+ enum: ['percentage', 'fixed_amount'],
179
+ required: true
180
+ },
181
+ value: {
182
+ type: Number,
183
+ required: true,
184
+ min: 0
185
+ },
186
+ yearMonth: {
187
+ type: String,
188
+ required: true
189
+ }
190
+ }],
168
191
 
169
192
  // Biller address for invoices
170
193
  billerAddress: {