payservedb 4.4.9 → 4.5.1

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.
Files changed (82) hide show
  1. package/.env +2 -2
  2. package/index.js +152 -152
  3. package/package.json +17 -17
  4. package/src/models/account.js +36 -36
  5. package/src/models/analog_water_billing.js +58 -58
  6. package/src/models/apilog.js +18 -18
  7. package/src/models/archivedapilog.js +18 -18
  8. package/src/models/archivedauditlog.js +83 -83
  9. package/src/models/asset.js +34 -34
  10. package/src/models/auditlog.js +83 -83
  11. package/src/models/bankdetails.js +40 -40
  12. package/src/models/budget.js +33 -33
  13. package/src/models/budgetCategory.js +19 -19
  14. package/src/models/campaigns.js +72 -72
  15. package/src/models/cashpayment.js +262 -262
  16. package/src/models/combinedUnits.js +62 -62
  17. package/src/models/company.js +53 -53
  18. package/src/models/country_tax.js +42 -42
  19. package/src/models/currency_settings.js +39 -39
  20. package/src/models/customer.js +194 -178
  21. package/src/models/default_payment_details.js +17 -17
  22. package/src/models/dutyroster.js +39 -39
  23. package/src/models/email.js +24 -24
  24. package/src/models/entry_exit.js +53 -53
  25. package/src/models/expense.js +55 -55
  26. package/src/models/facility.js +60 -60
  27. package/src/models/facility_payment_details.js +20 -20
  28. package/src/models/facilityasset.js +25 -25
  29. package/src/models/faq.js +18 -18
  30. package/src/models/guard.js +47 -47
  31. package/src/models/handover.js +241 -241
  32. package/src/models/invoice.js +251 -251
  33. package/src/models/item_inspection.js +67 -67
  34. package/src/models/leaseagreement.js +168 -156
  35. package/src/models/leasetemplate.js +17 -17
  36. package/src/models/levy.js +72 -72
  37. package/src/models/levy_invoice_settings.js +26 -26
  38. package/src/models/levycontract.js +65 -65
  39. package/src/models/levytype.js +23 -23
  40. package/src/models/maintenance_service_vendor.js +38 -38
  41. package/src/models/maintenance_services.js +17 -17
  42. package/src/models/maintenancerequisition.js +31 -31
  43. package/src/models/message.js +38 -38
  44. package/src/models/module.js +21 -21
  45. package/src/models/notification.js +24 -24
  46. package/src/models/penalty.js +76 -76
  47. package/src/models/refresh_token.js +23 -23
  48. package/src/models/reminder.js +161 -161
  49. package/src/models/report.js +13 -13
  50. package/src/models/resident.js +121 -121
  51. package/src/models/service_charge_invoice_upload.js +42 -42
  52. package/src/models/service_charge_payments.js +27 -27
  53. package/src/models/servicerequest.js +55 -55
  54. package/src/models/settings.js +62 -62
  55. package/src/models/smart_meter_daily_consumption.js +44 -44
  56. package/src/models/sms_africastalking.js +20 -20
  57. package/src/models/sms_meliora.js +16 -16
  58. package/src/models/staff.js +36 -36
  59. package/src/models/stocksandspare.js +34 -34
  60. package/src/models/tickets.js +109 -109
  61. package/src/models/unitasset.js +25 -25
  62. package/src/models/units.js +70 -70
  63. package/src/models/user.js +94 -94
  64. package/src/models/valueaddedservices.js +36 -36
  65. package/src/models/vas_invoices_upload.js +50 -50
  66. package/src/models/vas_payments.js +24 -24
  67. package/src/models/vasinvoice.js +159 -159
  68. package/src/models/vasvendor.js +57 -57
  69. package/src/models/visitLog.js +86 -86
  70. package/src/models/visitor.js +63 -63
  71. package/src/models/waitlist.js +45 -45
  72. package/src/models/water_invoice.js +192 -192
  73. package/src/models/water_meter_account.js +74 -74
  74. package/src/models/water_meter_communication.js +17 -17
  75. package/src/models/water_meter_concentrator.js +59 -59
  76. package/src/models/water_meter_iot_cards.js +34 -34
  77. package/src/models/water_meter_manufacturer.js +35 -35
  78. package/src/models/water_meter_settings.js +88 -88
  79. package/src/models/water_meter_size.js +15 -15
  80. package/src/models/water_meters.js +110 -110
  81. package/src/models/water_meters_delivery.js +76 -76
  82. package/src/models/workorder.js +49 -49
@@ -1,252 +1,252 @@
1
- const mongoose = require("mongoose");
2
-
3
- const invoiceSchema = new mongoose.Schema(
4
- {
5
- invoiceNumber: {
6
- type: String,
7
- required: true,
8
- unique: true,
9
- },
10
- accountNumber: {
11
- type: String,
12
- required: true,
13
- unique: true,
14
- },
15
- client: {
16
- clientId: {
17
- type: mongoose.Schema.Types.ObjectId,
18
- ref: "Customer",
19
- required: true,
20
- },
21
- firstName: {
22
- type: String,
23
- required: true
24
- },
25
- lastName: {
26
- type: String,
27
- required: true
28
- }
29
- },
30
- facility: {
31
- id: {
32
- type: mongoose.Schema.Types.ObjectId,
33
- ref: "Facility",
34
- required: true,
35
- },
36
- name: {
37
- type: String,
38
- required: true
39
- }
40
- },
41
- unit: {
42
- id: { type: mongoose.Schema.Types.ObjectId, ref: "Unit", required: true },
43
- name: { type: String, required: true },
44
- },
45
- currency: {
46
- id: {
47
- type: mongoose.Schema.Types.ObjectId,
48
- ref: "Currency",
49
- required: true
50
- },
51
- name: {
52
- type: String,
53
- required: true
54
- },
55
- code: {
56
- type: String,
57
- required: true,
58
- uppercase: true,
59
- minlength: 3,
60
- maxlength: 3
61
- }
62
- },
63
- items: [
64
- {
65
- description: { type: String, required: true },
66
- quantity: { type: Number, required: true, min: 1 },
67
- unitPrice: { type: Number, required: true, min: 0 },
68
- },
69
- ],
70
- subTotal: {
71
- type: Number,
72
- required: true,
73
- },
74
- tax: {
75
- type: Number,
76
- required: true,
77
- },
78
- totalAmount: {
79
- type: Number,
80
- required: true,
81
- },
82
- amountPaid: {
83
- type: Number,
84
- default: 0,
85
- min: 0,
86
- },
87
- // Mark as deprecated, keep for backward compatibility
88
- overpay: {
89
- type: Number,
90
- default: 0,
91
- min: 0,
92
- deprecated: true
93
- },
94
- issueDate: {
95
- type: Date,
96
- required: true,
97
- },
98
- dueDate: {
99
- type: Date,
100
- required: true,
101
- },
102
- status: {
103
- type: String,
104
- required: true,
105
- enum: ["Unpaid", "Pending", "Paid", "Overdue", "Cancelled", "Partially Paid"],
106
- },
107
- penalty: {
108
- type: Number,
109
- default: 0,
110
- },
111
- whatFor: {
112
- invoiceType: { type: String, required: true },
113
- description: { type: String },
114
- },
115
- invoiceNote: {
116
- type: String,
117
- default: null,
118
- },
119
- // Enhanced balanceBroughtForward field
120
- // Positive values = customer owes money
121
- // Negative values = credit (previously tracked in overpay field)
122
- balanceBroughtForward: {
123
- type: Number,
124
- default: 0,
125
- },
126
- lastReminderSent: Date,
127
- reminderHistory: [
128
- {
129
- sentAt: Date,
130
- reminderId: mongoose.Schema.Types.ObjectId,
131
- notificationTypes: [String],
132
- },
133
- ],
134
- reconciliationHistory: [{
135
- date: { type: Date, required: true },
136
- amount: { type: Number, required: true },
137
- type: {
138
- type: String,
139
- enum: ['payment', 'cash', 'cheque', 'bank-transfer', 'mpesa-transfer', 'overpay-transfer', 'balance-deduction', 'overpay-received', 'credit-forward', 'debit-forward'],
140
- required: true
141
- },
142
- sourceInvoice: String,
143
- destinationInvoice: String,
144
- paymentReference: String,
145
- paymentCompletion: String,
146
- remainingBalance: Number,
147
- notes: String,
148
- exchangeRate: {
149
- type: Number,
150
- default: 1 // For cross-currency reconciliations
151
- },
152
- originalCurrency: {
153
- code: String, // Original currency code if different from invoice currency
154
- amount: Number // Amount in original currency
155
- }
156
- }],
157
- paymentDetails: {
158
- paymentStatus: { type: String, required: true },
159
- paymentMethod: { type: String },
160
- paymentDate: { type: Date },
161
- transactionId: { type: String },
162
- },
163
- },
164
- {
165
- timestamps: true,
166
- }
167
- );
168
-
169
- // Add indexes for frequently queried fields
170
- invoiceSchema.index({ accountNumber: 1 });
171
- invoiceSchema.index({ status: 1 });
172
- invoiceSchema.index({ 'client.clientId': 1, status: 1 });
173
- invoiceSchema.index({ 'reconciliationHistory.paymentReference': 1 });
174
- invoiceSchema.index({ issueDate: -1 });
175
- invoiceSchema.index({ 'currency.code': 1 }); // Add index for currency code
176
- invoiceSchema.index({ 'currency.id': 1 }); // Add index for currency ID
177
- invoiceSchema.index({ 'currency.code': 1, 'client.clientId': 1, status: 1 }); // Compound index for currency-based queries
178
- invoiceSchema.index({ 'client.clientId': 1, balanceBroughtForward: 1 }); // Add index for finding invoices with credit balances
179
-
180
- // Add virtual field for calculating balance
181
- invoiceSchema.virtual('calculatedBalance').get(function () {
182
- const baseBalance = this.totalAmount - (this.amountPaid || 0);
183
-
184
- // Add positive balanceBroughtForward (customer owes money)
185
- if (this.balanceBroughtForward > 0) {
186
- return baseBalance + this.balanceBroughtForward;
187
- }
188
-
189
- // Subtract negative balanceBroughtForward (credit)
190
- return baseBalance;
191
- });
192
-
193
- // Add virtual field for credit balance
194
- invoiceSchema.virtual('creditBalance').get(function () {
195
- return this.balanceBroughtForward < 0 ? Math.abs(this.balanceBroughtForward) : 0;
196
- });
197
-
198
- // Getter for compatible overpay field
199
- invoiceSchema.virtual('effectiveOverpay').get(function () {
200
- return this.balanceBroughtForward < 0 ? Math.abs(this.balanceBroughtForward) : 0;
201
- });
202
-
203
- // Add method for currency conversion if needed
204
- invoiceSchema.methods.convertAmount = function (amount, fromCurrency, toCurrency, exchangeRate) {
205
- if (fromCurrency === toCurrency) {
206
- return amount;
207
- }
208
- return amount * exchangeRate;
209
- };
210
-
211
- // Add static method to find invoices by currency
212
- invoiceSchema.statics.findByCurrency = function (currencyCode) {
213
- return this.find({ 'currency.code': currencyCode.toUpperCase() });
214
- };
215
-
216
- // Add static method to find invoices with credit balance
217
- invoiceSchema.statics.findWithCreditBalance = function (clientId) {
218
- return this.find({
219
- 'client.clientId': clientId,
220
- 'balanceBroughtForward': { $lt: 0 }
221
- }).sort({ updatedAt: -1 });
222
- };
223
-
224
- // Add static method to calculate totals by currency
225
- invoiceSchema.statics.calculateTotalsByCurrency = function (query = {}) {
226
- return this.aggregate([
227
- { $match: query },
228
- {
229
- $group: {
230
- _id: '$currency.code',
231
- totalAmount: { $sum: '$totalAmount' },
232
- totalPaid: { $sum: '$amountPaid' },
233
- count: { $sum: 1 }
234
- }
235
- }
236
- ]);
237
- };
238
-
239
- // Pre-save middleware to ensure overpay and balanceBroughtForward stay in sync during transition
240
- invoiceSchema.pre('save', function (next) {
241
- // If balanceBroughtForward is negative (credit), sync with overpay for backwards compatibility
242
- if (this.balanceBroughtForward < 0) {
243
- this.overpay = Math.abs(this.balanceBroughtForward);
244
- } else {
245
- this.overpay = 0; // No overpay if there's no negative balance
246
- }
247
- next();
248
- });
249
-
250
- const Invoice = mongoose.model('Invoice', invoiceSchema);
251
-
1
+ const mongoose = require("mongoose");
2
+
3
+ const invoiceSchema = new mongoose.Schema(
4
+ {
5
+ invoiceNumber: {
6
+ type: String,
7
+ required: true,
8
+ unique: true,
9
+ },
10
+ accountNumber: {
11
+ type: String,
12
+ required: true,
13
+ unique: true,
14
+ },
15
+ client: {
16
+ clientId: {
17
+ type: mongoose.Schema.Types.ObjectId,
18
+ ref: "Customer",
19
+ required: true,
20
+ },
21
+ firstName: {
22
+ type: String,
23
+ required: true
24
+ },
25
+ lastName: {
26
+ type: String,
27
+ required: true
28
+ }
29
+ },
30
+ facility: {
31
+ id: {
32
+ type: mongoose.Schema.Types.ObjectId,
33
+ ref: "Facility",
34
+ required: true,
35
+ },
36
+ name: {
37
+ type: String,
38
+ required: true
39
+ }
40
+ },
41
+ unit: {
42
+ id: { type: mongoose.Schema.Types.ObjectId, ref: "Unit", required: true },
43
+ name: { type: String, required: true },
44
+ },
45
+ currency: {
46
+ id: {
47
+ type: mongoose.Schema.Types.ObjectId,
48
+ ref: "Currency",
49
+ required: true
50
+ },
51
+ name: {
52
+ type: String,
53
+ required: true
54
+ },
55
+ code: {
56
+ type: String,
57
+ required: true,
58
+ uppercase: true,
59
+ minlength: 3,
60
+ maxlength: 3
61
+ }
62
+ },
63
+ items: [
64
+ {
65
+ description: { type: String, required: true },
66
+ quantity: { type: Number, required: true, min: 1 },
67
+ unitPrice: { type: Number, required: true, min: 0 },
68
+ },
69
+ ],
70
+ subTotal: {
71
+ type: Number,
72
+ required: true,
73
+ },
74
+ tax: {
75
+ type: Number,
76
+ required: true,
77
+ },
78
+ totalAmount: {
79
+ type: Number,
80
+ required: true,
81
+ },
82
+ amountPaid: {
83
+ type: Number,
84
+ default: 0,
85
+ min: 0,
86
+ },
87
+ // Mark as deprecated, keep for backward compatibility
88
+ overpay: {
89
+ type: Number,
90
+ default: 0,
91
+ min: 0,
92
+ deprecated: true
93
+ },
94
+ issueDate: {
95
+ type: Date,
96
+ required: true,
97
+ },
98
+ dueDate: {
99
+ type: Date,
100
+ required: true,
101
+ },
102
+ status: {
103
+ type: String,
104
+ required: true,
105
+ enum: ["Unpaid", "Pending", "Paid", "Overdue", "Cancelled", "Partially Paid"],
106
+ },
107
+ penalty: {
108
+ type: Number,
109
+ default: 0,
110
+ },
111
+ whatFor: {
112
+ invoiceType: { type: String, required: true },
113
+ description: { type: String },
114
+ },
115
+ invoiceNote: {
116
+ type: String,
117
+ default: null,
118
+ },
119
+ // Enhanced balanceBroughtForward field
120
+ // Positive values = customer owes money
121
+ // Negative values = credit (previously tracked in overpay field)
122
+ balanceBroughtForward: {
123
+ type: Number,
124
+ default: 0,
125
+ },
126
+ lastReminderSent: Date,
127
+ reminderHistory: [
128
+ {
129
+ sentAt: Date,
130
+ reminderId: mongoose.Schema.Types.ObjectId,
131
+ notificationTypes: [String],
132
+ },
133
+ ],
134
+ reconciliationHistory: [{
135
+ date: { type: Date, required: true },
136
+ amount: { type: Number, required: true },
137
+ type: {
138
+ type: String,
139
+ enum: ['payment', 'cash', 'cheque', 'bank-transfer', 'mpesa-transfer', 'overpay-transfer', 'balance-deduction', 'overpay-received', 'credit-forward', 'debit-forward'],
140
+ required: true
141
+ },
142
+ sourceInvoice: String,
143
+ destinationInvoice: String,
144
+ paymentReference: String,
145
+ paymentCompletion: String,
146
+ remainingBalance: Number,
147
+ notes: String,
148
+ exchangeRate: {
149
+ type: Number,
150
+ default: 1 // For cross-currency reconciliations
151
+ },
152
+ originalCurrency: {
153
+ code: String, // Original currency code if different from invoice currency
154
+ amount: Number // Amount in original currency
155
+ }
156
+ }],
157
+ paymentDetails: {
158
+ paymentStatus: { type: String, required: true },
159
+ paymentMethod: { type: String },
160
+ paymentDate: { type: Date },
161
+ transactionId: { type: String },
162
+ },
163
+ },
164
+ {
165
+ timestamps: true,
166
+ }
167
+ );
168
+
169
+ // Add indexes for frequently queried fields
170
+ invoiceSchema.index({ accountNumber: 1 });
171
+ invoiceSchema.index({ status: 1 });
172
+ invoiceSchema.index({ 'client.clientId': 1, status: 1 });
173
+ invoiceSchema.index({ 'reconciliationHistory.paymentReference': 1 });
174
+ invoiceSchema.index({ issueDate: -1 });
175
+ invoiceSchema.index({ 'currency.code': 1 }); // Add index for currency code
176
+ invoiceSchema.index({ 'currency.id': 1 }); // Add index for currency ID
177
+ invoiceSchema.index({ 'currency.code': 1, 'client.clientId': 1, status: 1 }); // Compound index for currency-based queries
178
+ invoiceSchema.index({ 'client.clientId': 1, balanceBroughtForward: 1 }); // Add index for finding invoices with credit balances
179
+
180
+ // Add virtual field for calculating balance
181
+ invoiceSchema.virtual('calculatedBalance').get(function () {
182
+ const baseBalance = this.totalAmount - (this.amountPaid || 0);
183
+
184
+ // Add positive balanceBroughtForward (customer owes money)
185
+ if (this.balanceBroughtForward > 0) {
186
+ return baseBalance + this.balanceBroughtForward;
187
+ }
188
+
189
+ // Subtract negative balanceBroughtForward (credit)
190
+ return baseBalance;
191
+ });
192
+
193
+ // Add virtual field for credit balance
194
+ invoiceSchema.virtual('creditBalance').get(function () {
195
+ return this.balanceBroughtForward < 0 ? Math.abs(this.balanceBroughtForward) : 0;
196
+ });
197
+
198
+ // Getter for compatible overpay field
199
+ invoiceSchema.virtual('effectiveOverpay').get(function () {
200
+ return this.balanceBroughtForward < 0 ? Math.abs(this.balanceBroughtForward) : 0;
201
+ });
202
+
203
+ // Add method for currency conversion if needed
204
+ invoiceSchema.methods.convertAmount = function (amount, fromCurrency, toCurrency, exchangeRate) {
205
+ if (fromCurrency === toCurrency) {
206
+ return amount;
207
+ }
208
+ return amount * exchangeRate;
209
+ };
210
+
211
+ // Add static method to find invoices by currency
212
+ invoiceSchema.statics.findByCurrency = function (currencyCode) {
213
+ return this.find({ 'currency.code': currencyCode.toUpperCase() });
214
+ };
215
+
216
+ // Add static method to find invoices with credit balance
217
+ invoiceSchema.statics.findWithCreditBalance = function (clientId) {
218
+ return this.find({
219
+ 'client.clientId': clientId,
220
+ 'balanceBroughtForward': { $lt: 0 }
221
+ }).sort({ updatedAt: -1 });
222
+ };
223
+
224
+ // Add static method to calculate totals by currency
225
+ invoiceSchema.statics.calculateTotalsByCurrency = function (query = {}) {
226
+ return this.aggregate([
227
+ { $match: query },
228
+ {
229
+ $group: {
230
+ _id: '$currency.code',
231
+ totalAmount: { $sum: '$totalAmount' },
232
+ totalPaid: { $sum: '$amountPaid' },
233
+ count: { $sum: 1 }
234
+ }
235
+ }
236
+ ]);
237
+ };
238
+
239
+ // Pre-save middleware to ensure overpay and balanceBroughtForward stay in sync during transition
240
+ invoiceSchema.pre('save', function (next) {
241
+ // If balanceBroughtForward is negative (credit), sync with overpay for backwards compatibility
242
+ if (this.balanceBroughtForward < 0) {
243
+ this.overpay = Math.abs(this.balanceBroughtForward);
244
+ } else {
245
+ this.overpay = 0; // No overpay if there's no negative balance
246
+ }
247
+ next();
248
+ });
249
+
250
+ const Invoice = mongoose.model('Invoice', invoiceSchema);
251
+
252
252
  module.exports = Invoice;
@@ -1,68 +1,68 @@
1
- const mongoose = require('mongoose');
2
-
3
- // Define the schema for inspection items
4
- const inspectionItemSchema = new mongoose.Schema({
5
- name: {
6
- type: String,
7
- required: [true, 'Item name is required'],
8
- trim: true
9
- },
10
- category: {
11
- type: String,
12
- required: [true, 'Category is required'],
13
- trim: true
14
- },
15
- subcategory: {
16
- type: String,
17
- trim: true,
18
- default: null
19
- },
20
- description: {
21
- type: String,
22
- trim: true
23
- },
24
- possibleConditions: {
25
- type: [String],
26
- default: ['Excellent', 'Good', 'Fair', 'Poor', 'Damaged', 'Non-functional'],
27
- validate: {
28
- validator: function(v) {
29
- return v.length > 0;
30
- },
31
- message: 'At least one possible condition is required'
32
- }
33
- },
34
- defaultCondition: {
35
- type: String,
36
- default: 'Good'
37
- },
38
- isRequired: {
39
- type: Boolean,
40
- default: true
41
- },
42
- defaultQuantity: {
43
- type: Number,
44
- default: 1,
45
- min: [1, 'Default quantity must be at least 1']
46
- },
47
- active: {
48
- type: Boolean,
49
- default: true
50
- },
51
- facilityId: {
52
- type: mongoose.Schema.Types.ObjectId,
53
- ref: 'Facility',
54
- required: true
55
- }
56
- }, {
57
- timestamps: true
58
- });
59
-
60
- // Add indexes for common queries
61
- inspectionItemSchema.index({ facilityId: 1 });
62
- inspectionItemSchema.index({ facilityId: 1, category: 1 });
63
- inspectionItemSchema.index({ facilityId: 1, active: 1 });
64
-
65
- // Create InspectionItem model
66
- const InspectionItem = mongoose.model('InspectionItem', inspectionItemSchema);
67
-
1
+ const mongoose = require('mongoose');
2
+
3
+ // Define the schema for inspection items
4
+ const inspectionItemSchema = new mongoose.Schema({
5
+ name: {
6
+ type: String,
7
+ required: [true, 'Item name is required'],
8
+ trim: true
9
+ },
10
+ category: {
11
+ type: String,
12
+ required: [true, 'Category is required'],
13
+ trim: true
14
+ },
15
+ subcategory: {
16
+ type: String,
17
+ trim: true,
18
+ default: null
19
+ },
20
+ description: {
21
+ type: String,
22
+ trim: true
23
+ },
24
+ possibleConditions: {
25
+ type: [String],
26
+ default: ['Excellent', 'Good', 'Fair', 'Poor', 'Damaged', 'Non-functional'],
27
+ validate: {
28
+ validator: function(v) {
29
+ return v.length > 0;
30
+ },
31
+ message: 'At least one possible condition is required'
32
+ }
33
+ },
34
+ defaultCondition: {
35
+ type: String,
36
+ default: 'Good'
37
+ },
38
+ isRequired: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ defaultQuantity: {
43
+ type: Number,
44
+ default: 1,
45
+ min: [1, 'Default quantity must be at least 1']
46
+ },
47
+ active: {
48
+ type: Boolean,
49
+ default: true
50
+ },
51
+ facilityId: {
52
+ type: mongoose.Schema.Types.ObjectId,
53
+ ref: 'Facility',
54
+ required: true
55
+ }
56
+ }, {
57
+ timestamps: true
58
+ });
59
+
60
+ // Add indexes for common queries
61
+ inspectionItemSchema.index({ facilityId: 1 });
62
+ inspectionItemSchema.index({ facilityId: 1, category: 1 });
63
+ inspectionItemSchema.index({ facilityId: 1, active: 1 });
64
+
65
+ // Create InspectionItem model
66
+ const InspectionItem = mongoose.model('InspectionItem', inspectionItemSchema);
67
+
68
68
  module.exports = InspectionItem;