@lendi/act-credit-decisions-transform 2.0.6 → 2.0.10
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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isLivingExpenseEstimate = exports.isOtherCommitment = exports.normaliseExpenseAmount = exports.transformExpense = exports.transformExpenses = exports.otherCommitmentExpenseTypes = void 0;
|
|
4
|
+
const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
|
|
4
5
|
const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
|
|
5
6
|
const lodash_1 = require("lodash");
|
|
6
7
|
const enum_mappings_1 = require("../types/enum-mappings/");
|
|
@@ -38,7 +39,8 @@ function transformExpenses(expense) {
|
|
|
38
39
|
// unless all individual expenses have a value of 0 and a living estimate exists, transform them without question.
|
|
39
40
|
if (expenseBreakdownAmountSum === 0 && livingExpenseEstimateExists) {
|
|
40
41
|
const estimate = transformExpense(livingExpenseEstimate, applicantId, 0, id);
|
|
41
|
-
|
|
42
|
+
const changedToGrocery = Object.assign(Object.assign({}, estimate), { '@Category': lixi_internal_request_1.LivingExpenseCategoryList.Groceries, '@Description': public_expense_1.ExpenseType.Groceries });
|
|
43
|
+
lixiLivingExpenses = [changedToGrocery];
|
|
42
44
|
}
|
|
43
45
|
else {
|
|
44
46
|
lixiLivingExpenses = expenseBreakdown.map((expense, index) => transformExpense(expense, applicantId, index, id));
|
|
@@ -112,6 +112,11 @@ function transformLiability({ applicationId, id, liability }) {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
+
const newLimit = (0, lodash_1.get)(partialApplication, liabilityMapping.newLimit, 0);
|
|
116
|
+
if (!newLimit) {
|
|
117
|
+
// set clearing from this loan to true if ongoing limit is reduced
|
|
118
|
+
(0, lodash_1.set)(partialApplication, liabilityMapping.clearingFromThisLoan, lixi_internal_request_1.YesNoList.Yes);
|
|
119
|
+
}
|
|
115
120
|
return partialApplication;
|
|
116
121
|
}
|
|
117
122
|
exports.transformLiability = transformLiability;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lendi/act-credit-decisions-transform",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
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",
|