payservedb 8.0.3 → 8.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "8.0.3",
3
+ "version": "8.0.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -9,8 +9,7 @@ const invoiceSchema = new mongoose.Schema(
9
9
  },
10
10
  accountNumber: {
11
11
  type: String,
12
- required: true,
13
- unique: true,
12
+ required: true
14
13
  },
15
14
  client: {
16
15
  clientId: {
@@ -11,7 +11,10 @@ const InvoicingScheduleSchema = new mongoose.Schema({
11
11
  },
12
12
  invoiceType: {
13
13
  type: String,
14
- required: true
14
+ required: true,
15
+ unique: true,
16
+ trim: true,
17
+ index: true
15
18
  },
16
19
  createdAt: {
17
20
  type: Date,
@@ -214,13 +214,19 @@ const leaseAgreementSchema = new mongoose.Schema({
214
214
  createdBy: {
215
215
  type: mongoose.Schema.Types.ObjectId,
216
216
  ref: 'User'
217
+ },
218
+ lastInvoiceYearMonth: {
219
+ type: String,
220
+ default: null
221
+ // Format: "2025-09", "2025-10", etc.
217
222
  }
218
223
  }, {
219
224
  timestamps: true
220
225
  });
221
226
 
222
227
  leaseAgreementSchema.index({ facilityId: 1 });
228
+ leaseAgreementSchema.index({ lastInvoiceYearMonth: 1 });
223
229
 
224
230
  const LeaseAgreement = mongoose.model('LeaseAgreement', leaseAgreementSchema);
225
231
 
226
- module.exports = LeaseAgreement;
232
+ module.exports = LeaseAgreement;
@@ -119,7 +119,7 @@ const waterMeterSchema = new mongoose.Schema({
119
119
  },
120
120
  bulkMeterDescription: {
121
121
  type: String,
122
- enum: ['City Council Bulk', 'Borehole Bulk', 'Bulk Inlet', 'Bulk Outlet','Bulk Borehole Outlet'],
122
+ enum: ['City Council Bulk', 'Borehole Bulk', 'Bulk Inlet', 'Bulk Outlet','Bulk Borehole Outlet', 'Common Area'],
123
123
  trim: true
124
124
  }
125
125