payservedb 2.6.3 → 2.6.4

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": "2.6.3",
3
+ "version": "2.6.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,71 +1,91 @@
1
1
  const mongoose = require('mongoose');
2
2
 
3
+ // Define the schema for Lease Agreements
3
4
  const leaseAgreementSchema = new mongoose.Schema({
4
- landlord: {
5
- type: mongoose.Schema.Types.ObjectId,
6
- ref: 'User',
7
- required: true,
8
- },
9
- tenant: {
10
- type: mongoose.Schema.Types.ObjectId,
11
- ref: 'Customer',
12
- required: true,
13
- },
14
- premises: {
15
- type: mongoose.Schema.Types.ObjectId,
16
- ref: 'Facility',
17
- required: true,
18
- },
19
- term: {
20
- commencementDate: { type: Date, required: true },
21
- expirationDate: { type: Date, required: true },
22
- duration: { type: Number, required: true },
23
- },
24
- rent: {
25
- monthlyAmount: { type: Number, required: true },
26
- dueDate: { type: Number, required: true },
27
- paymentMethod: {
28
- type: String,
29
- enum: ['Bank Transfer', 'Mobile Money', 'Cheque', 'Cash'],
30
- required: true,
5
+ facilityId: {
6
+ type: mongoose.Schema.Types.ObjectId,
7
+ ref: 'Facility',
8
+ required: true
31
9
  },
32
- bankDetails: {
33
- accountName: { type: String },
34
- bankName: { type: String },
35
- accountNumber: { type: String },
36
- branch: { type: String },
10
+ propertyType: {
11
+ type: String,
12
+ enum: ['Residential', 'Commercial'],
13
+ required: true
37
14
  },
38
- },
39
- securityDeposit: {
40
- amount: { type: Number, required: true },
41
- equivalentMonths: { type: Number, required: true },
42
- interest: { type: Boolean, default: false },
43
- },
44
- maintenance: {
45
- tenantResponsibilities: { type: String },
46
- landlordResponsibilities: { type: String },
47
- repairLimits: { type: Number },
48
- },
49
- utilities: {
50
- electricity: { type: String, enum: ['Tenant', 'Landlord'], required: true },
51
- water: { type: String, enum: ['Tenant', 'Landlord'], required: true },
52
- gas: { type: String, enum: ['Tenant', 'Landlord'] },
53
- internet: { type: String, enum: ['Tenant', 'Landlord'] },
54
- garbageCollection: { type: String, enum: ['Tenant', 'Landlord'] },
55
- },
56
- additionalTerms: {
57
- insurance: { type: String },
58
- governingLaw: { type: String },
59
- terminationConditions: { type: String },
60
- disputeResolution: { type: String },
61
- },
62
- schedules: {
63
- scheduleA: { type: String },
64
- scheduleB: { type: String },
65
- scheduleC: { type: String },
66
- },
67
- createdAt: { type: Date, default: Date.now },
68
- updatedAt: { type: Date, default: Date.now },
15
+ propertyAddress: {
16
+ type: String,
17
+ required: true
18
+ },
19
+ unitNumber: {
20
+ type: String
21
+ },
22
+ landReferenceNumber: {
23
+ type: String
24
+ },
25
+
26
+ // Parties Information
27
+ landlord: {
28
+ name: { type: String, required: true },
29
+ identificationNumber: { type: String },
30
+ address: { type: String },
31
+ contactPhone: { type: String },
32
+ contactEmail: { type: String }
33
+ },
34
+ tenant: {
35
+ name: { type: String, required: true },
36
+ identificationNumber: { type: String },
37
+ address: { type: String },
38
+ contactPhone: { type: String },
39
+ contactEmail: { type: String }
40
+ },
41
+
42
+ // Lease Terms
43
+ leaseTerms: {
44
+ startDate: { type: Date, required: true },
45
+ endDate: { type: Date, required: true },
46
+ duration: { type: Number, required: true }, // in months
47
+ autoRenewal: { type: Boolean, default: false }
48
+ },
49
+
50
+ financialTerms: {
51
+ monthlyRent: { type: Number, required: true },
52
+ paymentDueDate: { type: Number, required: true }, // Day of month
53
+ paymentMethod: {
54
+ type: String,
55
+ enum: ['Bank Transfer', 'Mobile Money', 'Cheque', 'Cash']
56
+ },
57
+ securityDeposit: { type: Number, required: true },
58
+ annualRentEscalation: { type: Number, default: 0 }
59
+ },
60
+
61
+ serviceCharge: {
62
+ amount: { type: Number },
63
+ description: { type: String }
64
+ },
65
+
66
+ maintenanceTerms: {
67
+ tenantResponsibilities: [String],
68
+ landlordResponsibilities: [String]
69
+ },
70
+
71
+ utilities: {
72
+ electricity: { type: String, enum: ['Tenant', 'Landlord'] },
73
+ water: { type: String, enum: ['Tenant', 'Landlord'] },
74
+ gas: { type: String, enum: ['Tenant', 'Landlord'] },
75
+ internet: { type: String, enum: ['Tenant', 'Landlord'] }
76
+ },
77
+
78
+ status: {
79
+ type: String,
80
+ enum: ['Active', 'Pending', 'Expired', 'Terminated'],
81
+ default: 'Pending'
82
+ },
83
+ createdBy: {
84
+ type: mongoose.Schema.Types.ObjectId,
85
+ ref: 'User'
86
+ }
87
+ }, {
88
+ timestamps: true
69
89
  });
70
90
 
71
91
  const LeaseAgreement = mongoose.model('LeaseAgreement', leaseAgreementSchema);