@lendi/integrations-transform 1.1.8 → 1.1.9
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.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './transform-events/transform-applicant';
|
|
2
2
|
export * from './transform-events/transform-application';
|
|
3
|
+
export * from './transform-events/transform-income';
|
|
3
4
|
export * from './transform-events/generate-asset';
|
|
4
5
|
export * from './transform-events/transform-expenses';
|
|
5
6
|
export * from './transform-events/generate-liability';
|
package/lib/index.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.__esModule = true;
|
|
|
13
13
|
/* istanbul ignore file */
|
|
14
14
|
__exportStar(require("./transform-events/transform-applicant"), exports);
|
|
15
15
|
__exportStar(require("./transform-events/transform-application"), exports);
|
|
16
|
+
__exportStar(require("./transform-events/transform-income"), exports);
|
|
16
17
|
__exportStar(require("./transform-events/generate-asset"), exports);
|
|
17
18
|
__exportStar(require("./transform-events/transform-expenses"), exports);
|
|
18
19
|
__exportStar(require("./transform-events/generate-liability"), exports);
|
|
@@ -15,7 +15,7 @@ export declare function getIncomeMapping(incomeType: IncomeType): Record<string,
|
|
|
15
15
|
* @param applicantId PersonApplicant uniqueId on the application.
|
|
16
16
|
* @return partialApplication an incomplete application.
|
|
17
17
|
*/
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function transformIncome(payload: IncomePayload, applicantId?: string): PartialApplication;
|
|
19
19
|
/**
|
|
20
20
|
* Creates Rental Income array.
|
|
21
21
|
* @param amount Amount
|
|
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
};
|
|
24
24
|
var _a;
|
|
25
25
|
exports.__esModule = true;
|
|
26
|
-
exports.generateBAS = exports.generateIncomeBusinessDetails = exports.createRentalIncome = exports.
|
|
26
|
+
exports.generateBAS = exports.generateIncomeBusinessDetails = exports.createRentalIncome = exports.transformIncome = exports.getIncomeMapping = exports.EmploymentIncomeTypeMapping = void 0;
|
|
27
27
|
var lixi_internal_request_1 = require("@lendi/integrations-protocol/lib/types/lixi-internal-request");
|
|
28
28
|
var application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
|
|
29
29
|
var lodash_1 = require("lodash");
|
|
@@ -70,6 +70,9 @@ exports.EmploymentIncomeTypeMapping = (_a = {},
|
|
|
70
70
|
amount: 'Income.@GrossRegularOvertimeAmount',
|
|
71
71
|
frequency: 'Income.@GrossRegularOvertimeFrequency'
|
|
72
72
|
},
|
|
73
|
+
_a[public_income_1.IncomeType.SelfEmployedBusinessIncome] = {
|
|
74
|
+
amount: 'BusinessIncomeRecent.@ProfitBeforeTax'
|
|
75
|
+
},
|
|
73
76
|
_a);
|
|
74
77
|
function getIncomeMapping(incomeType) {
|
|
75
78
|
var basePath = application_paths_1.paths.OtherIncome;
|
|
@@ -118,7 +121,7 @@ exports.getIncomeMapping = getIncomeMapping;
|
|
|
118
121
|
* @param applicantId PersonApplicant uniqueId on the application.
|
|
119
122
|
* @return partialApplication an incomplete application.
|
|
120
123
|
*/
|
|
121
|
-
function
|
|
124
|
+
function transformIncome(payload, applicantId) {
|
|
122
125
|
var applicationId = payload.applicationId, id = payload.id, income = payload.income;
|
|
123
126
|
var incomeAmount = income.amount, incomeType = income.type, incomeFrequency = income.frequency;
|
|
124
127
|
var partialApplication = {};
|
|
@@ -185,7 +188,7 @@ function generateIncome(payload, applicantId) {
|
|
|
185
188
|
}
|
|
186
189
|
return partialApplication;
|
|
187
190
|
}
|
|
188
|
-
exports.
|
|
191
|
+
exports.transformIncome = transformIncome;
|
|
189
192
|
/**
|
|
190
193
|
* Creates Rental Income array.
|
|
191
194
|
* @param amount Amount
|
|
@@ -246,7 +249,7 @@ function generateIncomeBusinessDetails(data) {
|
|
|
246
249
|
}
|
|
247
250
|
}
|
|
248
251
|
else if (key === 'year') {
|
|
249
|
-
(0, lodash_1.set)(income, dateAndIncomeMapping[key],
|
|
252
|
+
(0, lodash_1.set)(income, dateAndIncomeMapping[key], "".concat(value, "-01-01"));
|
|
250
253
|
}
|
|
251
254
|
else {
|
|
252
255
|
(0, lodash_1.set)(income, dateAndIncomeMapping[key], value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lendi/integrations-transform",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
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",
|