payservedb 4.9.3 → 4.9.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/.env +2 -2
- package/index.js +171 -171
- package/package.json +17 -17
- package/src/models/account.js +35 -35
- package/src/models/analog_water_billing.js +58 -58
- package/src/models/apilog.js +18 -18
- package/src/models/approvalsWorkflows.js +49 -49
- package/src/models/archivedapilog.js +18 -18
- package/src/models/archivedauditlog.js +83 -83
- package/src/models/asset.js +34 -34
- package/src/models/auditlog.js +83 -83
- package/src/models/bankdetails.js +40 -40
- package/src/models/bookinganalytics.js +63 -63
- package/src/models/bookingconfig.js +45 -45
- package/src/models/bookingproperty.js +112 -112
- package/src/models/bookingreservation.js +192 -192
- package/src/models/bookingrevenuerecord.js +84 -84
- package/src/models/budget.js +33 -33
- package/src/models/budgetCategory.js +19 -19
- package/src/models/campaigns.js +72 -72
- package/src/models/cashpayment.js +262 -262
- package/src/models/combinedUnits.js +62 -62
- package/src/models/common_area_electricity.js +38 -38
- package/src/models/common_area_generator.js +38 -38
- package/src/models/common_area_utility_alert.js +37 -37
- package/src/models/common_area_water.js +39 -39
- package/src/models/company.js +53 -53
- package/src/models/country_tax.js +42 -42
- package/src/models/currency_settings.js +39 -39
- package/src/models/customer.js +200 -200
- package/src/models/default_payment_details.js +17 -17
- package/src/models/dutyroster.js +129 -129
- package/src/models/email.js +24 -24
- package/src/models/entry_exit.js +53 -53
- package/src/models/expense.js +55 -55
- package/src/models/facility.js +61 -61
- package/src/models/facility_payment_details.js +20 -20
- package/src/models/facilityasset.js +25 -25
- package/src/models/faq.js +18 -18
- package/src/models/gl_accounts.js +56 -56
- package/src/models/gl_entries.js +50 -54
- package/src/models/guard.js +47 -47
- package/src/models/handover.js +241 -241
- package/src/models/invoice.js +291 -291
- package/src/models/item_inspection.js +67 -67
- package/src/models/leaseagreement.js +168 -168
- package/src/models/leasetemplate.js +17 -17
- package/src/models/levy.js +84 -84
- package/src/models/levy_invoice_settings.js +26 -26
- package/src/models/levycontract.js +77 -77
- package/src/models/levytype.js +23 -23
- package/src/models/maintenance_service_vendor.js +38 -38
- package/src/models/maintenance_services.js +17 -17
- package/src/models/maintenancerequisition.js +31 -31
- package/src/models/message.js +38 -38
- package/src/models/module.js +21 -21
- package/src/models/notification.js +24 -24
- package/src/models/penalty.js +76 -76
- package/src/models/purchase_order.js +190 -190
- package/src/models/purchase_request.js +65 -65
- package/src/models/refresh_token.js +23 -23
- package/src/models/reminder.js +161 -161
- package/src/models/report.js +13 -13
- package/src/models/resident.js +121 -121
- package/src/models/rfq_details.js +87 -87
- package/src/models/rfq_response.js +109 -109
- package/src/models/service_charge_invoice_upload.js +42 -42
- package/src/models/service_charge_payments.js +27 -27
- package/src/models/servicerequest.js +55 -55
- package/src/models/settings.js +62 -62
- package/src/models/smart_meter_daily_consumption.js +44 -44
- package/src/models/sms_africastalking.js +20 -20
- package/src/models/sms_meliora.js +16 -16
- package/src/models/staff.js +36 -36
- package/src/models/stocksandspare.js +34 -34
- package/src/models/suppliers.js +68 -68
- package/src/models/tickets.js +109 -109
- package/src/models/unitasset.js +25 -25
- package/src/models/units.js +86 -86
- package/src/models/user.js +183 -183
- package/src/models/valueaddedservices.js +36 -36
- package/src/models/vas_invoices_upload.js +50 -50
- package/src/models/vas_payments.js +24 -24
- package/src/models/vasinvoice.js +159 -159
- package/src/models/vasvendor.js +57 -57
- package/src/models/visitLog.js +86 -86
- package/src/models/visitor.js +63 -63
- package/src/models/waitlist.js +45 -45
- package/src/models/water_invoice.js +192 -192
- package/src/models/water_meter_account.js +74 -74
- package/src/models/water_meter_communication.js +17 -17
- package/src/models/water_meter_concentrator.js +59 -59
- package/src/models/water_meter_daily_history.js +31 -31
- package/src/models/water_meter_iot_cards.js +34 -34
- package/src/models/water_meter_manufacturer.js +35 -35
- package/src/models/water_meter_monthly_history.js +37 -37
- package/src/models/water_meter_settings.js +88 -88
- package/src/models/water_meter_single_day_history.js +31 -31
- package/src/models/water_meter_size.js +15 -15
- package/src/models/water_meters.js +103 -103
- package/src/models/water_meters_delivery.js +76 -76
- package/src/models/workorder.js +49 -49
package/src/models/dutyroster.js
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const dutyRosterSchema = new mongoose.Schema({
|
|
4
|
-
facilityId: {
|
|
5
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
ref: 'Facility',
|
|
7
|
-
required: true,
|
|
8
|
-
},
|
|
9
|
-
staffDetails: {
|
|
10
|
-
name: {
|
|
11
|
-
type: String,
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
phone: {
|
|
15
|
-
type: String,
|
|
16
|
-
required: true,
|
|
17
|
-
},
|
|
18
|
-
role: {
|
|
19
|
-
type: String,
|
|
20
|
-
required: true,
|
|
21
|
-
// Examples: 'Site Manager', 'GRE', 'Site support staff', 'Plumber', etc.
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
// Regular weekly schedule
|
|
26
|
-
weeklySchedule: {
|
|
27
|
-
monday: {
|
|
28
|
-
startTime: String,
|
|
29
|
-
endTime: String,
|
|
30
|
-
status: {
|
|
31
|
-
type: String,
|
|
32
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
33
|
-
default: 'ON'
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
tuesday: {
|
|
37
|
-
startTime: String,
|
|
38
|
-
endTime: String,
|
|
39
|
-
status: {
|
|
40
|
-
type: String,
|
|
41
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
42
|
-
default: 'ON'
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
wednesday: {
|
|
46
|
-
startTime: String,
|
|
47
|
-
endTime: String,
|
|
48
|
-
status: {
|
|
49
|
-
type: String,
|
|
50
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
51
|
-
default: 'ON'
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
thursday: {
|
|
55
|
-
startTime: String,
|
|
56
|
-
endTime: String,
|
|
57
|
-
status: {
|
|
58
|
-
type: String,
|
|
59
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
60
|
-
default: 'ON'
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
friday: {
|
|
64
|
-
startTime: String,
|
|
65
|
-
endTime: String,
|
|
66
|
-
status: {
|
|
67
|
-
type: String,
|
|
68
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
69
|
-
default: 'ON'
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
saturday: {
|
|
73
|
-
startTime: String,
|
|
74
|
-
endTime: String,
|
|
75
|
-
status: {
|
|
76
|
-
type: String,
|
|
77
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
78
|
-
default: 'ON'
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
sunday: {
|
|
82
|
-
startTime: String,
|
|
83
|
-
endTime: String,
|
|
84
|
-
status: {
|
|
85
|
-
type: String,
|
|
86
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
87
|
-
default: 'ON'
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
// For exceptions to the regular schedule
|
|
93
|
-
exceptions: [{
|
|
94
|
-
date: {
|
|
95
|
-
type: Date,
|
|
96
|
-
required: true
|
|
97
|
-
},
|
|
98
|
-
startTime: String,
|
|
99
|
-
endTime: String,
|
|
100
|
-
status: {
|
|
101
|
-
type: String,
|
|
102
|
-
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
103
|
-
required: true
|
|
104
|
-
},
|
|
105
|
-
reason: String
|
|
106
|
-
}],
|
|
107
|
-
|
|
108
|
-
// Metadata
|
|
109
|
-
metadata: {
|
|
110
|
-
period: {
|
|
111
|
-
startDate: Date,
|
|
112
|
-
endDate: Date
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
timestamps: true
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// Status code definitions
|
|
120
|
-
dutyRosterSchema.statics.STATUS_CODES = {
|
|
121
|
-
ON: 'On Duty',
|
|
122
|
-
OFF: 'Off Duty',
|
|
123
|
-
AL: 'Annual Leave',
|
|
124
|
-
CL: 'Casual Leave',
|
|
125
|
-
'ML/PL': 'Medical/Paternity Leave',
|
|
126
|
-
PH: 'Public Holiday',
|
|
127
|
-
UI: 'Unplanned Issues'
|
|
128
|
-
};
|
|
129
|
-
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const dutyRosterSchema = new mongoose.Schema({
|
|
4
|
+
facilityId: {
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
ref: 'Facility',
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
staffDetails: {
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
phone: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
role: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
// Examples: 'Site Manager', 'GRE', 'Site support staff', 'Plumber', etc.
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
// Regular weekly schedule
|
|
26
|
+
weeklySchedule: {
|
|
27
|
+
monday: {
|
|
28
|
+
startTime: String,
|
|
29
|
+
endTime: String,
|
|
30
|
+
status: {
|
|
31
|
+
type: String,
|
|
32
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
33
|
+
default: 'ON'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
tuesday: {
|
|
37
|
+
startTime: String,
|
|
38
|
+
endTime: String,
|
|
39
|
+
status: {
|
|
40
|
+
type: String,
|
|
41
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
42
|
+
default: 'ON'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
wednesday: {
|
|
46
|
+
startTime: String,
|
|
47
|
+
endTime: String,
|
|
48
|
+
status: {
|
|
49
|
+
type: String,
|
|
50
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
51
|
+
default: 'ON'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
thursday: {
|
|
55
|
+
startTime: String,
|
|
56
|
+
endTime: String,
|
|
57
|
+
status: {
|
|
58
|
+
type: String,
|
|
59
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
60
|
+
default: 'ON'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
friday: {
|
|
64
|
+
startTime: String,
|
|
65
|
+
endTime: String,
|
|
66
|
+
status: {
|
|
67
|
+
type: String,
|
|
68
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
69
|
+
default: 'ON'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
saturday: {
|
|
73
|
+
startTime: String,
|
|
74
|
+
endTime: String,
|
|
75
|
+
status: {
|
|
76
|
+
type: String,
|
|
77
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
78
|
+
default: 'ON'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
sunday: {
|
|
82
|
+
startTime: String,
|
|
83
|
+
endTime: String,
|
|
84
|
+
status: {
|
|
85
|
+
type: String,
|
|
86
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
87
|
+
default: 'ON'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// For exceptions to the regular schedule
|
|
93
|
+
exceptions: [{
|
|
94
|
+
date: {
|
|
95
|
+
type: Date,
|
|
96
|
+
required: true
|
|
97
|
+
},
|
|
98
|
+
startTime: String,
|
|
99
|
+
endTime: String,
|
|
100
|
+
status: {
|
|
101
|
+
type: String,
|
|
102
|
+
enum: ['ON', 'OFF', 'AL', 'CL', 'ML/PL', 'PH', 'UI'],
|
|
103
|
+
required: true
|
|
104
|
+
},
|
|
105
|
+
reason: String
|
|
106
|
+
}],
|
|
107
|
+
|
|
108
|
+
// Metadata
|
|
109
|
+
metadata: {
|
|
110
|
+
period: {
|
|
111
|
+
startDate: Date,
|
|
112
|
+
endDate: Date
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
timestamps: true
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Status code definitions
|
|
120
|
+
dutyRosterSchema.statics.STATUS_CODES = {
|
|
121
|
+
ON: 'On Duty',
|
|
122
|
+
OFF: 'Off Duty',
|
|
123
|
+
AL: 'Annual Leave',
|
|
124
|
+
CL: 'Casual Leave',
|
|
125
|
+
'ML/PL': 'Medical/Paternity Leave',
|
|
126
|
+
PH: 'Public Holiday',
|
|
127
|
+
UI: 'Unplanned Issues'
|
|
128
|
+
};
|
|
129
|
+
|
|
130
130
|
module.exports = mongoose.model('DutyRoster', dutyRosterSchema);
|
package/src/models/email.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const EmailSchema = mongoose.Schema({
|
|
3
|
-
user: {
|
|
4
|
-
type: String,
|
|
5
|
-
required: true
|
|
6
|
-
},
|
|
7
|
-
from: {
|
|
8
|
-
type: String,
|
|
9
|
-
required: true
|
|
10
|
-
},
|
|
11
|
-
host: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
port: {
|
|
16
|
-
type: Number,
|
|
17
|
-
required: true
|
|
18
|
-
},
|
|
19
|
-
auth: {
|
|
20
|
-
user: String,
|
|
21
|
-
pass: String
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
const Email = mongoose.model('Email', EmailSchema);
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const EmailSchema = mongoose.Schema({
|
|
3
|
+
user: {
|
|
4
|
+
type: String,
|
|
5
|
+
required: true
|
|
6
|
+
},
|
|
7
|
+
from: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
host: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
port: {
|
|
16
|
+
type: Number,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
auth: {
|
|
20
|
+
user: String,
|
|
21
|
+
pass: String
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
const Email = mongoose.model('Email', EmailSchema);
|
|
25
25
|
module.exports = Email
|
package/src/models/entry_exit.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const EntryExitSchema = mongoose.Schema({
|
|
4
|
-
name: {
|
|
5
|
-
type: String,
|
|
6
|
-
required: true
|
|
7
|
-
},
|
|
8
|
-
location: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true,
|
|
11
|
-
},
|
|
12
|
-
gps: {
|
|
13
|
-
type: {
|
|
14
|
-
type: String,
|
|
15
|
-
enum: ['Point'],
|
|
16
|
-
required: true
|
|
17
|
-
},
|
|
18
|
-
coordinates: {
|
|
19
|
-
type: [Number], // [longitude, latitude] format
|
|
20
|
-
required: true,
|
|
21
|
-
validate: {
|
|
22
|
-
validator: function (value) {
|
|
23
|
-
return value.length === 2;
|
|
24
|
-
},
|
|
25
|
-
message: 'Coordinates must have longitude and latitude'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
range: {
|
|
30
|
-
type: Number,
|
|
31
|
-
required: true
|
|
32
|
-
},
|
|
33
|
-
disabled: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
required: true
|
|
36
|
-
},
|
|
37
|
-
purpose: {
|
|
38
|
-
type: String,
|
|
39
|
-
required: true,
|
|
40
|
-
enum: ['entry/exit', 'entry', 'exit', 'emergency exit']
|
|
41
|
-
},
|
|
42
|
-
facilityId: {
|
|
43
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
44
|
-
ref: 'Facility',
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Create a 2dsphere index on the gps field to support geospatial queries
|
|
49
|
-
EntryExitSchema.index({ gps: '2dsphere' });
|
|
50
|
-
|
|
51
|
-
const EntryExit = mongoose.model('EntryExit', EntryExitSchema);
|
|
52
|
-
|
|
53
|
-
module.exports = EntryExit;
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const EntryExitSchema = mongoose.Schema({
|
|
4
|
+
name: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
location: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
gps: {
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
enum: ['Point'],
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
coordinates: {
|
|
19
|
+
type: [Number], // [longitude, latitude] format
|
|
20
|
+
required: true,
|
|
21
|
+
validate: {
|
|
22
|
+
validator: function (value) {
|
|
23
|
+
return value.length === 2;
|
|
24
|
+
},
|
|
25
|
+
message: 'Coordinates must have longitude and latitude'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
range: {
|
|
30
|
+
type: Number,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
purpose: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true,
|
|
40
|
+
enum: ['entry/exit', 'entry', 'exit', 'emergency exit']
|
|
41
|
+
},
|
|
42
|
+
facilityId: {
|
|
43
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
44
|
+
ref: 'Facility',
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Create a 2dsphere index on the gps field to support geospatial queries
|
|
49
|
+
EntryExitSchema.index({ gps: '2dsphere' });
|
|
50
|
+
|
|
51
|
+
const EntryExit = mongoose.model('EntryExit', EntryExitSchema);
|
|
52
|
+
|
|
53
|
+
module.exports = EntryExit;
|
package/src/models/expense.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const expenseSchema = new mongoose.Schema({
|
|
4
|
-
facilityId: {
|
|
5
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
ref: 'Facility',
|
|
7
|
-
required: true
|
|
8
|
-
},
|
|
9
|
-
categoryId: {
|
|
10
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
-
ref: 'BudgetCategory',
|
|
12
|
-
required: true
|
|
13
|
-
},
|
|
14
|
-
name: {
|
|
15
|
-
type: String,
|
|
16
|
-
required: true,
|
|
17
|
-
trim: true
|
|
18
|
-
},
|
|
19
|
-
amount: {
|
|
20
|
-
type: Number,
|
|
21
|
-
required: true
|
|
22
|
-
},
|
|
23
|
-
type: {
|
|
24
|
-
type: String,
|
|
25
|
-
enum: ['RECURRING', 'ONE_TIME'],
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
date: {
|
|
29
|
-
type: Date,
|
|
30
|
-
required: true,
|
|
31
|
-
default: Date.now
|
|
32
|
-
},
|
|
33
|
-
status: {
|
|
34
|
-
type: String,
|
|
35
|
-
enum: ['PAID', 'UNPAID'],
|
|
36
|
-
default: 'UNPAID'
|
|
37
|
-
},
|
|
38
|
-
approval: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
description: {
|
|
43
|
-
type: String,
|
|
44
|
-
trim: true
|
|
45
|
-
},
|
|
46
|
-
receiptUrl: {
|
|
47
|
-
type: String,
|
|
48
|
-
trim: true
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
timestamps: true
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const Expense = mongoose.model('Expense', expenseSchema);
|
|
55
|
-
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const expenseSchema = new mongoose.Schema({
|
|
4
|
+
facilityId: {
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
ref: 'Facility',
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
categoryId: {
|
|
10
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
+
ref: 'BudgetCategory',
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
name: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
trim: true
|
|
18
|
+
},
|
|
19
|
+
amount: {
|
|
20
|
+
type: Number,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
type: String,
|
|
25
|
+
enum: ['RECURRING', 'ONE_TIME'],
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
date: {
|
|
29
|
+
type: Date,
|
|
30
|
+
required: true,
|
|
31
|
+
default: Date.now
|
|
32
|
+
},
|
|
33
|
+
status: {
|
|
34
|
+
type: String,
|
|
35
|
+
enum: ['PAID', 'UNPAID'],
|
|
36
|
+
default: 'UNPAID'
|
|
37
|
+
},
|
|
38
|
+
approval: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
description: {
|
|
43
|
+
type: String,
|
|
44
|
+
trim: true
|
|
45
|
+
},
|
|
46
|
+
receiptUrl: {
|
|
47
|
+
type: String,
|
|
48
|
+
trim: true
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
timestamps: true
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const Expense = mongoose.model('Expense', expenseSchema);
|
|
55
|
+
|
|
56
56
|
module.exports = Expense;
|
package/src/models/facility.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
|
|
3
|
-
// Define the schema for facilities
|
|
4
|
-
const facilitySchema = new mongoose.Schema({
|
|
5
|
-
name: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: [true, 'Facility name is required'],
|
|
8
|
-
trim: true,
|
|
9
|
-
minlength: [1, 'Facility name must be at least 1 character long']
|
|
10
|
-
},
|
|
11
|
-
location: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
subDivision: { type: String, required: true },
|
|
16
|
-
isEnabled: { type: Boolean, required: true },
|
|
17
|
-
divisionArray: [],
|
|
18
|
-
landReferenceNumbers: [],
|
|
19
|
-
defaultMeasurement: { type: String, required: false },
|
|
20
|
-
totalCommonArea: { type: String, required: false },
|
|
21
|
-
totalLettableArea: { type: String, required: false },
|
|
22
|
-
modules: {
|
|
23
|
-
visitor: { type: Boolean, },
|
|
24
|
-
levy: { type: Boolean, },
|
|
25
|
-
maintenance: { type: Boolean, },
|
|
26
|
-
lease: { type: Boolean, },
|
|
27
|
-
vas: { type: Boolean, },
|
|
28
|
-
tickets: { type: Boolean, },
|
|
29
|
-
utility: { type: Boolean, },
|
|
30
|
-
booking: { type: Boolean, },
|
|
31
|
-
handover: { type: Boolean, },
|
|
32
|
-
expense: { type: Boolean, },
|
|
33
|
-
campaign: { type: Boolean, },
|
|
34
|
-
procurement: { type: Boolean, },
|
|
35
|
-
accounts: { type: Boolean, },
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
logo: {
|
|
39
|
-
type: String,
|
|
40
|
-
trim: false,
|
|
41
|
-
default: null
|
|
42
|
-
},
|
|
43
|
-
dbName: {
|
|
44
|
-
type: String,
|
|
45
|
-
required: [true, 'Database name is required'],
|
|
46
|
-
unique: true,
|
|
47
|
-
trim: true
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}, {
|
|
51
|
-
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// Indexes for improved performance
|
|
55
|
-
facilitySchema.index({ name: 1 });
|
|
56
|
-
facilitySchema.index({ dbName: 1 });
|
|
57
|
-
|
|
58
|
-
// Compile the model from the schema
|
|
59
|
-
const Facility = mongoose.model('Facility', facilitySchema);
|
|
60
|
-
|
|
61
|
-
module.exports = Facility;
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
// Define the schema for facilities
|
|
4
|
+
const facilitySchema = new mongoose.Schema({
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: [true, 'Facility name is required'],
|
|
8
|
+
trim: true,
|
|
9
|
+
minlength: [1, 'Facility name must be at least 1 character long']
|
|
10
|
+
},
|
|
11
|
+
location: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
subDivision: { type: String, required: true },
|
|
16
|
+
isEnabled: { type: Boolean, required: true },
|
|
17
|
+
divisionArray: [],
|
|
18
|
+
landReferenceNumbers: [],
|
|
19
|
+
defaultMeasurement: { type: String, required: false },
|
|
20
|
+
totalCommonArea: { type: String, required: false },
|
|
21
|
+
totalLettableArea: { type: String, required: false },
|
|
22
|
+
modules: {
|
|
23
|
+
visitor: { type: Boolean, },
|
|
24
|
+
levy: { type: Boolean, },
|
|
25
|
+
maintenance: { type: Boolean, },
|
|
26
|
+
lease: { type: Boolean, },
|
|
27
|
+
vas: { type: Boolean, },
|
|
28
|
+
tickets: { type: Boolean, },
|
|
29
|
+
utility: { type: Boolean, },
|
|
30
|
+
booking: { type: Boolean, },
|
|
31
|
+
handover: { type: Boolean, },
|
|
32
|
+
expense: { type: Boolean, },
|
|
33
|
+
campaign: { type: Boolean, },
|
|
34
|
+
procurement: { type: Boolean, },
|
|
35
|
+
accounts: { type: Boolean, },
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
logo: {
|
|
39
|
+
type: String,
|
|
40
|
+
trim: false,
|
|
41
|
+
default: null
|
|
42
|
+
},
|
|
43
|
+
dbName: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: [true, 'Database name is required'],
|
|
46
|
+
unique: true,
|
|
47
|
+
trim: true
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}, {
|
|
51
|
+
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Indexes for improved performance
|
|
55
|
+
facilitySchema.index({ name: 1 });
|
|
56
|
+
facilitySchema.index({ dbName: 1 });
|
|
57
|
+
|
|
58
|
+
// Compile the model from the schema
|
|
59
|
+
const Facility = mongoose.model('Facility', facilitySchema);
|
|
60
|
+
|
|
61
|
+
module.exports = Facility;
|