@dynamatix/gb-schemas 2.3.270 → 2.3.271
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;
|
|
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;AAqtBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
|
|
@@ -384,10 +384,27 @@ welcomeCallSchema.virtual('allApplicantsNameAndDOB').get(function () {
|
|
|
384
384
|
welcomeCallSchema.virtual('otherApplicantsNameAndDOB').get(function () {
|
|
385
385
|
console.log('=== DEBUG otherApplicantsNameAndDOB ===');
|
|
386
386
|
console.log('this.applicationId:', this.applicationId);
|
|
387
|
+
console.log('this.applicantId:', this.applicantId);
|
|
387
388
|
console.log('typeof this.applicationId:', typeof this.applicationId);
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
console.log('typeof this.applicantId:', typeof this.applicantId);
|
|
390
|
+
// Try to get application from applicantId first, then from applicationId
|
|
391
|
+
let application = null;
|
|
392
|
+
if (this.applicantId &&
|
|
393
|
+
typeof this.applicantId === 'object' &&
|
|
394
|
+
!(typeof this.applicantId.toHexString === 'function') && // not ObjectId
|
|
395
|
+
this.applicantId.applicationId) {
|
|
396
|
+
application = this.applicantId.applicationId;
|
|
397
|
+
console.log('Got application from applicantId.applicationId');
|
|
398
|
+
}
|
|
399
|
+
else if (this.applicationId && typeof this.applicationId === 'object') {
|
|
400
|
+
application = this.applicationId;
|
|
401
|
+
console.log('Got application from this.applicationId');
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
console.log('No application found in either applicantId.applicationId or this.applicationId');
|
|
405
|
+
return 'N/A';
|
|
406
|
+
}
|
|
407
|
+
if (application) {
|
|
391
408
|
console.log('application object:', application);
|
|
392
409
|
console.log('application.applicants:', application.applicants);
|
|
393
410
|
console.log('Array.isArray(application.applicants):', Array.isArray(application.applicants));
|
|
@@ -476,11 +493,6 @@ welcomeCallSchema.virtual('otherApplicantsNameAndDOB').get(function () {
|
|
|
476
493
|
console.log('Use: .populate({ path: "applicationId", populate: { path: "applicants" } })');
|
|
477
494
|
}
|
|
478
495
|
}
|
|
479
|
-
else {
|
|
480
|
-
console.log('applicationId is not populated or not an object');
|
|
481
|
-
console.log('This means you need to populate the applicationId when querying');
|
|
482
|
-
console.log('Use: .populate("applicationId")');
|
|
483
|
-
}
|
|
484
496
|
// If application not populated or no applicants, return "N/A"
|
|
485
497
|
console.log('Returning N/A - no application or applicants found');
|
|
486
498
|
return 'N/A';
|