@lendi/integrations-transform 1.5.6 → 1.5.7
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.
- package/lib/index.js +5 -1
- package/lib/schemas/application-workflow-event.json +0 -29
- package/lib/transform-events/generate-employment.js +2 -2
- package/lib/transform-events/generate-required-document.js +4 -4
- package/lib/transform-events/transform-asset.js +6 -5
- package/lib/transform-events/transform-liability.js +3 -4
- package/lib/transform-events/transform-percent-owned.d.ts +1 -1
- package/lib/types/enum-mappings/index.js +5 -1
- package/lib/types/events/application-workflow.d.ts +1 -33
- package/lib/types/events/application-workflow.js +1 -34
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -157,35 +157,6 @@
|
|
|
157
157
|
"applicationStatus": {
|
|
158
158
|
"type": "string",
|
|
159
159
|
"description": "Application status in Lendi Group Salesforce",
|
|
160
|
-
"enum": [
|
|
161
|
-
"PRE_CONTACT",
|
|
162
|
-
"POST_CONTACT",
|
|
163
|
-
"SELF_SUBMITTED",
|
|
164
|
-
"UNDER_REVIEW",
|
|
165
|
-
"REVIEW_INCOMPLETE",
|
|
166
|
-
"PROCESS_PENDING",
|
|
167
|
-
"WAITING_ON_EXCEPTION",
|
|
168
|
-
"APPLICATION_ERROR",
|
|
169
|
-
"ON_HOLD",
|
|
170
|
-
"SUBMITTED_TO_LENDER",
|
|
171
|
-
"APPLICATION_RECEIVED",
|
|
172
|
-
"REFERRED",
|
|
173
|
-
"MORE_INFORMATION_REQUESTED",
|
|
174
|
-
"INFORMATION_PROVIDED_TO_LENDER",
|
|
175
|
-
"DECLINED",
|
|
176
|
-
"CONDITIONALLY_APPROVED",
|
|
177
|
-
"AMENDMENT_IN_PROGRESS",
|
|
178
|
-
"PRE_APPROVED",
|
|
179
|
-
"UNCONDITIONALLY_APPROVED",
|
|
180
|
-
"PENDING_SETTLEMENT",
|
|
181
|
-
"DOCUMENTS_ISSUED",
|
|
182
|
-
"SOLICITOR_INSTRUCTED",
|
|
183
|
-
"READY_FOR_SETTLEMENT",
|
|
184
|
-
"LOST",
|
|
185
|
-
"SETTLED",
|
|
186
|
-
"DISCHARGED",
|
|
187
|
-
"CANCELLED"
|
|
188
|
-
]
|
|
189
160
|
},
|
|
190
161
|
"confirmedPrimaryPurpose": {
|
|
191
162
|
"type": "string",
|
|
@@ -6,7 +6,7 @@ var lodash_1 = require("lodash");
|
|
|
6
6
|
var application_paths_1 = require("@lendi/integrations-protocol/lib/utils/application-paths");
|
|
7
7
|
var logger_1 = require("../logger");
|
|
8
8
|
var public_employment_1 = require("../types/events/public-employment");
|
|
9
|
-
var
|
|
9
|
+
var enum_mappings_1 = require("../types/enum-mappings");
|
|
10
10
|
/**
|
|
11
11
|
* Generates a partial application from a employment event.
|
|
12
12
|
*
|
|
@@ -71,7 +71,7 @@ function generateEmployment(employment) {
|
|
|
71
71
|
}
|
|
72
72
|
break;
|
|
73
73
|
case 'employmentBasis':
|
|
74
|
-
(0, lodash_1.set)(partialApplication, employmentMapping[key],
|
|
74
|
+
(0, lodash_1.set)(partialApplication, employmentMapping[key], enum_mappings_1.paygEmploymentBasisMapping[value]);
|
|
75
75
|
break;
|
|
76
76
|
case 'id':
|
|
77
77
|
(0, lodash_1.set)(partialApplication, employmentMapping[key], value);
|
|
@@ -16,8 +16,8 @@ var lixi_internal_request_1 = require("@lendi/integrations-protocol/lib/types/li
|
|
|
16
16
|
var application_paths_1 = require("@lendi/integrations-protocol/lib/utils/application-paths");
|
|
17
17
|
var lodash_1 = require("lodash");
|
|
18
18
|
var enum_mappings_1 = require("../types/enum-mappings");
|
|
19
|
-
var
|
|
20
|
-
var
|
|
19
|
+
var enum_mappings_2 = require("../types/enum-mappings");
|
|
20
|
+
var enum_mappings_3 = require("../types/enum-mappings");
|
|
21
21
|
var verification_1 = require("../types/enum-mappings/verification");
|
|
22
22
|
var public_required_document_1 = require("../types/events/public-required-document");
|
|
23
23
|
var formatYesNo_1 = require("../utils/formatYesNo");
|
|
@@ -31,7 +31,7 @@ var iso_date_1 = require("../utils/iso-date");
|
|
|
31
31
|
*/
|
|
32
32
|
var getApplicantGenderFromIdentification = function (identification) {
|
|
33
33
|
var gender = identification.gender, idTitle = identification.idTitle;
|
|
34
|
-
return gender ? (0, lodash_1.capitalize)(gender) :
|
|
34
|
+
return gender ? (0, lodash_1.capitalize)(gender) : enum_mappings_3.titleGenderMapping[idTitle || public_required_document_1.IDTitle.Unknown];
|
|
35
35
|
};
|
|
36
36
|
exports.getApplicantGenderFromIdentification = getApplicantGenderFromIdentification;
|
|
37
37
|
/**
|
|
@@ -69,7 +69,7 @@ var transformIdentification = function (identification) {
|
|
|
69
69
|
'@CountryOfIssue': enum_mappings_1.countryCodeMapping[issuingCountry],
|
|
70
70
|
'@PlaceOfIssue': enum_mappings_1.countryCodeMapping[issuingCountry]
|
|
71
71
|
}
|
|
72
|
-
: { '@DocumentType':
|
|
72
|
+
: { '@DocumentType': enum_mappings_2.proofOfIdentityMapping[idType] }));
|
|
73
73
|
};
|
|
74
74
|
exports.transformIdentification = transformIdentification;
|
|
75
75
|
/**
|
|
@@ -49,6 +49,7 @@ var constructionDetailsMapping = {
|
|
|
49
49
|
* @return {PartialApplication} A partial InternalRequest.
|
|
50
50
|
*/
|
|
51
51
|
function transformAsset(_a) {
|
|
52
|
+
var _b;
|
|
52
53
|
var asset = _a.asset, applicationId = _a.applicationId, id = _a.id;
|
|
53
54
|
var isPropertyAsset = (0, is_asset_type_1.isRealEstateAsset)(asset);
|
|
54
55
|
var idPath = isPropertyAsset ? "".concat(application_paths_1.paths.RealEstateAsset, ".@UniqueID") : "".concat(application_paths_1.paths.NonRealEstateAsset, ".@UniqueID");
|
|
@@ -87,8 +88,8 @@ function transformAsset(_a) {
|
|
|
87
88
|
}
|
|
88
89
|
break;
|
|
89
90
|
}
|
|
90
|
-
for (var _i = 0,
|
|
91
|
-
var
|
|
91
|
+
for (var _i = 0, _c = Object.entries(asset); _i < _c.length; _i++) {
|
|
92
|
+
var _d = _c[_i], key = _d[0], value = _d[1];
|
|
92
93
|
if (assetMapping[key]) {
|
|
93
94
|
switch (key) {
|
|
94
95
|
case 'contractDetails':
|
|
@@ -103,7 +104,7 @@ function transformAsset(_a) {
|
|
|
103
104
|
(0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.toBePurchasedMapping[value]);
|
|
104
105
|
break;
|
|
105
106
|
case 'propertyExpenses':
|
|
106
|
-
if (!asset.percentOwned) {
|
|
107
|
+
if (!asset.percentOwned || (0, lodash_1.isEmpty)((_b = asset.percentOwned) === null || _b === void 0 ? void 0 : _b.owners)) {
|
|
107
108
|
break;
|
|
108
109
|
}
|
|
109
110
|
var propertyExpenses = generatePropertyExpenses(value);
|
|
@@ -158,8 +159,8 @@ function transformAsset(_a) {
|
|
|
158
159
|
}
|
|
159
160
|
break;
|
|
160
161
|
case 'constructionDetails':
|
|
161
|
-
for (var
|
|
162
|
-
var
|
|
162
|
+
for (var _e = 0, _f = Object.entries(value); _e < _f.length; _e++) {
|
|
163
|
+
var _g = _f[_e], key_1 = _g[0], constructionDetailsValue = _g[1];
|
|
163
164
|
switch (key_1) {
|
|
164
165
|
case 'builderType':
|
|
165
166
|
(0, lodash_1.set)(partialApplication, constructionDetailsMapping[key_1], builder_type_1.builderTypeMapping[constructionDetailsValue]);
|
|
@@ -4,8 +4,7 @@ exports.transformLiability = void 0;
|
|
|
4
4
|
var application_paths_1 = require("@lendi/integrations-protocol/lib/utils/application-paths");
|
|
5
5
|
var lodash_1 = require("lodash");
|
|
6
6
|
var alieo_frequency_1 = require("../types/enum-mappings/alieo-frequency");
|
|
7
|
-
var
|
|
8
|
-
var liability_type_1 = require("../types/enum-mappings/liability-type");
|
|
7
|
+
var enum_mappings_1 = require("../types/enum-mappings");
|
|
9
8
|
var public_liability_1 = require("../types/events/public-liability");
|
|
10
9
|
var get_financial_institution_1 = require("../utils/get-financial-institution");
|
|
11
10
|
var round_decimal_1 = require("../utils/round-decimal");
|
|
@@ -71,7 +70,7 @@ function transformLiability(_a) {
|
|
|
71
70
|
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.Liability, ".OriginalTerm.@PaymentTypeUnits"), lixi_internal_request_1.LoanTermUnitsList.Years);
|
|
72
71
|
break;
|
|
73
72
|
case 'type':
|
|
74
|
-
(0, lodash_1.set)(partialApplication, liabilityMapping[key],
|
|
73
|
+
(0, lodash_1.set)(partialApplication, liabilityMapping[key], enum_mappings_1.liabilityTypeMapping[value]);
|
|
75
74
|
break;
|
|
76
75
|
case 'clearingFromThisLoan':
|
|
77
76
|
(0, lodash_1.set)(partialApplication, liabilityMapping[key], value ? lixi_internal_request_1.YesNoList.Yes : lixi_internal_request_1.YesNoList.No);
|
|
@@ -84,7 +83,7 @@ function transformLiability(_a) {
|
|
|
84
83
|
(0, lodash_1.set)(partialApplication, liabilityMapping[key], alieo_frequency_1.liabilityFrequencyMapping[value]);
|
|
85
84
|
break;
|
|
86
85
|
case 'repaymentTypeDetails':
|
|
87
|
-
(0, lodash_1.set)(partialApplication, liabilityMapping[key],
|
|
86
|
+
(0, lodash_1.set)(partialApplication, liabilityMapping[key], enum_mappings_1.liabilityPaymentTypeMapping[value]);
|
|
88
87
|
break;
|
|
89
88
|
case 'remainingTermDuration':
|
|
90
89
|
(0, lodash_1.set)(partialApplication, liabilityMapping[key], Math.round(value * 12));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PercentOwned } from '../types/events/public-
|
|
1
|
+
import { PercentOwned } from '../types/events/public-asset';
|
|
2
2
|
import { PercentOwned as LIXIPercentOwned } from '@lendi/integrations-protocol/lib/types/lixi-internal-request';
|
|
3
3
|
/**
|
|
4
4
|
* Transform percentOwned to lixi's format.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -25,7 +25,7 @@ export interface PayloadClass {
|
|
|
25
25
|
/**
|
|
26
26
|
* Application status in Lendi Group Salesforce
|
|
27
27
|
*/
|
|
28
|
-
applicationStatus?:
|
|
28
|
+
applicationStatus?: string;
|
|
29
29
|
brokerAuditReview: BrokerAuditReview[];
|
|
30
30
|
/**
|
|
31
31
|
* Intention for applying a loan
|
|
@@ -54,38 +54,6 @@ export declare enum ApplicationStage {
|
|
|
54
54
|
SubmissionReview = "SUBMISSION_REVIEW",
|
|
55
55
|
SubmittedToLender = "SUBMITTED_TO_LENDER"
|
|
56
56
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Application status in Lendi Group Salesforce
|
|
59
|
-
*/
|
|
60
|
-
export declare enum ApplicationStatus {
|
|
61
|
-
AmendmentInProgress = "AMENDMENT_IN_PROGRESS",
|
|
62
|
-
ApplicationError = "APPLICATION_ERROR",
|
|
63
|
-
ApplicationReceived = "APPLICATION_RECEIVED",
|
|
64
|
-
Cancelled = "CANCELLED",
|
|
65
|
-
ConditionallyApproved = "CONDITIONALLY_APPROVED",
|
|
66
|
-
Declined = "DECLINED",
|
|
67
|
-
Discharged = "DISCHARGED",
|
|
68
|
-
DocumentsIssued = "DOCUMENTS_ISSUED",
|
|
69
|
-
InformationProvidedToLender = "INFORMATION_PROVIDED_TO_LENDER",
|
|
70
|
-
Lost = "LOST",
|
|
71
|
-
MoreInformationRequested = "MORE_INFORMATION_REQUESTED",
|
|
72
|
-
OnHold = "ON_HOLD",
|
|
73
|
-
PendingSettlement = "PENDING_SETTLEMENT",
|
|
74
|
-
PostContact = "POST_CONTACT",
|
|
75
|
-
PreApproved = "PRE_APPROVED",
|
|
76
|
-
PreContact = "PRE_CONTACT",
|
|
77
|
-
ProcessPending = "PROCESS_PENDING",
|
|
78
|
-
ReadyForSettlement = "READY_FOR_SETTLEMENT",
|
|
79
|
-
Referred = "REFERRED",
|
|
80
|
-
ReviewIncomplete = "REVIEW_INCOMPLETE",
|
|
81
|
-
SelfSubmitted = "SELF_SUBMITTED",
|
|
82
|
-
Settled = "SETTLED",
|
|
83
|
-
SolicitorInstructed = "SOLICITOR_INSTRUCTED",
|
|
84
|
-
SubmittedToLender = "SUBMITTED_TO_LENDER",
|
|
85
|
-
UnconditionallyApproved = "UNCONDITIONALLY_APPROVED",
|
|
86
|
-
UnderReview = "UNDER_REVIEW",
|
|
87
|
-
WaitingOnException = "WAITING_ON_EXCEPTION"
|
|
88
|
-
}
|
|
89
57
|
export interface BrokerAuditReview {
|
|
90
58
|
/**
|
|
91
59
|
* ISO date time when Broker Audit Review was completed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.Type = exports.Status = exports.Stage = exports.ConfirmedPrimaryPurpose = exports.
|
|
3
|
+
exports.Type = exports.Status = exports.Stage = exports.ConfirmedPrimaryPurpose = exports.ApplicationStage = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Application stage in Lendi Group Salesforce
|
|
6
6
|
*/
|
|
@@ -14,39 +14,6 @@ var ApplicationStage;
|
|
|
14
14
|
ApplicationStage["SubmissionReview"] = "SUBMISSION_REVIEW";
|
|
15
15
|
ApplicationStage["SubmittedToLender"] = "SUBMITTED_TO_LENDER";
|
|
16
16
|
})(ApplicationStage = exports.ApplicationStage || (exports.ApplicationStage = {}));
|
|
17
|
-
/**
|
|
18
|
-
* Application status in Lendi Group Salesforce
|
|
19
|
-
*/
|
|
20
|
-
var ApplicationStatus;
|
|
21
|
-
(function (ApplicationStatus) {
|
|
22
|
-
ApplicationStatus["AmendmentInProgress"] = "AMENDMENT_IN_PROGRESS";
|
|
23
|
-
ApplicationStatus["ApplicationError"] = "APPLICATION_ERROR";
|
|
24
|
-
ApplicationStatus["ApplicationReceived"] = "APPLICATION_RECEIVED";
|
|
25
|
-
ApplicationStatus["Cancelled"] = "CANCELLED";
|
|
26
|
-
ApplicationStatus["ConditionallyApproved"] = "CONDITIONALLY_APPROVED";
|
|
27
|
-
ApplicationStatus["Declined"] = "DECLINED";
|
|
28
|
-
ApplicationStatus["Discharged"] = "DISCHARGED";
|
|
29
|
-
ApplicationStatus["DocumentsIssued"] = "DOCUMENTS_ISSUED";
|
|
30
|
-
ApplicationStatus["InformationProvidedToLender"] = "INFORMATION_PROVIDED_TO_LENDER";
|
|
31
|
-
ApplicationStatus["Lost"] = "LOST";
|
|
32
|
-
ApplicationStatus["MoreInformationRequested"] = "MORE_INFORMATION_REQUESTED";
|
|
33
|
-
ApplicationStatus["OnHold"] = "ON_HOLD";
|
|
34
|
-
ApplicationStatus["PendingSettlement"] = "PENDING_SETTLEMENT";
|
|
35
|
-
ApplicationStatus["PostContact"] = "POST_CONTACT";
|
|
36
|
-
ApplicationStatus["PreApproved"] = "PRE_APPROVED";
|
|
37
|
-
ApplicationStatus["PreContact"] = "PRE_CONTACT";
|
|
38
|
-
ApplicationStatus["ProcessPending"] = "PROCESS_PENDING";
|
|
39
|
-
ApplicationStatus["ReadyForSettlement"] = "READY_FOR_SETTLEMENT";
|
|
40
|
-
ApplicationStatus["Referred"] = "REFERRED";
|
|
41
|
-
ApplicationStatus["ReviewIncomplete"] = "REVIEW_INCOMPLETE";
|
|
42
|
-
ApplicationStatus["SelfSubmitted"] = "SELF_SUBMITTED";
|
|
43
|
-
ApplicationStatus["Settled"] = "SETTLED";
|
|
44
|
-
ApplicationStatus["SolicitorInstructed"] = "SOLICITOR_INSTRUCTED";
|
|
45
|
-
ApplicationStatus["SubmittedToLender"] = "SUBMITTED_TO_LENDER";
|
|
46
|
-
ApplicationStatus["UnconditionallyApproved"] = "UNCONDITIONALLY_APPROVED";
|
|
47
|
-
ApplicationStatus["UnderReview"] = "UNDER_REVIEW";
|
|
48
|
-
ApplicationStatus["WaitingOnException"] = "WAITING_ON_EXCEPTION";
|
|
49
|
-
})(ApplicationStatus = exports.ApplicationStatus || (exports.ApplicationStatus = {}));
|
|
50
17
|
/**
|
|
51
18
|
* Intention for applying a loan
|
|
52
19
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lendi/integrations-transform",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.7",
|
|
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",
|