payservedb 2.6.1 → 2.6.3
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/lease.js +71 -26
- package/src/models/leaseagreement.js +73 -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
package/src/models/lease.js
CHANGED
|
@@ -1,32 +1,77 @@
|
|
|
1
1
|
const mongoose = require("mongoose");
|
|
2
2
|
|
|
3
3
|
const LeaseSchema = new mongoose.Schema({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
facilityId: {
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
ref: 'Facility',
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
customerId: {
|
|
10
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
+
ref: 'Customer',
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
propertyManagerId: {
|
|
15
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
16
|
+
ref: 'User',
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
startDate: {
|
|
20
|
+
type: Date,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
endDate: {
|
|
24
|
+
type: Date,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
rentValue: {
|
|
28
|
+
type: Number,
|
|
29
|
+
required: true,
|
|
30
|
+
min: 0
|
|
13
31
|
},
|
|
14
32
|
levies: [{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
34
|
+
ref: 'Levy'
|
|
35
|
+
}],
|
|
36
|
+
securityDeposit: {
|
|
37
|
+
type: Number
|
|
38
|
+
},
|
|
39
|
+
responsibilities: {
|
|
40
|
+
type: String
|
|
41
|
+
},
|
|
18
42
|
penalties: [{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
44
|
+
ref: 'Penalty'
|
|
45
|
+
}],
|
|
46
|
+
paymentFrequency: {
|
|
47
|
+
type: String,
|
|
48
|
+
enum: ['monthly', 'quarterly', 'annually'],
|
|
49
|
+
required: true
|
|
50
|
+
},
|
|
51
|
+
status: {
|
|
52
|
+
type: String,
|
|
53
|
+
enum: ['active', 'expired', 'terminated', 'draft'],
|
|
54
|
+
required: true
|
|
55
|
+
},
|
|
56
|
+
templateId: {
|
|
57
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
58
|
+
ref: 'LeaseTemplate',
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
61
|
+
signedCopy: {
|
|
62
|
+
type: String
|
|
63
|
+
},
|
|
64
|
+
unsignedCopyUrl: {
|
|
65
|
+
type: String,
|
|
66
|
+
match: /^https?:\/\/.*/,
|
|
67
|
+
required: false
|
|
68
|
+
},
|
|
69
|
+
createdAt: {
|
|
70
|
+
type: Date,
|
|
71
|
+
default: Date.now
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const Lease = mongoose.model('Lease', LeaseSchema);
|
|
76
|
+
|
|
77
|
+
module.exports = Lease;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
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,
|
|
31
|
+
},
|
|
32
|
+
bankDetails: {
|
|
33
|
+
accountName: { type: String },
|
|
34
|
+
bankName: { type: String },
|
|
35
|
+
accountNumber: { type: String },
|
|
36
|
+
branch: { type: String },
|
|
37
|
+
},
|
|
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 },
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const LeaseAgreement = mongoose.model('LeaseAgreement', leaseAgreementSchema);
|
|
72
|
+
|
|
73
|
+
module.exports = LeaseAgreement;
|