@lendi/integrations-transform 1.6.7-beta.1 → 1.6.7-beta.2
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.
|
@@ -28,7 +28,10 @@ function transformApplicant(applicant) {
|
|
|
28
28
|
dependants: 'dependants',
|
|
29
29
|
email: `${application_paths_1.paths.PersonApplicant}.Contact.EmailAddress[0].@Email`,
|
|
30
30
|
firstName: `${application_paths_1.paths.PersonApplicant}.PersonName.@FirstName`,
|
|
31
|
+
gender: `${application_paths_1.paths.PersonApplicant}.@Gender`,
|
|
31
32
|
id: `${application_paths_1.paths.PersonApplicant}.@UniqueID`,
|
|
33
|
+
isFirstHomeBuyer: `${application_paths_1.paths.PersonApplicant}.@FirstHomeBuyer`,
|
|
34
|
+
isPrimaryApplicant: `${application_paths_1.paths.PersonApplicant}.@PrimaryApplicant`,
|
|
32
35
|
lastName: `${application_paths_1.paths.PersonApplicant}.PersonName.@Surname`,
|
|
33
36
|
maritalDetails: `${application_paths_1.paths.PersonApplicant}.MaritalStatusDetails.@x_Spouse`,
|
|
34
37
|
maritalStatus: `${application_paths_1.paths.PersonApplicant}.@MaritalStatus`,
|
|
@@ -47,19 +50,11 @@ function transformApplicant(applicant) {
|
|
|
47
50
|
applicant.applicantType = public_applicant_1.ApplicantType.Borrower;
|
|
48
51
|
}
|
|
49
52
|
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonName}.@NameTitle`, lixi_internal_request_1.NameTitleList.Other);
|
|
50
|
-
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@PrimaryApplicant`, (0, exports.booleanMapping)(applicant.isPrimaryApplicant));
|
|
51
|
-
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@FirstHomeBuyer`, (0, exports.booleanMapping)(applicant.isFirstHomeBuyer));
|
|
52
53
|
if (applicant.applicantType === public_applicant_1.ApplicantType.Guarantor) {
|
|
53
54
|
const mappedGuarantorRelationship = applicant.guarantorRelationshipToBorrower
|
|
54
55
|
? guarantor_relationship_type_1.guarantorRelationshipTypeMappings[applicant.guarantorRelationshipToBorrower.type]
|
|
55
56
|
: lixi_internal_request_1.KinRelationshipList.OtherRelative;
|
|
56
57
|
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@RelationshipToPrimaryApplicant`, mappedGuarantorRelationship);
|
|
57
|
-
// Credit Report event is not available for Guarantors, we should use
|
|
58
|
-
// the gender from the applicant event. If a Guarantor were to be converted to
|
|
59
|
-
// Borrower, the credit report should override the value for `@Gender`
|
|
60
|
-
if (applicant.gender) {
|
|
61
|
-
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@Gender`, applicant_gender_1.applicantGenderMapping[applicant.gender]);
|
|
62
|
-
}
|
|
63
58
|
}
|
|
64
59
|
for (const [key, value] of Object.entries(applicant)) {
|
|
65
60
|
if (applicantMapping[key]) {
|
|
@@ -90,6 +85,15 @@ function transformApplicant(applicant) {
|
|
|
90
85
|
case 'citizenship':
|
|
91
86
|
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@Citizenship`, enum_mappings_1.countryCodeMapping[value]);
|
|
92
87
|
break;
|
|
88
|
+
case 'gender':
|
|
89
|
+
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@Gender`, applicant_gender_1.applicantGenderMapping[value]);
|
|
90
|
+
break;
|
|
91
|
+
case 'isFirstHomeBuyer':
|
|
92
|
+
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@FirstHomeBuyer`, (0, exports.booleanMapping)(value));
|
|
93
|
+
break;
|
|
94
|
+
case 'isPrimaryApplicant':
|
|
95
|
+
(0, lodash_1.set)(partialApplication, `${application_paths_1.paths.PersonApplicant}.@PrimaryApplicant`, (0, exports.booleanMapping)(value));
|
|
96
|
+
break;
|
|
93
97
|
case 'title':
|
|
94
98
|
(0, lodash_1.set)(partialApplication, applicantMapping[key], enum_mappings_1.titleMapping[value]);
|
|
95
99
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lendi/integrations-transform",
|
|
3
|
-
"version": "1.6.7-beta.
|
|
3
|
+
"version": "1.6.7-beta.2",
|
|
4
4
|
"description": "Library for kafka event data transforming",
|
|
5
5
|
"author": "Integrations <integrations@lendi.com.au>",
|
|
6
6
|
"homepage": "https://bitbucket.org/lendi-dev/integrations-shared-packages#readme",
|