@dynamatix/gb-schemas 2.3.298 → 2.3.300

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;AAwtBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,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;AAmuBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
@@ -617,11 +617,21 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
617
617
  mortgage = application.mortgageId;
618
618
  }
619
619
  if (mortgage) {
620
+ // Helper function to format currency with commas
621
+ const formatCurrency = (value) => {
622
+ if (isNaN(value) || value === null || value === undefined) {
623
+ return '0.00';
624
+ }
625
+ return value.toLocaleString('en-GB', {
626
+ minimumFractionDigits: 2,
627
+ maximumFractionDigits: 2
628
+ });
629
+ };
620
630
  // Get rental income - check if it exists (even if 0)
621
631
  if (mortgage.monthlyRentalIncome !== undefined && mortgage.monthlyRentalIncome !== null) {
622
632
  // Convert to number first, then format
623
633
  const numericValue = Number(mortgage.monthlyRentalIncome);
624
- const rentalValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
634
+ const rentalValue = isNaN(numericValue) ? '0.00' : formatCurrency(numericValue);
625
635
  rentalIncome = `£${rentalValue}`;
626
636
  }
627
637
  // Get monthly repayment amount from productFeatures collection
@@ -632,7 +642,7 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
632
642
  });
633
643
  if (productFeatures && productFeatures.repayment !== undefined && productFeatures.repayment !== null) {
634
644
  const numericValue = Number(productFeatures.repayment);
635
- const repaymentValue = isNaN(numericValue) ? '0.00' : numericValue.toFixed(2);
645
+ const repaymentValue = isNaN(numericValue) ? '0.00' : formatCurrency(numericValue);
636
646
  monthlyRepayment = `£${repaymentValue}`;
637
647
  }
638
648
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "2.3.298",
3
+ "version": "2.3.300",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "homepage": "https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas#readme",
38
38
  "dependencies": {
39
- "@dynamatix/cat-shared": "^0.0.129",
39
+ "@dynamatix/cat-shared": "^0.0.130",
40
40
  "dotenv": "^16.4.5",
41
41
  "mongodb": "^6.14.2",
42
42
  "mongoose": "^8.9.5"