payservedb 2.6.2 → 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/index.js +2 -1
- package/package.json +1 -1
- package/src/models/leaseagreement.js +93 -0
package/index.js
CHANGED
|
@@ -86,7 +86,8 @@ const models = {
|
|
|
86
86
|
Stocksandspare:require('./src/models/stocksandspare'),
|
|
87
87
|
ServiceVendor:require('./src/models/servicevendor'),
|
|
88
88
|
MaintenanceService:require('./src/models/maintenanceservice'),
|
|
89
|
-
Requisition:require('./src/models/maintenancerequisition')
|
|
89
|
+
Requisition:require('./src/models/maintenancerequisition'),
|
|
90
|
+
LeaseAgreement:require('./src/models/leaseagreement')
|
|
90
91
|
|
|
91
92
|
};
|
|
92
93
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
// Define the schema for Lease Agreements
|
|
4
|
+
const leaseAgreementSchema = new mongoose.Schema({
|
|
5
|
+
facilityId: {
|
|
6
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
+
ref: 'Facility',
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
propertyType: {
|
|
11
|
+
type: String,
|
|
12
|
+
enum: ['Residential', 'Commercial'],
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
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
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const LeaseAgreement = mongoose.model('LeaseAgreement', leaseAgreementSchema);
|
|
92
|
+
|
|
93
|
+
module.exports = LeaseAgreement;
|