@dynamatix/gb-schemas 2.3.280 → 2.3.282
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 +7 -92
- 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,9 +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
|
}
|
|
273
|
+
// Field exists but no data - return empty string
|
|
274
|
+
return '';
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
277
|
// Check if it's self-employed or solo trader status - compare by name for stability
|
|
@@ -278,9 +281,12 @@ welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
|
|
|
278
281
|
// Check self-employment information
|
|
279
282
|
if (applicant.selfEmployedInformationId && typeof applicant.selfEmployedInformationId === 'object') {
|
|
280
283
|
const selfEmployment = applicant.selfEmployedInformationId;
|
|
284
|
+
// If field exists, return the value (or empty string if null/empty)
|
|
281
285
|
if (selfEmployment.nameOfBusiness && selfEmployment.nameOfBusiness.trim() !== '') {
|
|
282
286
|
return selfEmployment.nameOfBusiness;
|
|
283
287
|
}
|
|
288
|
+
// Field exists but no data - return empty string
|
|
289
|
+
return '';
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
292
|
}
|
|
@@ -553,97 +559,6 @@ welcomeCallSchema.virtual('initialRatePercentage').get(function () {
|
|
|
553
559
|
}
|
|
554
560
|
return null;
|
|
555
561
|
});
|
|
556
|
-
// Virtual property for finance summary HTML
|
|
557
|
-
welcomeCallSchema.virtual('financeSummaryHtml').get(function () {
|
|
558
|
-
console.log('financeSummaryHtml virtual field called');
|
|
559
|
-
let application = null;
|
|
560
|
-
if (this.applicantId && typeof this.applicantId === 'object' && !(typeof this.applicantId.toHexString === 'function') && this.applicantId.applicationId) {
|
|
561
|
-
application = this.applicantId.applicationId;
|
|
562
|
-
}
|
|
563
|
-
else if (this.applicationId && typeof this.applicationId === 'object') {
|
|
564
|
-
application = this.applicationId;
|
|
565
|
-
}
|
|
566
|
-
else {
|
|
567
|
-
console.log('No application found');
|
|
568
|
-
return 'N/A';
|
|
569
|
-
}
|
|
570
|
-
if (application) {
|
|
571
|
-
console.log('Application data:', JSON.stringify(application, null, 2));
|
|
572
|
-
// Initialize summary data
|
|
573
|
-
let product = 'N/A';
|
|
574
|
-
let financeTerm = 'N/A';
|
|
575
|
-
let monthlyFinance = 'N/A';
|
|
576
|
-
let rentalIncome = 'N/A';
|
|
577
|
-
let occupancy = 'N/A';
|
|
578
|
-
// Get product information (first 3 characters)
|
|
579
|
-
if (application.selectedProduct && typeof application.selectedProduct === 'string') {
|
|
580
|
-
product = application.selectedProduct.substring(0, 3);
|
|
581
|
-
console.log('Product from selectedProduct:', product);
|
|
582
|
-
}
|
|
583
|
-
else if (application.productId && typeof application.productId === 'object' && application.productId.selectedProduct) {
|
|
584
|
-
product = application.productId.selectedProduct.substring(0, 3);
|
|
585
|
-
console.log('Product from productId:', product);
|
|
586
|
-
}
|
|
587
|
-
// Get finance term from product features - check if productFeatures is populated
|
|
588
|
-
if (application.productFeatures && typeof application.productFeatures === 'object') {
|
|
589
|
-
const productFeatures = application.productFeatures;
|
|
590
|
-
console.log('Product features:', JSON.stringify(productFeatures, null, 2));
|
|
591
|
-
// Get fixed term
|
|
592
|
-
if (productFeatures.fixedTerm) {
|
|
593
|
-
financeTerm = `${productFeatures.fixedTerm} year finance term`;
|
|
594
|
-
console.log('Finance term:', financeTerm);
|
|
595
|
-
}
|
|
596
|
-
// Get monthly finance from repayment
|
|
597
|
-
if (productFeatures.repayment) {
|
|
598
|
-
monthlyFinance = `£${productFeatures.repayment}`;
|
|
599
|
-
console.log('Monthly finance:', monthlyFinance);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
603
|
-
console.log('No productFeatures found or not populated');
|
|
604
|
-
}
|
|
605
|
-
// Get rental income from mortgage
|
|
606
|
-
if (application.mortgageId && typeof application.mortgageId === 'object') {
|
|
607
|
-
const mortgage = application.mortgageId;
|
|
608
|
-
console.log('Mortgage data:', JSON.stringify(mortgage, null, 2));
|
|
609
|
-
if (mortgage.monthlyRentalIncome) {
|
|
610
|
-
// Format the rental income value
|
|
611
|
-
const rentalValue = typeof mortgage.monthlyRentalIncome === 'string'
|
|
612
|
-
? mortgage.monthlyRentalIncome
|
|
613
|
-
: mortgage.monthlyRentalIncome.toString();
|
|
614
|
-
rentalIncome = `£${rentalValue}`;
|
|
615
|
-
console.log('Rental income:', rentalIncome);
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
console.log('No mortgageId found or not populated');
|
|
620
|
-
}
|
|
621
|
-
// Get occupancy information from mortgage
|
|
622
|
-
if (application.mortgageId && typeof application.mortgageId === 'object') {
|
|
623
|
-
const mortgage = application.mortgageId;
|
|
624
|
-
if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids)) {
|
|
625
|
-
// Get the first proposed tenant type
|
|
626
|
-
const firstTenant = mortgage.proposedTenantsLids[0];
|
|
627
|
-
if (firstTenant && typeof firstTenant === 'object' && firstTenant.name) {
|
|
628
|
-
occupancy = firstTenant.name;
|
|
629
|
-
console.log('Occupancy:', occupancy);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
// Create HTML content
|
|
634
|
-
const summaryContent = `
|
|
635
|
-
<div><p class="text-bold">Product:</p> <span>${product}</span></div>
|
|
636
|
-
<div><p class="text-bold">Finance Term:</p> <span>${financeTerm}</span></div>
|
|
637
|
-
<div><p class="text-bold">Monthly Finance:</p> <span>${monthlyFinance}</span></div>
|
|
638
|
-
<div><p class="text-bold">Rental Income:</p> <span>${rentalIncome}</span></div>
|
|
639
|
-
<div><p class="text-bold">Occupancy:</p> <span>${occupancy}</span></div>
|
|
640
|
-
`;
|
|
641
|
-
console.log('Final summary content:', summaryContent);
|
|
642
|
-
return summaryContent;
|
|
643
|
-
}
|
|
644
|
-
console.log('No application found');
|
|
645
|
-
return 'N/A';
|
|
646
|
-
});
|
|
647
562
|
applyAuditMiddleware(welcomeCallSchema, "ApplicantWelcomeCall");
|
|
648
563
|
// Apply workflow plugin to the schema
|
|
649
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,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