payservedb 2.6.3 → 2.6.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/index.js +2 -1
- package/package.json +1 -1
- package/src/models/leaseagreement.js +83 -63
- package/src/models/workorder.js +30 -0
package/index.js
CHANGED
|
@@ -87,7 +87,8 @@ const models = {
|
|
|
87
87
|
ServiceVendor:require('./src/models/servicevendor'),
|
|
88
88
|
MaintenanceService:require('./src/models/maintenanceservice'),
|
|
89
89
|
Requisition:require('./src/models/maintenancerequisition'),
|
|
90
|
-
LeaseAgreement:require('./src/models/leaseagreement')
|
|
90
|
+
LeaseAgreement:require('./src/models/leaseagreement'),
|
|
91
|
+
WorkOrder:require('./src/models/workorder'),
|
|
91
92
|
|
|
92
93
|
};
|
|
93
94
|
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
branch: { type: String },
|
|
10
|
+
propertyType: {
|
|
11
|
+
type: String,
|
|
12
|
+
enum: ['Residential', 'Commercial'],
|
|
13
|
+
required: true
|
|
37
14
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const workOrderSchema = new mongoose.Schema({
|
|
4
|
+
workDescription: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
trim: true,
|
|
8
|
+
},
|
|
9
|
+
assignedTo: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
trim: true,
|
|
13
|
+
},
|
|
14
|
+
status: {
|
|
15
|
+
type: String,
|
|
16
|
+
enum: ['in progress', 'completed', 'suspended', 'pending' , 'cancelled'],
|
|
17
|
+
default: 'pending',
|
|
18
|
+
},
|
|
19
|
+
payment: {
|
|
20
|
+
type: Number,
|
|
21
|
+
required: true,
|
|
22
|
+
min: 0,
|
|
23
|
+
},
|
|
24
|
+
}, {
|
|
25
|
+
timestamps: true,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const WorkOrder = mongoose.model('WorkOrder', workOrderSchema);
|
|
29
|
+
|
|
30
|
+
module.exports = WorkOrder;
|