payservedb 3.7.8 → 3.8.0

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.7.8",
3
+ "version": "3.8.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -8,7 +8,7 @@ const defaultPaymentDetailsSchema = new mongoose.Schema({
8
8
  },
9
9
  module: {
10
10
  type: String,
11
- enum: ["All", "Water", "Electricity", "Levy"],
11
+ enum: ["All", "Water", "Electricity", "Levy","Lease"],
12
12
  default: "All"
13
13
  },
14
14
  });
@@ -6,6 +6,11 @@ const leaseAgreementSchema = new mongoose.Schema({
6
6
  ref: 'Facility',
7
7
  required: true
8
8
  },
9
+ currency: {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'Currency',
12
+ required: true
13
+ },
9
14
  unitNumber: {
10
15
  type: mongoose.Schema.Types.ObjectId,
11
16
  ref: 'Unit',
@@ -137,6 +142,9 @@ const leaseAgreementSchema = new mongoose.Schema({
137
142
  timestamps: true
138
143
  });
139
144
 
145
+ // Add index for multi-tenancy queries
146
+ leaseAgreementSchema.index({ facilityId: 1 });
147
+
140
148
  const LeaseAgreement = mongoose.model('LeaseAgreement', leaseAgreementSchema);
141
149
 
142
- module.exports = LeaseAgreement;
150
+ module.exports = LeaseAgreement;