@dynamatix/gb-schemas 2.3.264 → 2.3.266

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;AA4kBhC,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;AAymBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
@@ -238,8 +238,7 @@ welcomeCallSchema.virtual('customerCurrentResidentialAddress').get(function () {
238
238
  applicant.addressLine3,
239
239
  applicant.addressCity,
240
240
  applicant.propertyAddressCountry,
241
- applicant.addressPostCode,
242
- countryName
241
+ applicant.addressPostCode
243
242
  ].filter(part => part && part.trim() !== '');
244
243
  return addressParts.join(', ');
245
244
  }
@@ -248,24 +247,39 @@ welcomeCallSchema.virtual('customerCurrentResidentialAddress').get(function () {
248
247
  });
249
248
  // Virtual property for applicant employer/business name based on income settings
250
249
  welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
250
+ console.log(this.applicantId, 'testing');
251
251
  if (this.applicantId && typeof this.applicantId === 'object') {
252
252
  const applicant = this.applicantId;
253
+ console.log(applicant, 'applicant data');
253
254
  // Check if applicant has income settings
254
255
  if (applicant.incomeSourceId && typeof applicant.incomeSourceId === 'object') {
255
256
  const incomeSettings = applicant.incomeSourceId;
257
+ // Debug logging
258
+ console.log('Income Settings:', {
259
+ incomeFromEmployment: incomeSettings.incomeFromEmployment,
260
+ employmentStatusLid: incomeSettings.employmentStatusLid
261
+ });
256
262
  // If incomeFromEmployment is false, return N/A
257
263
  if (!incomeSettings.incomeFromEmployment) {
264
+ console.log('Returning N/A: incomeFromEmployment is false');
258
265
  return 'N/A';
259
266
  }
260
267
  // Check employment status to determine if employed or self-employed
261
268
  if (incomeSettings.employmentStatusLid && typeof incomeSettings.employmentStatusLid === 'object') {
262
269
  const employmentStatus = incomeSettings.employmentStatusLid;
263
270
  const statusValue = employmentStatus.value || employmentStatus.name;
271
+ console.log('Employment Status:', {
272
+ statusValue,
273
+ name: employmentStatus.name,
274
+ value: employmentStatus.value
275
+ });
264
276
  // Check if it's employed status (options 1, 3, 5)
265
277
  if (statusValue === 'Employee with no shareholding' || statusValue === 'A non-equity partner in a partnership' || statusValue === 'A shareholder with less than 25% shares') {
278
+ console.log('Matched employed status, checking employment info');
266
279
  // Check employment information
267
280
  if (applicant.employmentInformationId && typeof applicant.employmentInformationId === 'object') {
268
281
  const employment = applicant.employmentInformationId;
282
+ console.log('Employment Info:', { employerName: employment.employerName });
269
283
  if (employment.employerName && employment.employerName.trim() !== '') {
270
284
  return employment.employerName;
271
285
  }
@@ -273,16 +287,30 @@ welcomeCallSchema.virtual('applicantEmployerBusinessName').get(function () {
273
287
  }
274
288
  // Check if it's self-employed or solo trader status (options 2, 4)
275
289
  else if (statusValue === 'A shareholder with 25% or more shares' || statusValue === 'An equity partner in a partnership' || statusValue === 'Sole Trader') {
290
+ console.log('Matched self-employed status, checking self-employment info');
276
291
  // Check self-employment information
277
292
  if (applicant.selfEmployedInformationId && typeof applicant.selfEmployedInformationId === 'object') {
278
293
  const selfEmployment = applicant.selfEmployedInformationId;
294
+ console.log('Self-Employment Info:', { nameOfBusiness: selfEmployment.nameOfBusiness });
279
295
  if (selfEmployment.nameOfBusiness && selfEmployment.nameOfBusiness.trim() !== '') {
280
296
  return selfEmployment.nameOfBusiness;
281
297
  }
282
298
  }
283
299
  }
300
+ else {
301
+ console.log('No matching employment status found for:', statusValue);
302
+ }
303
+ }
304
+ else {
305
+ console.log('No employment status found');
284
306
  }
285
307
  }
308
+ else {
309
+ console.log('No income settings found');
310
+ }
311
+ }
312
+ else {
313
+ console.log('No applicant found');
286
314
  }
287
315
  return 'N/A';
288
316
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "2.3.264",
3
+ "version": "2.3.266",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",