payservedb 3.5.0 → 3.5.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -22,6 +22,10 @@ const analogMeterSchema = new mongoose.Schema({
22
22
  status: {
23
23
  type: String
24
24
  },
25
+ userType: {
26
+ type: String,
27
+ enum: ['postpaid', 'prepaid'],
28
+ },
25
29
  lastReadingDate: {
26
30
  type: Date,
27
31
  default: Date.now
@@ -57,13 +57,9 @@ const leaseAgreementSchema = new mongoose.Schema({
57
57
  isPrimary: { type: Boolean, default: false }
58
58
  }],
59
59
  securityDeposit: { type: Number, required: true },
60
- penalty: {
61
- type: {
62
- amount: { type: Number },
63
- percentage: { type: Number },
64
- appliesAfter: { type: Number, default: 7 } // Days after due date
65
- },
66
- default: null
60
+ penaltyId: { // Reference to Penalty collection
61
+ type: mongoose.Schema.Types.ObjectId,
62
+ ref: 'Penalty'
67
63
  }
68
64
  },
69
65
  billingCycle: {
@@ -96,8 +92,10 @@ const leaseAgreementSchema = new mongoose.Schema({
96
92
  ],
97
93
  reminders: [
98
94
  {
99
- type: { type: String, enum: ['SMS', 'Email', 'WhatsApp'], required: true },
100
- scheduledDate: { type: Date, required: true },
95
+ reminderId: { // Reference to Reminder collection
96
+ type: mongoose.Schema.Types.ObjectId,
97
+ ref: 'Reminder'
98
+ },
101
99
  status: { type: String, enum: ['Pending', 'Sent'], default: 'Pending' }
102
100
  }
103
101
  ],
@@ -22,6 +22,10 @@ const meterSchema = new mongoose.Schema({
22
22
  trim: true,
23
23
  unique: true
24
24
  },
25
+ userType: {
26
+ type: String,
27
+ enum: ['postpaid', 'prepaid'],
28
+ },
25
29
  isInstalled: {
26
30
  type: Boolean,
27
31
  default: false