@dynamatix/gb-schemas 2.3.287 → 2.3.288
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-welcome-call.model.d.ts.map +1 -1
- package/dist/applicants/applicant-welcome-call.model.js +13 -102
- package/dist/applicants/applicant-welcome-call.type.d.ts +0 -12
- package/dist/applicants/applicant-welcome-call.type.d.ts.map +1 -1
- package/dist/applications/application-valuation-report.model.d.ts +232 -2914
- package/dist/applications/application-valuation-report.model.d.ts.map +1 -1
- package/dist/applications/application-valuation-report.model.js +20 -16
- package/dist/shared/workflow-trigger.model.d.ts.map +1 -1
- package/dist/shared/workflow-trigger.model.js +4 -0
- package/dist/shared/workflow-trigger.type.d.ts +1 -0
- package/dist/shared/workflow-trigger.type.d.ts.map +1 -1
- 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
|
@@ -237,7 +237,7 @@ welcomeCallSchema.virtual('customerCurrentResidentialAddress').get(function () {
|
|
|
237
237
|
applicant.addressLine2,
|
|
238
238
|
applicant.addressLine3,
|
|
239
239
|
applicant.addressCity,
|
|
240
|
-
|
|
240
|
+
applicant.propertyAddressCountry,
|
|
241
241
|
applicant.addressPostCode
|
|
242
242
|
].filter(part => part && part.trim() !== '');
|
|
243
243
|
return addressParts.join(', ');
|
|
@@ -266,12 +266,12 @@ welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
|
|
|
266
266
|
// Check employment information
|
|
267
267
|
if (applicant.employmentInformationId && typeof applicant.employmentInformationId === 'object') {
|
|
268
268
|
const employment = applicant.employmentInformationId;
|
|
269
|
+
// If field exists, return the value (or empty string if null/empty)
|
|
269
270
|
if (employment.employerName && employment.employerName.trim() !== '') {
|
|
270
271
|
return employment.employerName;
|
|
271
272
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
273
|
+
// Field exists but no data - return empty string
|
|
274
|
+
return '';
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
// Check if it's self-employed or solo trader status - compare by name for stability
|
|
@@ -281,12 +281,12 @@ welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
|
|
|
281
281
|
// Check self-employment information
|
|
282
282
|
if (applicant.selfEmployedInformationId && typeof applicant.selfEmployedInformationId === 'object') {
|
|
283
283
|
const selfEmployment = applicant.selfEmployedInformationId;
|
|
284
|
+
// If field exists, return the value (or empty string if null/empty)
|
|
284
285
|
if (selfEmployment.nameOfBusiness && selfEmployment.nameOfBusiness.trim() !== '') {
|
|
285
286
|
return selfEmployment.nameOfBusiness;
|
|
286
287
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
288
|
+
// Field exists but no data - return empty string
|
|
289
|
+
return '';
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
}
|
|
@@ -341,7 +341,7 @@ welcomeCallSchema.virtual('otherApplicantsNameAndDOB').get(function () {
|
|
|
341
341
|
return 'N/A';
|
|
342
342
|
}
|
|
343
343
|
// Format each other applicant as: "First and middle names, last name, Date of birth"
|
|
344
|
-
const formattedApplicants = otherApplicants.map((applicant
|
|
344
|
+
const formattedApplicants = otherApplicants.map((applicant) => {
|
|
345
345
|
// Check if applicant is an ObjectId (not populated)
|
|
346
346
|
if (typeof applicant === 'string' || (applicant.constructor && applicant.constructor.name === 'ObjectId')) {
|
|
347
347
|
return null; // Skip unpopulated references
|
|
@@ -379,17 +379,11 @@ welcomeCallSchema.virtual('otherApplicantsNameAndDOB').get(function () {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
<span class="readonly-data">${fullFirstName}, ${lastName}, ${formattedDOB}${comma}</span>
|
|
388
|
-
</div>
|
|
389
|
-
`;
|
|
390
|
-
}).filter((line) => line && line.trim() !== '');
|
|
391
|
-
// Join all applicants as HTML (no \n needed)
|
|
392
|
-
return formattedApplicants.join('');
|
|
382
|
+
// Format as "First and middle names, last name, Date of birth"
|
|
383
|
+
return `${fullFirstName}, ${lastName}, ${formattedDOB}`;
|
|
384
|
+
}).filter((line) => line && line.trim() !== ', ,' && line.trim() !== '');
|
|
385
|
+
// Join all applicants with newline
|
|
386
|
+
return formattedApplicants.join('\n');
|
|
393
387
|
}
|
|
394
388
|
}
|
|
395
389
|
// If application not populated or no applicants, return "N/A"
|
|
@@ -565,89 +559,6 @@ welcomeCallSchema.virtual('initialRatePercentage').get(function () {
|
|
|
565
559
|
}
|
|
566
560
|
return null;
|
|
567
561
|
});
|
|
568
|
-
// Virtual property for finance summary HTML
|
|
569
|
-
welcomeCallSchema.virtual('financeSummaryHtml').get(function () {
|
|
570
|
-
let application = null;
|
|
571
|
-
if (this.applicantId && typeof this.applicantId === 'object' && !(typeof this.applicantId.toHexString === 'function') && this.applicantId.applicationId) {
|
|
572
|
-
application = this.applicantId.applicationId;
|
|
573
|
-
}
|
|
574
|
-
else if (this.applicationId && typeof this.applicationId === 'object') {
|
|
575
|
-
application = this.applicationId;
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
return '-';
|
|
579
|
-
}
|
|
580
|
-
if (application) {
|
|
581
|
-
// Initialize summary data
|
|
582
|
-
let product = '';
|
|
583
|
-
let financeTerm = '';
|
|
584
|
-
let monthlyFinance = '';
|
|
585
|
-
let rentalIncome = '';
|
|
586
|
-
let occupancy = '';
|
|
587
|
-
// Get product information (first 3 characters)
|
|
588
|
-
if (application.selectedProduct && typeof application.selectedProduct === 'string') {
|
|
589
|
-
const extracted = application.selectedProduct.split('(')[0].trim();
|
|
590
|
-
product = `${extracted} product`;
|
|
591
|
-
}
|
|
592
|
-
else if (application.productId && typeof application.productId === 'object' && application.productId.selectedProduct) {
|
|
593
|
-
const extracted = application.productId.selectedProduct.split('(')[0].trim();
|
|
594
|
-
product = `${extracted} product`;
|
|
595
|
-
}
|
|
596
|
-
else {
|
|
597
|
-
product = '-';
|
|
598
|
-
}
|
|
599
|
-
// Get finance term from productId if available
|
|
600
|
-
if (application.productId && typeof application.productId === 'object') {
|
|
601
|
-
if (application.productId.numberOfYearsToRepay !== undefined && application.productId.numberOfYearsToRepay !== null) {
|
|
602
|
-
financeTerm = `${application.productId.numberOfYearsToRepay} year finance term`;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
else {
|
|
606
|
-
financeTerm = '-';
|
|
607
|
-
}
|
|
608
|
-
// Get rental income from mortgage - mortgageId is at application level
|
|
609
|
-
let mortgage = null;
|
|
610
|
-
if (application.mortgageId && typeof application.mortgageId === 'object') {
|
|
611
|
-
mortgage = application.mortgageId;
|
|
612
|
-
}
|
|
613
|
-
if (mortgage) {
|
|
614
|
-
// Get rental income - check if it exists (even if 0)
|
|
615
|
-
if (mortgage.monthlyRentalIncome !== undefined && mortgage.monthlyRentalIncome !== null) {
|
|
616
|
-
// Convert to number first, then format
|
|
617
|
-
const numericValue = Number(mortgage.monthlyRentalIncome);
|
|
618
|
-
const rentalValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
|
|
619
|
-
rentalIncome = `£${rentalValue}`;
|
|
620
|
-
}
|
|
621
|
-
// Get finance amount from loanRequired
|
|
622
|
-
if (mortgage.loanRequired !== undefined && mortgage.loanRequired !== null) {
|
|
623
|
-
const numericValue = Number(mortgage.loanRequired);
|
|
624
|
-
const financeValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
|
|
625
|
-
monthlyFinance = `£${financeValue}`;
|
|
626
|
-
}
|
|
627
|
-
// Get occupancy information from mortgage
|
|
628
|
-
if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids) && mortgage.proposedTenantsLids.length > 0) {
|
|
629
|
-
// Get the first proposed tenant type
|
|
630
|
-
const firstTenant = mortgage.proposedTenantsLids[0];
|
|
631
|
-
if (firstTenant && typeof firstTenant === 'object' && firstTenant.name) {
|
|
632
|
-
occupancy = firstTenant.name;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
occupancy = '-';
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
// Create HTML content
|
|
640
|
-
const summaryContent = `
|
|
641
|
-
<div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Product:</p> <span class="readonly-data ml-2">${product}</span></div>
|
|
642
|
-
<div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Finance Term:</p> <span class="readonly-data ml-2">${financeTerm}</span></div>
|
|
643
|
-
<div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Monthly Finance:</p> <span class="readonly-data ml-2">${monthlyFinance}</span></div>
|
|
644
|
-
<div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Rental Income:</p> <span class="readonly-data ml-2">${rentalIncome}</span></div>
|
|
645
|
-
<div class="flex align-items-center"><p class="text-bold m-0 readonly-data">Occupancy:</p> <span class="readonly-data ml-2">${occupancy}</span></div>
|
|
646
|
-
`;
|
|
647
|
-
return summaryContent;
|
|
648
|
-
}
|
|
649
|
-
return '-';
|
|
650
|
-
});
|
|
651
562
|
applyAuditMiddleware(welcomeCallSchema, "ApplicantWelcomeCall");
|
|
652
563
|
// Apply workflow plugin to the schema
|
|
653
564
|
applyWorkflowPlugin(welcomeCallSchema, 'applicantwelcomecall');
|
|
@@ -62,17 +62,5 @@ export default interface IApplicantWelcomeCall extends IBaseType {
|
|
|
62
62
|
customerQuestions?: string;
|
|
63
63
|
underwriterName?: string;
|
|
64
64
|
finalCallCompletedDate?: string;
|
|
65
|
-
fullName?: string;
|
|
66
|
-
customerCurrentResidentialAddress?: string;
|
|
67
|
-
applicantEmployerBusinessName?: string;
|
|
68
|
-
customerContactNumbers?: string;
|
|
69
|
-
otherApplicantsNameAndDOB?: string;
|
|
70
|
-
brokerNameAndFirm?: string;
|
|
71
|
-
accountHolderAndBank?: string;
|
|
72
|
-
customerPropertyAddress?: string;
|
|
73
|
-
applicantEmployer?: string;
|
|
74
|
-
productName?: string;
|
|
75
|
-
initialRatePercentage?: string;
|
|
76
|
-
financeSummaryHtml?: string;
|
|
77
65
|
}
|
|
78
66
|
//# sourceMappingURL=applicant-welcome-call.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-welcome-call.type.d.ts","sourceRoot":"","sources":["../../applicants/applicant-welcome-call.type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,MAAM,CAAC,OAAO,WAAW,qBAAsB,SAAQ,SAAS;IAC5D,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,a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