@dynamatix/gb-schemas 2.3.281 → 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 -86
- 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,91 +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;
|
|
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;
|
|
585
|
-
console.log('Product from productId:', product);
|
|
586
|
-
}
|
|
587
|
-
// Get finance term from productId if available
|
|
588
|
-
if (application.productId && typeof application.productId === 'object') {
|
|
589
|
-
if (application.productId.numberOfYearsToRepay) {
|
|
590
|
-
financeTerm = `${application.productId.numberOfYearsToRepay} year finance term`;
|
|
591
|
-
console.log('Finance term from productId:', financeTerm);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
else {
|
|
595
|
-
console.log('No productId found or not populated');
|
|
596
|
-
}
|
|
597
|
-
// Note: productFeatures is a separate collection that needs to be populated in form configuration
|
|
598
|
-
// If you need productFeatures data, it should be populated separately in the form config
|
|
599
|
-
// Get rental income from mortgage - mortgageId is at application level
|
|
600
|
-
let mortgage = null;
|
|
601
|
-
if (application.mortgageId && typeof application.mortgageId === 'object') {
|
|
602
|
-
mortgage = application.mortgageId;
|
|
603
|
-
}
|
|
604
|
-
if (mortgage) {
|
|
605
|
-
console.log('Mortgage data:', JSON.stringify(mortgage, null, 2));
|
|
606
|
-
if (mortgage.monthlyRentalIncome) {
|
|
607
|
-
// Format the rental income value
|
|
608
|
-
const rentalValue = typeof mortgage.monthlyRentalIncome === 'string'
|
|
609
|
-
? mortgage.monthlyRentalIncome
|
|
610
|
-
: mortgage.monthlyRentalIncome.toString();
|
|
611
|
-
rentalIncome = `£${rentalValue}`;
|
|
612
|
-
console.log('Rental income:', rentalIncome);
|
|
613
|
-
}
|
|
614
|
-
// Get occupancy information from mortgage
|
|
615
|
-
if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids)) {
|
|
616
|
-
// Get the first proposed tenant type
|
|
617
|
-
const firstTenant = mortgage.proposedTenantsLids[0];
|
|
618
|
-
if (firstTenant && typeof firstTenant === 'object' && firstTenant.name) {
|
|
619
|
-
occupancy = firstTenant.name;
|
|
620
|
-
console.log('Occupancy:', occupancy);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
else {
|
|
625
|
-
console.log('No mortgageId found or not populated');
|
|
626
|
-
}
|
|
627
|
-
// Create HTML content
|
|
628
|
-
const summaryContent = `
|
|
629
|
-
<div><p class="text-bold">Product:</p> <span>${product}</span></div>
|
|
630
|
-
<div><p class="text-bold">Finance Term:</p> <span>${financeTerm}</span></div>
|
|
631
|
-
<div><p class="text-bold">Monthly Finance:</p> <span>${monthlyFinance}</span></div>
|
|
632
|
-
<div><p class="text-bold">Rental Income:</p> <span>${rentalIncome}</span></div>
|
|
633
|
-
<div><p class="text-bold">Occupancy:</p> <span>${occupancy}</span></div>
|
|
634
|
-
`;
|
|
635
|
-
console.log('Final summary content:', summaryContent);
|
|
636
|
-
return summaryContent;
|
|
637
|
-
}
|
|
638
|
-
console.log('No application found');
|
|
639
|
-
return 'N/A';
|
|
640
|
-
});
|
|
641
562
|
applyAuditMiddleware(welcomeCallSchema, "ApplicantWelcomeCall");
|
|
642
563
|
// Apply workflow plugin to the schema
|
|
643
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,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