@dynamatix/gb-schemas 2.3.281 → 2.3.283
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.
|
@@ -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;AAosBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
|
|
@@ -269,6 +269,9 @@ welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
|
|
|
269
269
|
if (employment.employerName && employment.employerName.trim() !== '') {
|
|
270
270
|
return employment.employerName;
|
|
271
271
|
}
|
|
272
|
+
else {
|
|
273
|
+
return '';
|
|
274
|
+
}
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
277
|
// Check if it's self-employed or solo trader status - compare by name for stability
|
|
@@ -281,6 +284,9 @@ welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
|
|
|
281
284
|
if (selfEmployment.nameOfBusiness && selfEmployment.nameOfBusiness.trim() !== '') {
|
|
282
285
|
return selfEmployment.nameOfBusiness;
|
|
283
286
|
}
|
|
287
|
+
else {
|
|
288
|
+
return '';
|
|
289
|
+
}
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
292
|
}
|
|
@@ -570,11 +576,11 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(function () {
|
|
|
570
576
|
if (application) {
|
|
571
577
|
console.log('Application data:', JSON.stringify(application, null, 2));
|
|
572
578
|
// Initialize summary data
|
|
573
|
-
let product = '
|
|
574
|
-
let financeTerm = '
|
|
575
|
-
let monthlyFinance = '
|
|
576
|
-
let rentalIncome = '
|
|
577
|
-
let occupancy = '
|
|
579
|
+
let product = '';
|
|
580
|
+
let financeTerm = '';
|
|
581
|
+
let monthlyFinance = '';
|
|
582
|
+
let rentalIncome = '';
|
|
583
|
+
let occupancy = '';
|
|
578
584
|
// Get product information (first 3 characters)
|
|
579
585
|
if (application.selectedProduct && typeof application.selectedProduct === 'string') {
|
|
580
586
|
product = application.selectedProduct;
|
|
@@ -586,7 +592,7 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(function () {
|
|
|
586
592
|
}
|
|
587
593
|
// Get finance term from productId if available
|
|
588
594
|
if (application.productId && typeof application.productId === 'object') {
|
|
589
|
-
if (application.productId.numberOfYearsToRepay) {
|
|
595
|
+
if (application.productId.numberOfYearsToRepay !== undefined && application.productId.numberOfYearsToRepay !== null) {
|
|
590
596
|
financeTerm = `${application.productId.numberOfYearsToRepay} year finance term`;
|
|
591
597
|
console.log('Finance term from productId:', financeTerm);
|
|
592
598
|
}
|
|
@@ -603,7 +609,8 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(function () {
|
|
|
603
609
|
}
|
|
604
610
|
if (mortgage) {
|
|
605
611
|
console.log('Mortgage data:', JSON.stringify(mortgage, null, 2));
|
|
606
|
-
if (
|
|
612
|
+
// Get rental income - check if it exists (even if 0)
|
|
613
|
+
if (mortgage.monthlyRentalIncome !== undefined && mortgage.monthlyRentalIncome !== null) {
|
|
607
614
|
// Format the rental income value
|
|
608
615
|
const rentalValue = typeof mortgage.monthlyRentalIncome === 'string'
|
|
609
616
|
? mortgage.monthlyRentalIncome
|
|
@@ -611,19 +618,27 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(function () {
|
|
|
611
618
|
rentalIncome = `£${rentalValue}`;
|
|
612
619
|
console.log('Rental income:', rentalIncome);
|
|
613
620
|
}
|
|
621
|
+
// Get finance amount from loanRequired
|
|
622
|
+
if (mortgage.loanRequired !== undefined && mortgage.loanRequired !== null) {
|
|
623
|
+
const financeValue = typeof mortgage.loanRequired === 'string'
|
|
624
|
+
? mortgage.loanRequired
|
|
625
|
+
: mortgage.loanRequired.toString();
|
|
626
|
+
monthlyFinance = `£${financeValue}`;
|
|
627
|
+
console.log('Monthly finance (loanRequired):', monthlyFinance);
|
|
628
|
+
}
|
|
614
629
|
// Get occupancy information from mortgage
|
|
615
|
-
if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids)) {
|
|
630
|
+
if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids) && mortgage.proposedTenantsLids.length > 0) {
|
|
616
631
|
// Get the first proposed tenant type
|
|
617
632
|
const firstTenant = mortgage.proposedTenantsLids[0];
|
|
618
633
|
if (firstTenant && typeof firstTenant === 'object' && firstTenant.name) {
|
|
619
634
|
occupancy = firstTenant.name;
|
|
620
635
|
console.log('Occupancy:', occupancy);
|
|
621
636
|
}
|
|
637
|
+
else {
|
|
638
|
+
occupancy = '-';
|
|
639
|
+
}
|
|
622
640
|
}
|
|
623
641
|
}
|
|
624
|
-
else {
|
|
625
|
-
console.log('No mortgageId found or not populated');
|
|
626
|
-
}
|
|
627
642
|
// Create HTML content
|
|
628
643
|
const summaryContent = `
|
|
629
644
|
<div><p class="text-bold">Product:</p> <span>${product}</span></div>
|