@dynamatix/gb-schemas 2.3.270 → 2.3.272
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/README.md +308 -308
- package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-additional-income.model.js +3 -0
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-creditCard.model.js +3 -0
- package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-loan.model.js +2 -0
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-mortgage.model.js +3 -0
- package/dist/applicants/applicant-commitment-residence.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-residence.model.js +2 -0
- package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-secureLoan.model.js +3 -0
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.js +3 -0
- package/dist/applicants/applicant-credit-report.model.js +1 -0
- package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-employment-income.model.js +3 -0
- package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
- package/dist/applicants/applicant-expenditure.model.js +3 -0
- package/dist/applicants/applicant-income-settings.model.d.ts.map +1 -1
- package/dist/applicants/applicant-income-settings.model.js +1 -0
- package/dist/applicants/applicant-income-summary.model.d.ts.map +1 -1
- package/dist/applicants/applicant-income-summary.model.js +2 -0
- package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-pension-income.model.js +2 -0
- package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-property-income.model.js +1 -0
- package/dist/applicants/applicant-self-employed-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-self-employed-income.model.js +1 -0
- package/dist/applicants/applicant-self-employment.model.d.ts.map +1 -1
- package/dist/applicants/applicant-self-employment.model.js +2 -0
- package/dist/applicants/applicant-sole-trader-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-sole-trader-income.model.js +1 -0
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
- package/dist/applicants/applicant-uk-tax-credits.model.js +2 -0
- package/dist/applicants/applicant-welcome-call.model.d.ts.map +1 -1
- package/dist/applicants/applicant-welcome-call.model.js +4 -159
- package/dist/applicants/applicant.model.d.ts.map +1 -1
- package/dist/applicants/applicant.model.js +14 -0
- package/dist/applications/application-direct-debit.model.js +2 -0
- package/dist/applications/application-euc.model.d.ts.map +1 -1
- package/dist/applications/application-euc.model.js +2 -0
- package/dist/applications/application-mortgage.model.js +2 -0
- package/dist/applications/application-note.model.d.ts.map +1 -1
- package/dist/applications/application-note.model.js +18 -0
- package/dist/applications/application-product.model.d.ts.map +1 -1
- package/dist/applications/application-product.model.js +3 -0
- package/dist/applications/application.model.d.ts.map +1 -1
- package/dist/applications/application.model.js +11 -0
- package/dist/applications/applications-task.model.d.ts.map +1 -1
- package/dist/applications/applications-task.model.js +3 -0
- package/dist/product-catalogues/product-catalogue.model.d.ts.map +1 -1
- package/dist/product-catalogues/product-catalogue.model.js +1 -0
- package/dist/product-catalogues/product-variant.model.d.ts.map +1 -1
- package/dist/product-catalogues/product-variant.model.js +1 -0
- package/dist/properties/security.model.d.ts.map +1 -1
- package/dist/properties/security.model.js +4 -0
- package/dist/shared/api-log.model.d.ts +6 -0
- package/dist/shared/api-log.model.d.ts.map +1 -1
- package/dist/shared/api-log.model.js +4 -0
- package/dist/shared/apprivo-sync-journey.model.d.ts.map +1 -1
- package/dist/shared/apprivo-sync-journey.model.js +2 -0
- package/dist/shared/audit-log.model.d.ts +180 -0
- package/dist/shared/audit-log.model.d.ts.map +1 -0
- package/dist/shared/audit-log.model.js +43 -0
- package/dist/shared/checklist.model.d.ts.map +1 -1
- package/dist/shared/checklist.model.js +5 -0
- package/dist/shared/document.model.d.ts +180 -0
- package/dist/shared/document.model.d.ts.map +1 -0
- package/dist/shared/document.model.js +40 -0
- package/dist/shared/lookup-group.model.d.ts.map +1 -1
- package/dist/shared/lookup-group.model.js +3 -0
- package/dist/shared/lookup.model.d.ts.map +1 -1
- package/dist/shared/lookup.model.js +6 -0
- package/dist/shared/queue.model.d.ts +180 -0
- package/dist/shared/queue.model.d.ts.map +1 -0
- package/dist/shared/queue.model.js +42 -0
- package/dist/shared/webhook-event.model.d.ts.map +1 -1
- package/dist/shared/webhook-event.model.js +4 -0
- package/dist/users/auth-log.model.d.ts.map +1 -1
- package/dist/users/auth-log.model.js +3 -0
- package/dist/users/permission.model.d.ts.map +1 -1
- package/dist/users/permission.model.js +2 -0
- package/dist/users/role-group.model.d.ts.map +1 -1
- package/dist/users/role-group.model.js +3 -0
- package/dist/users/role.model.d.ts.map +1 -1
- package/dist/users/role.model.js +3 -0
- package/dist/users/user.model.d.ts.map +1 -1
- package/dist/users/user.model.js +10 -0
- package/package.json +86 -86
- package/dist/applicants/applicant-income-source.model.d.ts +0 -26
- package/dist/applicants/applicant-income-source.model.d.ts.map +0 -1
- package/dist/applicants/applicant-income.model.d.ts +0 -160
- package/dist/applicants/applicant-income.model.d.ts.map +0 -1
- package/dist/applicants/applicant-other-income.model.d.ts +0 -85
- package/dist/applicants/applicant-other-income.model.d.ts.map +0 -1
- package/dist/applications/application-document.model.d.ts +0 -158
- package/dist/applications/application-document.model.d.ts.map +0 -1
- package/dist/applications/document.model.d.ts +0 -158
- package/dist/applications/document.model.d.ts.map +0 -1
- package/dist/applications/productfeatures.model.d.ts +0 -368
- package/dist/applications/productfeatures.model.d.ts.map +0 -1
- package/dist/shared/document-type-model.d.ts +0 -48
- package/dist/shared/document-type-model.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-commitment-mortgage.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-mortgage.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-commitment-mortgage.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-mortgage.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA6E5D,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiE,CAAC;AAC/F,eAAe,uBAAuB,CAAC"}
|
|
@@ -62,5 +62,8 @@ mortgageCommitmentSchema.virtual('applicationType').get(function () {
|
|
|
62
62
|
applyAuditMiddleware(mortgageCommitmentSchema, "MortgageCommitment");
|
|
63
63
|
// Apply workflow plugin to the schema
|
|
64
64
|
applyWorkflowPlugin(mortgageCommitmentSchema, 'mortgagecommitment');
|
|
65
|
+
// Indexes for query optimization
|
|
66
|
+
mortgageCommitmentSchema.index({ applicantId: 1 });
|
|
67
|
+
mortgageCommitmentSchema.index({ applicantId: 1, isSelected: 1 });
|
|
65
68
|
const MortgageCommitmentModel = mongoose.model("MortgageCommitment", mortgageCommitmentSchema);
|
|
66
69
|
export default MortgageCommitmentModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-commitment-residence.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-residence.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-commitment-residence.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-residence.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA6D5D,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmE,CAAC;AAClG,eAAe,wBAAwB,CAAC"}
|
|
@@ -51,5 +51,7 @@ const residenceCommitmentSchema = new mongoose.Schema({
|
|
|
51
51
|
applyAuditMiddleware(residenceCommitmentSchema, "ResidenceCommitment");
|
|
52
52
|
// Apply workflow plugin to the schema
|
|
53
53
|
applyWorkflowPlugin(residenceCommitmentSchema, 'residencecommitment');
|
|
54
|
+
// Indexes for query optimization
|
|
55
|
+
residenceCommitmentSchema.index({ applicantId: 1 });
|
|
54
56
|
const ResidenceCommitmentModel = mongoose.model("ResidenceCommitment", residenceCommitmentSchema);
|
|
55
57
|
export default ResidenceCommitmentModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-commitment-secureLoan.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-secureLoan.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-commitment-secureLoan.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-secureLoan.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAgD5D,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuE,CAAC;AACxG,eAAe,0BAA0B,CAAC"}
|
|
@@ -36,5 +36,8 @@ securedLoanCommitmentSchema.virtual('lendingType').get(function () {
|
|
|
36
36
|
applyAuditMiddleware(securedLoanCommitmentSchema, "SecuredLoanCommitment");
|
|
37
37
|
// Apply workflow plugin to the schema
|
|
38
38
|
applyWorkflowPlugin(securedLoanCommitmentSchema, 'securedloancommitment');
|
|
39
|
+
// Indexes for query optimization
|
|
40
|
+
securedLoanCommitmentSchema.index({ applicantId: 1 });
|
|
41
|
+
securedLoanCommitmentSchema.index({ applicantId: 1, isSelected: 1 });
|
|
39
42
|
const SecuredLoanCommitmentModel = mongoose.model("SecuredLoanCommitment", securedLoanCommitmentSchema);
|
|
40
43
|
export default SecuredLoanCommitmentModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-commitment-unsecuredLoan.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-unsecuredLoan.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-commitment-unsecuredLoan.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-unsecuredLoan.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAgD5D,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA2E,CAAC;AAC9G,eAAe,4BAA4B,CAAC"}
|
|
@@ -36,5 +36,8 @@ unsecuredLoanCommitmentSchema.virtual('lendingType').get(function () {
|
|
|
36
36
|
applyAuditMiddleware(unsecuredLoanCommitmentSchema, "UnsecuredLoanCommitment");
|
|
37
37
|
// Apply workflow plugin to the schema
|
|
38
38
|
applyWorkflowPlugin(unsecuredLoanCommitmentSchema, 'unsecuredloancommitment');
|
|
39
|
+
// Indexes for query optimization
|
|
40
|
+
unsecuredLoanCommitmentSchema.index({ applicantId: 1 });
|
|
41
|
+
unsecuredLoanCommitmentSchema.index({ applicantId: 1, isSelected: 1 });
|
|
39
42
|
const UnsecuredLoanCommitmentModel = mongoose.model("UnsecuredLoanCommitment", unsecuredLoanCommitmentSchema);
|
|
40
43
|
export default UnsecuredLoanCommitmentModel;
|
|
@@ -111,6 +111,7 @@ const applicantCreditReportSchema = new Schema({
|
|
|
111
111
|
noticeofCorrection: [noticeofCorrectionSchema],
|
|
112
112
|
});
|
|
113
113
|
// Apply workflow plugin to the schema
|
|
114
|
+
applicantCreditReportSchema.index({ applicantId: 1 });
|
|
114
115
|
applyWorkflowPlugin(applicantCreditReportSchema, 'applicantcreditreport');
|
|
115
116
|
const ApplicantCreditReportModel = mongoose.model("ApplicantCreditReport", applicantCreditReportSchema);
|
|
116
117
|
export default ApplicantCreditReportModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-employment-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-employment-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-employment-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-employment-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAqB5D,QAAA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAgF,CAAC;AAErH,eAAe,8BAA8B,CAAC"}
|
|
@@ -13,5 +13,8 @@ applicantEmploymentIncomeSchema.virtual('incomeSourceId').get(function () {
|
|
|
13
13
|
});
|
|
14
14
|
// Apply workflow plugin to the schema
|
|
15
15
|
applyWorkflowPlugin(applicantEmploymentIncomeSchema, 'applicantemploymentincome');
|
|
16
|
+
// Add indexes that exist in database but missing from model
|
|
17
|
+
applicantEmploymentIncomeSchema.index({ applicantId: 1 }); // Filter by applicant
|
|
18
|
+
applicantEmploymentIncomeSchema.index({ applicantId: 1, incomeTypeLid: 1 }); // Compound: applicant + income type
|
|
16
19
|
const ApplicantEmploymentIncomeModel = mongoose.model("Applicant_EmploymentIncome", applicantEmploymentIncomeSchema);
|
|
17
20
|
export default ApplicantEmploymentIncomeModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA6K5D,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsE,CAAC;AACtG,eAAe,yBAAyB,CAAC"}
|
|
@@ -138,6 +138,9 @@ const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("Expendit
|
|
|
138
138
|
virtualEssentialExpenditure.description = "Populated lookup value for essential expenditure.";
|
|
139
139
|
applyAuditMiddleware(applicantExpenditureSchema, "Applicant_Expenditure");
|
|
140
140
|
// Apply workflow plugin to the schema
|
|
141
|
+
applicantExpenditureSchema.index({ applicantId: 1 });
|
|
142
|
+
applicantExpenditureSchema.index({ applicantId: 1, sectionName: 1 });
|
|
143
|
+
applicantExpenditureSchema.index({ expenditureTypeLid: 1 });
|
|
141
144
|
applyWorkflowPlugin(applicantExpenditureSchema, 'applicant_expenditure');
|
|
142
145
|
const ApplicantExpenditureModel = mongoose.model("Applicant_Expenditure", applicantExpenditureSchema);
|
|
143
146
|
export default ApplicantExpenditureModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-income-settings.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-income-settings.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-income-settings.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-income-settings.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA0BhC,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4E,CAAC;AAE/G,eAAe,4BAA4B,CAAC"}
|
|
@@ -17,5 +17,6 @@ applicantIncomeSettingsSchema.virtual('lendingType').get(function () {
|
|
|
17
17
|
applyAuditMiddleware(applicantIncomeSettingsSchema, "Applicant_IncomeSettings");
|
|
18
18
|
// Apply workflow plugin to the schema
|
|
19
19
|
applyWorkflowPlugin(applicantIncomeSettingsSchema, 'applicant_incomesettings');
|
|
20
|
+
applicantIncomeSettingsSchema.index({ applicantId: 1 });
|
|
20
21
|
const ApplicantIncomeSettingsModel = mongoose.model("Applicant_IncomeSettings", applicantIncomeSettingsSchema);
|
|
21
22
|
export default ApplicantIncomeSettingsModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-income-summary.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-income-summary.model.ts"],"names":[],"mappings":";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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA2E,CAAC;AAE7G,eAAe,2BAA2B,CAAC"}
|
|
@@ -37,5 +37,7 @@ const applicantIncomeSummarySchema = new mongoose.Schema({
|
|
|
37
37
|
applyAuditMiddleware(applicantIncomeSummarySchema, "Applicant_Income_Summary");
|
|
38
38
|
// Apply workflow plugin to the schema
|
|
39
39
|
applyWorkflowPlugin(applicantIncomeSummarySchema, 'applicant_income_summary');
|
|
40
|
+
// Add indexes that exist in database but missing from model
|
|
41
|
+
applicantIncomeSummarySchema.index({ applicantId: 1 }, { unique: true }); // Filter by applicant - unique constraint
|
|
40
42
|
const ApplicantIncomeSummaryModel = mongoose.model("Applicant_Income_Summary", applicantIncomeSummarySchema);
|
|
41
43
|
export default ApplicantIncomeSummaryModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-pension-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-pension-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-pension-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-pension-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA0C5D,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0E,CAAC;AAE7G,eAAe,4BAA4B,CAAC"}
|
|
@@ -29,5 +29,7 @@ applicantPensionIncomSchema.virtual('incomeSourceId').get(function () {
|
|
|
29
29
|
});
|
|
30
30
|
// Apply workflow plugin to the schema
|
|
31
31
|
applyWorkflowPlugin(applicantPensionIncomSchema, 'applicant_pension_income');
|
|
32
|
+
// Add indexes that exist in database but missing from model
|
|
33
|
+
applicantPensionIncomSchema.index({ applicantId: 1 }); // Filter by applicant
|
|
32
34
|
const EmploymentPensionIncomeModel = mongoose.model("Applicant_Pension_Income", applicantPensionIncomSchema);
|
|
33
35
|
export default EmploymentPensionIncomeModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-property-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-property-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-property-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-property-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CA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
|
|
@@ -29,5 +29,6 @@ propertyIncomeSchema.virtual('incomeSourceId').get(function () {
|
|
|
29
29
|
applyAuditMiddleware(propertyIncomeSchema, "Applicant_Property_Income");
|
|
30
30
|
// Apply workflow plugin to the schema
|
|
31
31
|
applyWorkflowPlugin(propertyIncomeSchema, 'applicant_property_income');
|
|
32
|
+
propertyIncomeSchema.index({ applicantId: 1 });
|
|
32
33
|
const ApplicantPropertyIncomeModel = mongoose.model("Applicant_Property_Income", propertyIncomeSchema);
|
|
33
34
|
export default ApplicantPropertyIncomeModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-self-employed-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-self-employed-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-self-employed-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-self-employed-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAwB5D,QAAA,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6E,CAAC;AAEpH,eAAe,gCAAgC,CAAC"}
|
|
@@ -17,6 +17,7 @@ selfEmployedIncomeSchema.virtual('incomeSourceId').get(function () {
|
|
|
17
17
|
});
|
|
18
18
|
applyAuditMiddleware(selfEmployedIncomeSchema, "Applicant_Self_Employed_Income");
|
|
19
19
|
// Apply workflow plugin to the schema
|
|
20
|
+
selfEmployedIncomeSchema.index({ applicantId: 1 }); // Filter by applicant
|
|
20
21
|
applyWorkflowPlugin(selfEmployedIncomeSchema, 'applicant_self_employed_income');
|
|
21
22
|
const ApplicantSelfEmployedIncomeModel = mongoose.model("Applicant_Self_Employed_Income", selfEmployedIncomeSchema);
|
|
22
23
|
export default ApplicantSelfEmployedIncomeModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-self-employment.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-self-employment.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-self-employment.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-self-employment.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA8DhC,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6E,CAAC;AAEhH,eAAe,4BAA4B,CAAC"}
|
|
@@ -49,5 +49,7 @@ const applicantSelfEmploymentSchema = new mongoose.Schema({
|
|
|
49
49
|
});
|
|
50
50
|
// Apply workflow plugin to the schema
|
|
51
51
|
applyWorkflowPlugin(applicantSelfEmploymentSchema, 'applicant_self_employment');
|
|
52
|
+
// Add indexes that exist in database but missing from model
|
|
53
|
+
applicantSelfEmploymentSchema.index({ applicantId: 1 }); // Filter by applicant
|
|
52
54
|
const ApplicantSelfEmploymentModel = mongoose.model("Applicant_Self_Employment", applicantSelfEmploymentSchema);
|
|
53
55
|
export default ApplicantSelfEmploymentModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-sole-trader-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-sole-trader-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-sole-trader-income.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-sole-trader-income.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAwB5D,QAAA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyE,CAAC;AAE9G,eAAe,8BAA8B,CAAC"}
|
|
@@ -16,5 +16,6 @@ soleTraderIncomeSchema.virtual('incomeSourceId').get(function () {
|
|
|
16
16
|
});
|
|
17
17
|
// Apply workflow plugin to the schema
|
|
18
18
|
applyWorkflowPlugin(soleTraderIncomeSchema, 'applicant_sole_trader_income');
|
|
19
|
+
soleTraderIncomeSchema.index({ applicantId: 1 });
|
|
19
20
|
const ApplicantSoleTraderIncomeModel = mongoose.model("Applicant_Sole_Trader_Income", soleTraderIncomeSchema);
|
|
20
21
|
export default ApplicantSoleTraderIncomeModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-uk-tax-credits.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-uk-tax-credits.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-uk-tax-credits.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-uk-tax-credits.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAuB5D,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0E,CAAC;AAE3G,eAAe,0BAA0B,CAAC"}
|
|
@@ -15,5 +15,7 @@ applicantUkTaxCreditsSchema.virtual('incomeSourceId').get(function () {
|
|
|
15
15
|
});
|
|
16
16
|
// Apply workflow plugin to the schema
|
|
17
17
|
applyWorkflowPlugin(applicantUkTaxCreditsSchema, 'applicant_uk_tax_credits');
|
|
18
|
+
// Add indexes that exist in database but missing from model
|
|
19
|
+
applicantUkTaxCreditsSchema.index({ applicantId: 1 }); // Filter by applicant
|
|
18
20
|
const ApplicantUkTaxCreditsModel = mongoose.model("Applicant_Uk_Tax_Credits", applicantUkTaxCreditsSchema);
|
|
19
21
|
export default ApplicantUkTaxCreditsModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-welcome-call.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-welcome-call.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-welcome-call.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-welcome-call.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA+hBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
|
|
@@ -237,66 +237,14 @@ welcomeCallSchema.virtual('customerCurrentResidentialAddress').get(function () {
|
|
|
237
237
|
applicant.addressLine2,
|
|
238
238
|
applicant.addressLine3,
|
|
239
239
|
applicant.addressCity,
|
|
240
|
-
applicant.
|
|
241
|
-
|
|
240
|
+
applicant.addressPostCode,
|
|
241
|
+
countryName
|
|
242
242
|
].filter(part => part && part.trim() !== '');
|
|
243
243
|
return addressParts.join(', ');
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
return null;
|
|
247
247
|
});
|
|
248
|
-
// Virtual property for applicant employer/business name based on income settings
|
|
249
|
-
welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
|
|
250
|
-
if (this.applicantId && typeof this.applicantId === 'object') {
|
|
251
|
-
const applicant = this.applicantId;
|
|
252
|
-
// Check if applicant has income settings
|
|
253
|
-
if (applicant.incomeSourceId && typeof applicant.incomeSourceId === 'object') {
|
|
254
|
-
const incomeSettings = applicant.incomeSourceId;
|
|
255
|
-
// If incomeFromEmployment is false, return N/A
|
|
256
|
-
if (!incomeSettings.incomeFromEmployment)
|
|
257
|
-
return 'N/A';
|
|
258
|
-
// Check employment status to determine if employed or self-employed
|
|
259
|
-
if (incomeSettings.employmentStatusLid && typeof incomeSettings.employmentStatusLid === 'object') {
|
|
260
|
-
const employmentStatus = incomeSettings.employmentStatusLid;
|
|
261
|
-
const statusName = employmentStatus.name;
|
|
262
|
-
// Check if it's employed status - compare by name for stability
|
|
263
|
-
if (statusName === 'Employee with no shareholding' ||
|
|
264
|
-
statusName === 'A non-equity partner in a partnership' ||
|
|
265
|
-
statusName === 'A shareholder with less than 25% shares') {
|
|
266
|
-
// Check employment information
|
|
267
|
-
if (applicant.employmentInformationId && typeof applicant.employmentInformationId === 'object') {
|
|
268
|
-
const employment = applicant.employmentInformationId;
|
|
269
|
-
if (employment.employerName && employment.employerName.trim() !== '') {
|
|
270
|
-
return employment.employerName;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
// Check if it's self-employed or solo trader status - compare by name for stability
|
|
275
|
-
else if (statusName === 'A shareholder with 25% or more shares' ||
|
|
276
|
-
statusName === 'An equity partner in a partnership' ||
|
|
277
|
-
statusName === 'Sole Trader') {
|
|
278
|
-
// Check self-employment information
|
|
279
|
-
if (applicant.selfEmployedInformationId && typeof applicant.selfEmployedInformationId === 'object') {
|
|
280
|
-
const selfEmployment = applicant.selfEmployedInformationId;
|
|
281
|
-
if (selfEmployment.nameOfBusiness && selfEmployment.nameOfBusiness.trim() !== '') {
|
|
282
|
-
return selfEmployment.nameOfBusiness;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
else {
|
|
288
|
-
console.log('No employment status found');
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
console.log('No income settings found');
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
console.log('No applicant found');
|
|
297
|
-
}
|
|
298
|
-
return 'N/A';
|
|
299
|
-
});
|
|
300
248
|
// Virtual property for Customer's Contact Numbers (Phone and Mobile)
|
|
301
249
|
welcomeCallSchema.virtual('customerContactNumbers').get(function () {
|
|
302
250
|
if (this.applicantId && typeof this.applicantId === 'object') {
|
|
@@ -380,111 +328,6 @@ welcomeCallSchema.virtual('allApplicantsNameAndDOB').get(function () {
|
|
|
380
328
|
// If application not populated or no applicants, return "N/A"
|
|
381
329
|
return 'N/A';
|
|
382
330
|
});
|
|
383
|
-
// Virtual property for other applicants name and DOB in the requested format
|
|
384
|
-
welcomeCallSchema.virtual('otherApplicantsNameAndDOB').get(function () {
|
|
385
|
-
console.log('=== DEBUG otherApplicantsNameAndDOB ===');
|
|
386
|
-
console.log('this.applicationId:', this.applicationId);
|
|
387
|
-
console.log('typeof this.applicationId:', typeof this.applicationId);
|
|
388
|
-
// Get application and its applicants
|
|
389
|
-
if (this.applicationId && typeof this.applicationId === 'object') {
|
|
390
|
-
const application = this.applicationId;
|
|
391
|
-
console.log('application object:', application);
|
|
392
|
-
console.log('application.applicants:', application.applicants);
|
|
393
|
-
console.log('Array.isArray(application.applicants):', Array.isArray(application.applicants));
|
|
394
|
-
console.log('application.applicants.length:', application.applicants?.length);
|
|
395
|
-
// Additional debug: Check if applicants is populated
|
|
396
|
-
if (application.applicants && application.applicants.length > 0) {
|
|
397
|
-
console.log('First applicant sample:', application.applicants[0]);
|
|
398
|
-
console.log('First applicant type:', typeof application.applicants[0]);
|
|
399
|
-
console.log('First applicant has firstName:', !!application.applicants[0]?.firstName);
|
|
400
|
-
}
|
|
401
|
-
// Get all applicants from the application (field name is 'applicants')
|
|
402
|
-
if (application.applicants && Array.isArray(application.applicants) && application.applicants.length > 0) {
|
|
403
|
-
console.log('Found applicants array with length:', application.applicants.length);
|
|
404
|
-
// Get current applicant ID for comparison
|
|
405
|
-
const currentApplicantId = this.applicantId?._id || this.applicantId;
|
|
406
|
-
console.log('currentApplicantId:', currentApplicantId);
|
|
407
|
-
// Filter out the current applicant to get only OTHER applicants
|
|
408
|
-
const otherApplicants = application.applicants.filter((applicant) => {
|
|
409
|
-
const applicantId = applicant._id || applicant;
|
|
410
|
-
console.log('Comparing applicantId:', applicantId, 'with currentApplicantId:', currentApplicantId);
|
|
411
|
-
return applicantId.toString() !== currentApplicantId.toString();
|
|
412
|
-
});
|
|
413
|
-
console.log('otherApplicants after filtering:', otherApplicants.length);
|
|
414
|
-
// If no other applicants, return "N/A" (single applicant case)
|
|
415
|
-
if (otherApplicants.length === 0) {
|
|
416
|
-
console.log('No other applicants found, returning N/A');
|
|
417
|
-
return 'N/A';
|
|
418
|
-
}
|
|
419
|
-
// Format each other applicant as: "First and middle names, last name, Date of birth"
|
|
420
|
-
const formattedApplicants = otherApplicants.map((applicant) => {
|
|
421
|
-
console.log('Processing applicant:', applicant);
|
|
422
|
-
// Check if applicant is an ObjectId (not populated)
|
|
423
|
-
if (typeof applicant === 'string' || (applicant.constructor && applicant.constructor.name === 'ObjectId')) {
|
|
424
|
-
console.log('Applicant is not populated, skipping');
|
|
425
|
-
return null; // Skip unpopulated references
|
|
426
|
-
}
|
|
427
|
-
const firstName = applicant.firstName || '';
|
|
428
|
-
const middleName = applicant.middleName || '';
|
|
429
|
-
const lastName = applicant.lastName || '';
|
|
430
|
-
console.log('Applicant names:', { firstName, middleName, lastName });
|
|
431
|
-
// Combine first and middle names with space
|
|
432
|
-
const fullFirstName = middleName ? `${firstName} ${middleName}` : firstName;
|
|
433
|
-
// Format date of birth to dd/mm/yyyy
|
|
434
|
-
let formattedDOB = '';
|
|
435
|
-
if (applicant.dateOfBirth) {
|
|
436
|
-
console.log('Applicant dateOfBirth:', applicant.dateOfBirth);
|
|
437
|
-
// Check if dateOfBirth is already a formatted string (DD/MM/YYYY)
|
|
438
|
-
if (typeof applicant.dateOfBirth === 'string' && /^\d{2}\/\d{2}\/\d{4}$/.test(applicant.dateOfBirth)) {
|
|
439
|
-
// Already in DD/MM/YYYY format
|
|
440
|
-
formattedDOB = applicant.dateOfBirth;
|
|
441
|
-
}
|
|
442
|
-
else {
|
|
443
|
-
// Try to parse as Date object or ISO string
|
|
444
|
-
try {
|
|
445
|
-
const date = new Date(applicant.dateOfBirth);
|
|
446
|
-
// Check if date is valid
|
|
447
|
-
if (!isNaN(date.getTime())) {
|
|
448
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
449
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
450
|
-
const year = date.getFullYear();
|
|
451
|
-
formattedDOB = `${day}/${month}/${year}`;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
catch (e) {
|
|
455
|
-
// Date parsing failed, try to use as-is if it's a string
|
|
456
|
-
if (typeof applicant.dateOfBirth === 'string') {
|
|
457
|
-
formattedDOB = applicant.dateOfBirth;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
// Format as "First and middle names, last name, Date of birth"
|
|
463
|
-
const result = `${fullFirstName}, ${lastName}, ${formattedDOB}`;
|
|
464
|
-
console.log('Formatted applicant result:', result);
|
|
465
|
-
return result;
|
|
466
|
-
}).filter((line) => line && line.trim() !== ', ,' && line.trim() !== '');
|
|
467
|
-
console.log('Final formattedApplicants:', formattedApplicants);
|
|
468
|
-
// Join all applicants with newline
|
|
469
|
-
const finalResult = formattedApplicants.join('\n');
|
|
470
|
-
console.log('Final result:', finalResult);
|
|
471
|
-
return finalResult;
|
|
472
|
-
}
|
|
473
|
-
else {
|
|
474
|
-
console.log('No applicants array found or empty array');
|
|
475
|
-
console.log('This means you need to populate the applicationId with applicants when querying');
|
|
476
|
-
console.log('Use: .populate({ path: "applicationId", populate: { path: "applicants" } })');
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
console.log('applicationId is not populated or not an object');
|
|
481
|
-
console.log('This means you need to populate the applicationId when querying');
|
|
482
|
-
console.log('Use: .populate("applicationId")');
|
|
483
|
-
}
|
|
484
|
-
// If application not populated or no applicants, return "N/A"
|
|
485
|
-
console.log('Returning N/A - no application or applicants found');
|
|
486
|
-
return 'N/A';
|
|
487
|
-
});
|
|
488
331
|
// Virtual property for broker name and firm
|
|
489
332
|
welcomeCallSchema.virtual('brokerNameAndFirm').get(function () {
|
|
490
333
|
// Access application from welcome call directly
|
|
@@ -658,5 +501,7 @@ welcomeCallSchema.virtual('initialRatePercentage').get(function () {
|
|
|
658
501
|
applyAuditMiddleware(welcomeCallSchema, "ApplicantWelcomeCall");
|
|
659
502
|
// Apply workflow plugin to the schema
|
|
660
503
|
applyWorkflowPlugin(welcomeCallSchema, 'applicantwelcomecall');
|
|
504
|
+
// Index for query optimization
|
|
505
|
+
welcomeCallSchema.index({ applicantId: 1, isActive: 1 }); // Compound index for getWelcomeCallByApplicantId and softDeleteByApplicantId queries
|
|
661
506
|
const WelcomeCallModel = mongoose.model('ApplicantWelcomeCall', welcomeCallSchema);
|
|
662
507
|
export default WelcomeCallModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+C,CAAC;AACpE,eAAe,cAAc,CAAC"}
|
|
@@ -236,5 +236,19 @@ applicantSchema.virtual('numberOfApplicants').get(function () {
|
|
|
236
236
|
applyAuditMiddleware(applicantSchema, "Applicant");
|
|
237
237
|
// Apply workflow plugin to the schema
|
|
238
238
|
applyWorkflowPlugin(applicantSchema, 'applicant');
|
|
239
|
+
// Database indexes for performance optimization
|
|
240
|
+
// Single field indexes
|
|
241
|
+
applicantSchema.index({ applicationId: 1 });
|
|
242
|
+
applicantSchema.index({ applicantId: 1 });
|
|
243
|
+
// Compound indexes
|
|
244
|
+
applicantSchema.index({ applicationId: 1, isExpenseOwner: 1 }); // For expense owner queries
|
|
245
|
+
applicantSchema.index({ applicationId: 1, _id: 1 }); // For application-scoped queries
|
|
246
|
+
// Indexes for lookup operations
|
|
247
|
+
applicantSchema.index({ nationalityLid: 1 });
|
|
248
|
+
applicantSchema.index({ countryOfResidenceLid: 1 });
|
|
249
|
+
applicantSchema.index({ maritalStatusLid: 1 });
|
|
250
|
+
applicantSchema.index({ residentialStatusLid: 1 });
|
|
251
|
+
applicantSchema.index({ addressCountryLid: 1 });
|
|
252
|
+
applicantSchema.index({ incomeSummaryId: 1 });
|
|
239
253
|
const ApplicantModel = mongoose.model("Applicant", applicantSchema);
|
|
240
254
|
export default ApplicantModel;
|
|
@@ -90,6 +90,8 @@ const virtualApplicants = applicationDirectDebitSchema.virtual('applicants', {
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
virtualApplicants.description = 'Full Name of the applicant';
|
|
93
|
+
// Index for applicationId queries
|
|
94
|
+
applicationDirectDebitSchema.index({ applicationId: 1 });
|
|
93
95
|
// Apply workflow plugin to the schema
|
|
94
96
|
applyWorkflowPlugin(applicationDirectDebitSchema, 'application_directdebit');
|
|
95
97
|
const ApplicationDirectDebitModel = mongoose.model("Application_DirectDebit", applicationDirectDebitSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-euc.model.d.ts","sourceRoot":"","sources":["../../applications/application-euc.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application-euc.model.d.ts","sourceRoot":"","sources":["../../applications/application-euc.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAoBhC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyD,CAAC;AACnF,eAAe,mBAAmB,CAAC"}
|
|
@@ -8,5 +8,7 @@ const applicationEucSchema = new mongoose.Schema({
|
|
|
8
8
|
});
|
|
9
9
|
// Apply workflow plugin to the schema
|
|
10
10
|
applyWorkflowPlugin(applicationEucSchema, 'applicationeuc');
|
|
11
|
+
// Add indexes that exist in database but missing from model
|
|
12
|
+
applicationEucSchema.index({ applicationId: 1 }, { unique: true }); // Unique index for applicationId
|
|
11
13
|
const ApplicationEucModel = mongoose.model("ApplicationEUC", applicationEucSchema);
|
|
12
14
|
export default ApplicationEucModel;
|
|
@@ -262,5 +262,7 @@ mortgageSchema.virtual("sourceOfWealth").get(function () {
|
|
|
262
262
|
});
|
|
263
263
|
// Apply workflow plugin to the schema
|
|
264
264
|
applyWorkflowPlugin(mortgageSchema, 'mortgage');
|
|
265
|
+
// Index for query optimization
|
|
266
|
+
mortgageSchema.index({ applicationId: 1 }); // Index for getByApplicationId queries
|
|
265
267
|
const MortgageModel = mongoose.model("Mortgage", mortgageSchema);
|
|
266
268
|
export default MortgageModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-note.model.d.ts","sourceRoot":"","sources":["../../applications/application-note.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application-note.model.d.ts","sourceRoot":"","sources":["../../applications/application-note.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAiHhC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA+C,CAAC;AACzE,eAAe,mBAAmB,CAAC"}
|
|
@@ -83,5 +83,23 @@ const noteSchema = new mongoose.Schema({
|
|
|
83
83
|
});
|
|
84
84
|
// Apply workflow plugin to the schema
|
|
85
85
|
applyWorkflowPlugin(noteSchema, 'applictionnote');
|
|
86
|
+
// Database indexes for performance optimization
|
|
87
|
+
// Existing indexes
|
|
88
|
+
noteSchema.index({ applicationId: 1 });
|
|
89
|
+
noteSchema.index({ noteId: 1 });
|
|
90
|
+
noteSchema.index({ createdByUserId: 1 });
|
|
91
|
+
noteSchema.index({ noteTypeLid: 1 });
|
|
92
|
+
noteSchema.index({ noteSubTypeLid: 1 });
|
|
93
|
+
noteSchema.index({
|
|
94
|
+
applicationId: 1,
|
|
95
|
+
noteId: 1
|
|
96
|
+
});
|
|
97
|
+
// Additional recommended indexes for query patterns
|
|
98
|
+
// Compound indexes for primary query patterns
|
|
99
|
+
noteSchema.index({ applicationId: 1, createdOn: -1 }); // Primary query pattern with sort
|
|
100
|
+
noteSchema.index({ applicationId: 1, noteTypeLid: 1 }); // For filtering by type
|
|
101
|
+
noteSchema.index({ applicationId: 1, createdBy: 1 }); // For filtering by creator
|
|
102
|
+
// Single field indexes for distinct and filter operations
|
|
103
|
+
noteSchema.index({ createdBy: 1 }); // For distinct operations and creator filtering
|
|
86
104
|
const ApplictionNoteModel = mongoose.model("ApplictionNote", noteSchema);
|
|
87
105
|
export default ApplictionNoteModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-product.model.d.ts","sourceRoot":"","sources":["../../applications/application-product.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application-product.model.d.ts","sourceRoot":"","sources":["../../applications/application-product.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA6FhC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA2C,CAAC;AAC9D,eAAe,YAAY,CAAC"}
|
|
@@ -77,5 +77,8 @@ productSchema.virtual('productFeePaymentType').get(function () {
|
|
|
77
77
|
});
|
|
78
78
|
// Apply workflow plugin to the schema
|
|
79
79
|
applyWorkflowPlugin(productSchema, 'product');
|
|
80
|
+
// Indexes for query optimization
|
|
81
|
+
productSchema.index({ applicationId: 1 }); // Index for updateByApplicationId and getByApplicationIdWithRepaymentType queries
|
|
82
|
+
productSchema.index({ repaymentTypeLid: 1 }); // Index for populate operations on repaymentTypeLid
|
|
80
83
|
const ProductModel = mongoose.model("Product", productSchema);
|
|
81
84
|
export default ProductModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.model.d.ts","sourceRoot":"","sources":["../../applications/application.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application.model.d.ts","sourceRoot":"","sources":["../../applications/application.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAsPhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmD,CAAC;AAC1E,eAAe,gBAAgB,CAAC"}
|
|
@@ -206,5 +206,16 @@ applicationSchema.virtual('taskCompletionPercent').get(function () {
|
|
|
206
206
|
// Calculate (lender/total)*100
|
|
207
207
|
return Number(((lender / total) * 100).toFixed(2));
|
|
208
208
|
});
|
|
209
|
+
// Database indexes for performance optimization
|
|
210
|
+
// Single field indexes
|
|
211
|
+
applicationSchema.index({ applicationId: 1 });
|
|
212
|
+
applicationSchema.index({ assignedToUserId: 1 });
|
|
213
|
+
applicationSchema.index({ brokerId: 1 });
|
|
214
|
+
applicationSchema.index({ applicants: 1 }); // For array membership queries
|
|
215
|
+
// Compound indexes for common query combinations
|
|
216
|
+
applicationSchema.index({ applicants: 1, _id: 1 }); // For finding application by applicant
|
|
217
|
+
applicationSchema.index({ assignedToUserId: 1, statusLid: 1 }); // For filtering by assignee and status
|
|
218
|
+
// Text index for search functionality
|
|
219
|
+
applicationSchema.index({ applicationNumber: "text" });
|
|
209
220
|
const ApplicationModel = mongoose.model("Application", applicationSchema);
|
|
210
221
|
export default ApplicationModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications-task.model.d.ts","sourceRoot":"","sources":["../../applications/applications-task.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"applications-task.model.d.ts","sourceRoot":"","sources":["../../applications/applications-task.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA+ChC,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6D,CAAC;AACzF,eAAe,qBAAqB,CAAC"}
|
|
@@ -38,5 +38,8 @@ const applicationsTaskSchema = new mongoose.Schema({
|
|
|
38
38
|
applyAuditMiddleware(applicationsTaskSchema, "ApplicationsTask");
|
|
39
39
|
// Apply workflow plugin to the schema
|
|
40
40
|
applyWorkflowPlugin(applicationsTaskSchema, 'applicationstask');
|
|
41
|
+
// Indexes for query optimization
|
|
42
|
+
applicationsTaskSchema.index({ applicationId: 1, instanceId: 1 }); // Compound index for findByApplicationIdAndInstanceId queries
|
|
43
|
+
applicationsTaskSchema.index({ applicationId: 1, createdOn: -1 }); // Compound index for findAll with sort by createdOn descending
|
|
41
44
|
const ApplicationsTaskModel = mongoose.model("ApplicationsTask", applicationsTaskSchema);
|
|
42
45
|
export default ApplicationsTaskModel;
|