@lendi/integrations-transform 1.5.7 → 1.5.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.
- package/lib/index.js +10 -26
- package/lib/logger.d.ts +1 -2
- package/lib/logger.js +2 -5
- package/lib/schemas/application-workflow-event.json +1 -1
- package/lib/transform-events/generate-asset-liability-link.d.ts +3 -1
- package/lib/transform-events/generate-asset-liability-link.js +14 -18
- package/lib/transform-events/generate-credit-report-rebuilt.js +17 -21
- package/lib/transform-events/generate-employment.d.ts +1 -1
- package/lib/transform-events/generate-employment.js +51 -56
- package/lib/transform-events/generate-required-document.d.ts +1 -7
- package/lib/transform-events/generate-required-document.js +43 -69
- package/lib/transform-events/transform-applicant.d.ts +2 -1
- package/lib/transform-events/transform-applicant.js +78 -91
- package/lib/transform-events/transform-application-workflow.d.ts +0 -1
- package/lib/transform-events/transform-application-workflow.js +9 -14
- package/lib/transform-events/transform-application.d.ts +3 -1
- package/lib/transform-events/transform-application.js +28 -33
- package/lib/transform-events/transform-asset-address.d.ts +8 -2
- package/lib/transform-events/transform-asset-address.js +35 -37
- package/lib/transform-events/transform-asset.d.ts +7 -1
- package/lib/transform-events/transform-asset.js +164 -184
- package/lib/transform-events/transform-expenses.d.ts +4 -0
- package/lib/transform-events/transform-expenses.js +52 -58
- package/lib/transform-events/transform-funding-position.d.ts +2 -2
- package/lib/transform-events/transform-funding-position.js +38 -46
- package/lib/transform-events/transform-income.d.ts +8 -1
- package/lib/transform-events/transform-income.js +121 -139
- package/lib/transform-events/transform-liability.d.ts +4 -1
- package/lib/transform-events/transform-liability.js +62 -65
- package/lib/transform-events/transform-percent-owned.d.ts +1 -0
- package/lib/transform-events/transform-percent-owned.js +7 -14
- package/lib/types/enum-mappings/alieo-frequency.js +22 -26
- package/lib/types/enum-mappings/asset-type.js +14 -18
- package/lib/types/enum-mappings/builder-type.js +6 -10
- package/lib/types/enum-mappings/construction-type.js +7 -11
- package/lib/types/enum-mappings/country-code.js +243 -247
- package/lib/types/enum-mappings/employment-basis.js +9 -13
- package/lib/types/enum-mappings/expense-frequency.js +8 -12
- package/lib/types/enum-mappings/funding-position.js +29 -32
- package/lib/types/enum-mappings/government-benefits.js +7 -11
- package/lib/types/enum-mappings/housing-status.js +12 -16
- package/lib/types/enum-mappings/income-type.js +13 -17
- package/lib/types/enum-mappings/index.js +27 -43
- package/lib/types/enum-mappings/liability-payment-type.js +6 -10
- package/lib/types/enum-mappings/liability-type.js +18 -22
- package/lib/types/enum-mappings/living-expense.js +27 -31
- package/lib/types/enum-mappings/marital-status.js +9 -13
- package/lib/types/enum-mappings/postcode.js +11 -15
- package/lib/types/enum-mappings/preferred-repayment.js +7 -11
- package/lib/types/enum-mappings/proof-of-identity.js +7 -11
- package/lib/types/enum-mappings/property-expense-category.js +8 -12
- package/lib/types/enum-mappings/public-financial-asset.js +9 -13
- package/lib/types/enum-mappings/public-primary-purpose.js +6 -10
- package/lib/types/enum-mappings/public-property-status.js +8 -12
- package/lib/types/enum-mappings/public-property-type.js +20 -24
- package/lib/types/enum-mappings/residency-status.js +8 -12
- package/lib/types/enum-mappings/title-gender.js +10 -14
- package/lib/types/enum-mappings/title.js +10 -14
- package/lib/types/enum-mappings/to-be-purchased.js +4 -7
- package/lib/types/enum-mappings/to-be-used-as-security.js +4 -7
- package/lib/types/enum-mappings/transaction-type.js +6 -10
- package/lib/types/enum-mappings/verification.js +10 -14
- package/lib/types/events/applicant-delete.js +4 -7
- package/lib/types/events/application-workflow.js +10 -13
- package/lib/types/events/asset-delete.js +4 -7
- package/lib/types/events/asset-liability-relation-delete.js +4 -7
- package/lib/types/events/credit-report-retrieved.js +4 -7
- package/lib/types/events/employment-delete.js +2 -5
- package/lib/types/events/expense-delete.js +2 -5
- package/lib/types/events/funding-position.js +6 -9
- package/lib/types/events/income-delete.js +4 -7
- package/lib/types/events/liability-delete.js +2 -5
- package/lib/types/events/opportunity.js +6 -9
- package/lib/types/events/public-applicant.js +28 -31
- package/lib/types/events/public-application.js +26 -29
- package/lib/types/events/public-asset-liability-relation.js +4 -7
- package/lib/types/events/public-asset.js +26 -29
- package/lib/types/events/public-employment.js +18 -21
- package/lib/types/events/public-expense.js +8 -11
- package/lib/types/events/public-funding-position.js +2 -5
- package/lib/types/events/public-income.js +12 -15
- package/lib/types/events/public-liability.js +16 -19
- package/lib/types/events/public-required-document.js +14 -17
- package/lib/types/partial-application.js +1 -2
- package/lib/types/recursive-partial.js +1 -2
- package/lib/update-application/merge-application.d.ts +1 -1
- package/lib/update-application/merge-application.js +41 -38
- package/lib/update-application/update-primary-applicant.d.ts +1 -4
- package/lib/update-application/update-primary-applicant.js +14 -38
- package/lib/utils/address-tools.d.ts +3 -1
- package/lib/utils/address-tools.js +56 -68
- package/lib/utils/clean-up.d.ts +1 -1
- package/lib/utils/clean-up.js +6 -10
- package/lib/utils/formatYesNo.d.ts +0 -1
- package/lib/utils/formatYesNo.js +2 -7
- package/lib/utils/generate-address.d.ts +3 -2
- package/lib/utils/generate-address.js +33 -42
- package/lib/utils/get-financial-institution.d.ts +1 -0
- package/lib/utils/get-financial-institution.js +7 -10
- package/lib/utils/is-asset-type.js +13 -20
- package/lib/utils/is-income-type.d.ts +2 -0
- package/lib/utils/is-income-type.js +50 -69
- package/lib/utils/iso-date.d.ts +0 -1
- package/lib/utils/iso-date.js +2 -7
- package/lib/utils/normalise-date.js +6 -10
- package/lib/utils/round-decimal.js +1 -5
- package/package.json +15 -18
|
@@ -1,61 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
public_expense_1.ExpenseType.Board,
|
|
10
|
-
public_expense_1.ExpenseType.ChildAndSpousalMaintenance,
|
|
11
|
-
public_expense_1.ExpenseType.Rent,
|
|
1
|
+
import { paths } from '@lendi/integrations-protocol/lib/utils/application-paths';
|
|
2
|
+
import { get, set, sumBy } from 'lodash';
|
|
3
|
+
import { frequencyMapping, livingExpenseMapping } from '../types/enum-mappings/';
|
|
4
|
+
import { ExpenseType, Frequency } from '../types/events/public-expense';
|
|
5
|
+
export const otherCommitmentExpenseTypes = [
|
|
6
|
+
ExpenseType.Board,
|
|
7
|
+
ExpenseType.ChildAndSpousalMaintenance,
|
|
8
|
+
ExpenseType.Rent,
|
|
12
9
|
];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const propertyExpenseCategories = [
|
|
11
|
+
ExpenseType.InvestmentPropertyRunningCosts,
|
|
12
|
+
ExpenseType.BodyCorporateFeesStrataFeesAndLandTax,
|
|
13
|
+
ExpenseType.SecondaryResidenceRunningCosts,
|
|
14
|
+
ExpenseType.PrimaryResidenceRunningCosts,
|
|
18
15
|
];
|
|
19
16
|
/**
|
|
20
17
|
* @description Transforms expense items on the application from the event.
|
|
21
18
|
* @returns {PartialApplication} A PartialApplication returned by transforming the expense event.
|
|
22
19
|
* @param expense
|
|
23
20
|
*/
|
|
24
|
-
function transformExpenses(expense) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (expenses.every(
|
|
21
|
+
export function transformExpenses(expense) {
|
|
22
|
+
const partialApplication = {};
|
|
23
|
+
const { applicantId, applicationId, expenses = [], id } = expense;
|
|
24
|
+
if (expenses.every((expense) => expense.amount === undefined || expense.amount === null)) {
|
|
28
25
|
return partialApplication;
|
|
29
26
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
const normalisedExpenses = expenses.map(normaliseExpenseAmount);
|
|
28
|
+
const filteredLivingExpensesWithAmount = normalisedExpenses.filter((expense) => expense.amount || !propertyExpenseCategories.includes(expense.type));
|
|
29
|
+
const livingExpenseEstimate = filteredLivingExpensesWithAmount.find(isLivingExpenseEstimate);
|
|
30
|
+
const otherCommitments = filteredLivingExpensesWithAmount.filter(isOtherCommitment);
|
|
31
|
+
const expenseBreakdown = filteredLivingExpensesWithAmount.filter((item) => !(isOtherCommitment(item) || isLivingExpenseEstimate(item)));
|
|
32
|
+
const livingExpenseEstimateExists = get(livingExpenseEstimate || {}, 'amount', 0) > 0;
|
|
33
|
+
const expenseBreakdownAmountSum = sumBy(expenseBreakdown, 'amount');
|
|
34
|
+
let lixiLivingExpenses;
|
|
38
35
|
// unless all individual expenses have a value of 0 and a living estimate exists, transform them without question.
|
|
39
36
|
if (expenseBreakdownAmountSum === 0 && livingExpenseEstimateExists) {
|
|
40
|
-
|
|
37
|
+
const estimate = transformExpense(livingExpenseEstimate, applicantId, 0, id);
|
|
41
38
|
lixiLivingExpenses = [estimate];
|
|
42
39
|
}
|
|
43
40
|
else {
|
|
44
|
-
lixiLivingExpenses = expenseBreakdown.map(
|
|
45
|
-
return transformExpense(expense, applicantId, index, id);
|
|
46
|
-
});
|
|
41
|
+
lixiLivingExpenses = expenseBreakdown.map((expense, index) => transformExpense(expense, applicantId, index, id));
|
|
47
42
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
const lixiCommitmentExpenses = otherCommitments.map((expense, index) => transformExpense(expense, applicantId, index, id));
|
|
44
|
+
set(partialApplication, paths.ApplicationId, applicationId);
|
|
45
|
+
set(partialApplication, `${paths.Household}.@UniqueID`, `${applicationId}-household`);
|
|
46
|
+
set(partialApplication, `${paths.PersonApplicant}.@UniqueID`, applicantId);
|
|
47
|
+
set(partialApplication, paths.OtherCommitments, lixiCommitmentExpenses);
|
|
53
48
|
if (lixiLivingExpenses.length > 0) {
|
|
54
|
-
|
|
49
|
+
set(partialApplication, paths.LivingExpenses, lixiLivingExpenses);
|
|
55
50
|
}
|
|
56
51
|
return partialApplication;
|
|
57
52
|
}
|
|
58
|
-
exports.transformExpenses = transformExpenses;
|
|
59
53
|
/**
|
|
60
54
|
* transforms the living expense from the expense array on the event.
|
|
61
55
|
*
|
|
@@ -63,34 +57,37 @@ exports.transformExpenses = transformExpenses;
|
|
|
63
57
|
* @param applicantId: Event applicantId.
|
|
64
58
|
* @param index: Index of the map.
|
|
65
59
|
* @param id: Id of the event.
|
|
60
|
+
* @param expense
|
|
61
|
+
* @param applicantId
|
|
62
|
+
* @param index
|
|
63
|
+
* @param id
|
|
66
64
|
*/
|
|
67
|
-
function transformExpense(expense, applicantId, index, id) {
|
|
65
|
+
export function transformExpense(expense, applicantId, index, id) {
|
|
68
66
|
return {
|
|
69
67
|
'@Amount': expense.amount,
|
|
70
|
-
'@Category':
|
|
68
|
+
'@Category': livingExpenseMapping[expense.type],
|
|
71
69
|
'@Description': expense.type,
|
|
72
|
-
'@UniqueID': isOtherCommitment(expense) ?
|
|
73
|
-
'@Frequency':
|
|
70
|
+
'@UniqueID': isOtherCommitment(expense) ? `${id}-commitment-${index}` : `${id}-living-expense-${index}`,
|
|
71
|
+
'@Frequency': frequencyMapping[expense.frequency],
|
|
74
72
|
PercentResponsible: {
|
|
75
73
|
Owner: [
|
|
76
74
|
{
|
|
77
75
|
'@Percent': 100,
|
|
78
|
-
'@x_Party': applicantId
|
|
76
|
+
'@x_Party': applicantId,
|
|
79
77
|
},
|
|
80
|
-
]
|
|
81
|
-
}
|
|
78
|
+
],
|
|
79
|
+
},
|
|
82
80
|
};
|
|
83
81
|
}
|
|
84
|
-
exports.transformExpense = transformExpense;
|
|
85
82
|
/**
|
|
86
83
|
* @description Normalises expense by amount to 0 if not provided and scales quarterly spending up to yearly.
|
|
87
84
|
* @param {Expense} expense An expense
|
|
88
85
|
* @returns {Expense} An normalised expense.
|
|
89
86
|
*/
|
|
90
|
-
function normaliseExpenseAmount(expense) {
|
|
91
|
-
|
|
92
|
-
if (frequency ===
|
|
93
|
-
expense.frequency =
|
|
87
|
+
export function normaliseExpenseAmount(expense) {
|
|
88
|
+
const { amount, frequency = Frequency.Yearly, type: expenseType } = expense;
|
|
89
|
+
if (frequency === Frequency.Quarterly) {
|
|
90
|
+
expense.frequency = Frequency.Yearly;
|
|
94
91
|
expense.amount *= 4;
|
|
95
92
|
}
|
|
96
93
|
if (!amount && !propertyExpenseCategories.includes(expenseType)) {
|
|
@@ -98,22 +95,19 @@ function normaliseExpenseAmount(expense) {
|
|
|
98
95
|
}
|
|
99
96
|
return expense;
|
|
100
97
|
}
|
|
101
|
-
exports.normaliseExpenseAmount = normaliseExpenseAmount;
|
|
102
98
|
/**
|
|
103
99
|
* @description Verify if expense is an OtherCommitment.
|
|
104
100
|
* @param {Expense} expense Any Expense item.
|
|
105
101
|
* @returns {boolean} Returns true if an expense type is one of other commitment expenses.
|
|
106
102
|
*/
|
|
107
|
-
function isOtherCommitment(expense) {
|
|
108
|
-
return
|
|
103
|
+
export function isOtherCommitment(expense) {
|
|
104
|
+
return otherCommitmentExpenseTypes.includes(expense.type);
|
|
109
105
|
}
|
|
110
|
-
exports.isOtherCommitment = isOtherCommitment;
|
|
111
106
|
/**
|
|
112
107
|
* @description Check if expense type is LivingExpenseEstimate.
|
|
113
108
|
* @param {Expense} expense An Expense item.
|
|
114
109
|
* @returns {boolean} Returns true if an expense type is LivingExpenseEstimate
|
|
115
110
|
*/
|
|
116
|
-
function isLivingExpenseEstimate(expense) {
|
|
117
|
-
return expense.type ===
|
|
111
|
+
export function isLivingExpenseEstimate(expense) {
|
|
112
|
+
return expense.type === ExpenseType.LivingExpensesEstimate;
|
|
118
113
|
}
|
|
119
|
-
exports.isLivingExpenseEstimate = isLivingExpenseEstimate;
|
|
@@ -6,7 +6,7 @@ import { PartialApplication } from '../types/partial-application';
|
|
|
6
6
|
*
|
|
7
7
|
* @param fundingPosition a partialFundingPosition.
|
|
8
8
|
* @param uniqueIdSuffix
|
|
9
|
-
* @
|
|
9
|
+
* @returns partialApplication with fees, grants and borrowers contributions added.
|
|
10
10
|
*/
|
|
11
11
|
export declare function transformFundingPosition(fundingPosition: FundingPositionPayload, uniqueIdSuffix?: string): PartialApplication;
|
|
12
12
|
/**
|
|
@@ -16,6 +16,6 @@ export declare function transformFundingPosition(fundingPosition: FundingPositio
|
|
|
16
16
|
* @param lmi
|
|
17
17
|
* @param lmiIncluded
|
|
18
18
|
* @param id
|
|
19
|
-
* @
|
|
19
|
+
* @returns Array of fees
|
|
20
20
|
*/
|
|
21
21
|
export declare function getFees(fundsRequiredBreakDown: FundsRequiredBreakdown, lmi: number, lmiIncluded: boolean, id: string): Fee[];
|
|
@@ -1,63 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var application_paths_1 = require("@lendi/integrations-protocol/lib/utils/application-paths");
|
|
6
|
-
var lodash_1 = require("lodash");
|
|
7
|
-
var enum_mappings_1 = require("../types/enum-mappings");
|
|
1
|
+
import { YesNoList } from '@lendi/integrations-protocol/lib/types/lixi-internal-request';
|
|
2
|
+
import { paths } from '@lendi/integrations-protocol/lib/utils/application-paths';
|
|
3
|
+
import { set, omit } from 'lodash';
|
|
4
|
+
import { categoryMapping, typeMapping, descriptionMapping, contributionMapping } from '../types/enum-mappings';
|
|
8
5
|
/**
|
|
9
6
|
* GenerateFundingPosition
|
|
10
7
|
*
|
|
11
8
|
* @param fundingPosition a partialFundingPosition.
|
|
12
9
|
* @param uniqueIdSuffix
|
|
13
|
-
* @
|
|
10
|
+
* @returns partialApplication with fees, grants and borrowers contributions added.
|
|
14
11
|
*/
|
|
15
|
-
function transformFundingPosition(fundingPosition, uniqueIdSuffix) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
fundsRequiredBreakdown: application_paths_1.paths.SummaryFee
|
|
12
|
+
export function transformFundingPosition(fundingPosition, uniqueIdSuffix = 'loanDetails') {
|
|
13
|
+
const partialApplication = {};
|
|
14
|
+
const contributionFunds = [];
|
|
15
|
+
const { applicationId, id, lmi = 0, lmiIncluded = false } = fundingPosition;
|
|
16
|
+
const fundingPositionMapping = {
|
|
17
|
+
applicationId: paths.ApplicationId,
|
|
18
|
+
fundsRequested: `${paths.RolledUpAmounts}.@TotalNewFunds`,
|
|
19
|
+
lvr: `${paths.Summary}.LoanToValuationRatio.@ApplicationLVR`,
|
|
20
|
+
totalGovernmentContributions: paths.ContributionFunds,
|
|
21
|
+
totalDeposit: paths.ContributionFunds,
|
|
22
|
+
totalCashOut: `${paths.EquityRelease}.Amount.@LumpSum`,
|
|
23
|
+
fundsRequiredBreakdown: paths.SummaryFee,
|
|
28
24
|
};
|
|
29
|
-
for (
|
|
30
|
-
var _d = _c[_i], key = _d[0], value = _d[1];
|
|
25
|
+
for (const [key, value] of Object.entries(fundingPosition)) {
|
|
31
26
|
if (fundingPositionMapping[key]) {
|
|
32
27
|
switch (key) {
|
|
33
28
|
case 'totalGovernmentContributions':
|
|
34
29
|
case 'totalDeposit':
|
|
35
30
|
contributionFunds.push({
|
|
36
31
|
'@Amount': value,
|
|
37
|
-
'@Type':
|
|
38
|
-
'@UniqueID':
|
|
32
|
+
'@Type': contributionMapping[key],
|
|
33
|
+
'@UniqueID': `${id}-${key}`,
|
|
39
34
|
});
|
|
40
35
|
break;
|
|
41
36
|
case 'fundsRequiredBreakdown':
|
|
42
|
-
|
|
37
|
+
set(partialApplication, paths.SummaryFee, getFees(value, lmi, lmiIncluded, id));
|
|
43
38
|
break;
|
|
44
39
|
case 'totalCashOut':
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
set(partialApplication, fundingPositionMapping[key], value);
|
|
41
|
+
set(partialApplication, `${paths.LoanDetail}.@UniqueID`, `${applicationId}-${uniqueIdSuffix}`);
|
|
47
42
|
break;
|
|
48
43
|
case 'fundsRequested':
|
|
49
|
-
|
|
44
|
+
set(partialApplication, fundingPositionMapping[key], Math.round(value));
|
|
50
45
|
break;
|
|
51
46
|
default:
|
|
52
|
-
|
|
47
|
+
set(partialApplication, fundingPositionMapping[key], value);
|
|
53
48
|
break;
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
|
-
|
|
52
|
+
set(partialApplication, paths.ContributionFunds, contributionFunds);
|
|
58
53
|
return partialApplication;
|
|
59
54
|
}
|
|
60
|
-
exports.transformFundingPosition = transformFundingPosition;
|
|
61
55
|
/**
|
|
62
56
|
* getFee
|
|
63
57
|
*
|
|
@@ -65,33 +59,31 @@ exports.transformFundingPosition = transformFundingPosition;
|
|
|
65
59
|
* @param lmi
|
|
66
60
|
* @param lmiIncluded
|
|
67
61
|
* @param id
|
|
68
|
-
* @
|
|
62
|
+
* @returns Array of fees
|
|
69
63
|
*/
|
|
70
|
-
function getFees(fundsRequiredBreakDown, lmi, lmiIncluded, id) {
|
|
64
|
+
export function getFees(fundsRequiredBreakDown, lmi, lmiIncluded, id) {
|
|
71
65
|
// Adding lmi to fees to be transformed.
|
|
72
|
-
|
|
66
|
+
set(fundsRequiredBreakDown, 'lmi', lmi);
|
|
73
67
|
// Omitting constructionCosts as they don't belong in fees.
|
|
74
|
-
return Object.entries(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var fee = {
|
|
68
|
+
return Object.entries(omit(fundsRequiredBreakDown, 'constructionCosts')).map(([key, value]) => {
|
|
69
|
+
const descriptionList = ['accruedInterest', 'otherSundries'];
|
|
70
|
+
const fee = {
|
|
78
71
|
'@Amount': value,
|
|
79
|
-
'@Category':
|
|
80
|
-
'@Type':
|
|
81
|
-
'@UniqueID':
|
|
72
|
+
'@Category': categoryMapping[key],
|
|
73
|
+
'@Type': typeMapping[key],
|
|
74
|
+
'@UniqueID': `${id}-${key}`,
|
|
82
75
|
};
|
|
83
76
|
if (descriptionList.includes(key)) {
|
|
84
|
-
fee['@Description'] =
|
|
77
|
+
fee['@Description'] = descriptionMapping[key];
|
|
85
78
|
}
|
|
86
79
|
if (key === 'lmi') {
|
|
87
80
|
if (lmiIncluded)
|
|
88
|
-
fee['@CapitaliseFee'] =
|
|
81
|
+
fee['@CapitaliseFee'] = YesNoList.Yes;
|
|
89
82
|
// If lmiIncluded is undefined we do not want to set '@CapitaliseFee'
|
|
90
83
|
// only if it is false as this will affect how we handle migration.
|
|
91
84
|
if (lmiIncluded === false)
|
|
92
|
-
fee['@CapitaliseFee'] =
|
|
85
|
+
fee['@CapitaliseFee'] = YesNoList.No;
|
|
93
86
|
}
|
|
94
87
|
return fee;
|
|
95
88
|
});
|
|
96
89
|
}
|
|
97
|
-
exports.getFees = getFees;
|
|
@@ -7,17 +7,22 @@ export interface AmountFrequency {
|
|
|
7
7
|
frequency?: string;
|
|
8
8
|
}
|
|
9
9
|
export declare const EmploymentIncomeTypeMapping: Record<string, AmountFrequency>;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param incomeType
|
|
13
|
+
*/
|
|
10
14
|
export declare function getIncomeMapping(incomeType: IncomeType): Record<string, string>;
|
|
11
15
|
/**
|
|
12
16
|
* Generates an partial application from a partial income event.
|
|
13
17
|
*
|
|
14
18
|
* @param payload a partial income event.
|
|
15
19
|
* @param applicantId PersonApplicant uniqueId on the application.
|
|
16
|
-
* @
|
|
20
|
+
* @returns partialApplication an incomplete application.
|
|
17
21
|
*/
|
|
18
22
|
export declare function transformIncome(payload: IncomePayload, applicantId?: string): PartialApplication;
|
|
19
23
|
/**
|
|
20
24
|
* Creates Rental Income array.
|
|
25
|
+
*
|
|
21
26
|
* @param amount Amount
|
|
22
27
|
* @param frequency Frequency
|
|
23
28
|
* @param ownership Owners.
|
|
@@ -37,5 +42,7 @@ export interface SelfEmploymentIncomeMapping {
|
|
|
37
42
|
export declare function generateIncomeBusinessDetails(data: IncomeBusinessDetails): IncomeElement;
|
|
38
43
|
/**
|
|
39
44
|
* Generates the BAS array from the bas definition on the event.
|
|
45
|
+
*
|
|
46
|
+
* @param bas
|
|
40
47
|
*/
|
|
41
48
|
export declare function generateBAS(bas: BASDefinition[]): IncomeBusinessActivityStatement[];
|