@dynamatix/gb-schemas 2.3.286 → 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.
Files changed (27) hide show
  1. package/README.md +308 -308
  2. package/dist/applicants/applicant-welcome-call.model.d.ts.map +1 -1
  3. package/dist/applicants/applicant-welcome-call.model.js +13 -104
  4. package/dist/applicants/applicant-welcome-call.type.d.ts +0 -12
  5. package/dist/applicants/applicant-welcome-call.type.d.ts.map +1 -1
  6. package/dist/applications/application-valuation-report.model.d.ts +232 -2914
  7. package/dist/applications/application-valuation-report.model.d.ts.map +1 -1
  8. package/dist/applications/application-valuation-report.model.js +20 -16
  9. package/dist/shared/workflow-trigger.model.d.ts.map +1 -1
  10. package/dist/shared/workflow-trigger.model.js +4 -0
  11. package/dist/shared/workflow-trigger.type.d.ts +1 -0
  12. package/dist/shared/workflow-trigger.type.d.ts.map +1 -1
  13. package/package.json +86 -86
  14. package/dist/applicants/applicant-income-source.model.d.ts +0 -26
  15. package/dist/applicants/applicant-income-source.model.d.ts.map +0 -1
  16. package/dist/applicants/applicant-income.model.d.ts +0 -160
  17. package/dist/applicants/applicant-income.model.d.ts.map +0 -1
  18. package/dist/applicants/applicant-other-income.model.d.ts +0 -85
  19. package/dist/applicants/applicant-other-income.model.d.ts.map +0 -1
  20. package/dist/applications/application-document.model.d.ts +0 -158
  21. package/dist/applications/application-document.model.d.ts.map +0 -1
  22. package/dist/applications/document.model.d.ts +0 -158
  23. package/dist/applications/document.model.d.ts.map +0 -1
  24. package/dist/applications/productfeatures.model.d.ts +0 -368
  25. package/dist/applications/productfeatures.model.d.ts.map +0 -1
  26. package/dist/shared/document-type-model.d.ts +0 -48
  27. 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
- countryName,
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
- else {
273
- return '';
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
- else {
288
- return '';
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, index) => {
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
- const isLast = index === otherApplicants.length - 1;
383
- const comma = isLast ? '' : ',';
384
- // Format as an HTML line (with bold labels and inline values)
385
- return `
386
- <div class="applicant-line">
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,91 +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
- console.log(mortgage.loanRequired, 'loan required');
622
- console.log(mortgage, 'mortgage');
623
- // Get finance amount from loanRequired
624
- if (mortgage.loanRequired !== undefined && mortgage.loanRequired !== null) {
625
- const numericValue = Number(mortgage.loanRequired);
626
- const financeValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
627
- monthlyFinance = `£${financeValue}`;
628
- }
629
- // Get occupancy information from mortgage
630
- if (mortgage.proposedTenantsLids && Array.isArray(mortgage.proposedTenantsLids) && mortgage.proposedTenantsLids.length > 0) {
631
- // Get the first proposed tenant type
632
- const firstTenant = mortgage.proposedTenantsLids[0];
633
- if (firstTenant && typeof firstTenant === 'object' && firstTenant.name) {
634
- occupancy = firstTenant.name;
635
- }
636
- }
637
- else {
638
- occupancy = '-';
639
- }
640
- }
641
- // Create HTML content
642
- const summaryContent = `
643
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Product:</p> <span class="readonly-data">${product}</span></div>
644
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Finance Term:</p> <span class="readonly-data">${financeTerm}</span></div>
645
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Monthly Finance:</p> <span class="readonly-data">${monthlyFinance}</span></div>
646
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Rental Income:</p> <span class="readonly-data">${rentalIncome}</span></div>
647
- <div class="flex align-items-center mb-2"><p class="text-bold m-0 readonly-data">Occupancy:</p> <span class="readonly-data">${occupancy}</span></div>
648
- `;
649
- return summaryContent;
650
- }
651
- return '-';
652
- });
653
562
  applyAuditMiddleware(welcomeCallSchema, "ApplicantWelcomeCall");
654
563
  // Apply workflow plugin to the schema
655
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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