@lendi/integrations-transform 1.1.1 → 1.1.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.
@@ -59,9 +59,6 @@ exports.EmploymentIncomeTypeMapping = (_a = {},
59
59
  amount: 'Income.@GrossRegularOvertimeAmount',
60
60
  frequency: 'Income.@GrossRegularOvertimeFrequency'
61
61
  },
62
- _a[public_income_1.IncomeType.SelfEmployedBusinessIncome] = {
63
- amount: 'BusinessIncomeRecent.@ProfitBeforeTax'
64
- },
65
62
  _a);
66
63
  function getIncomeMapping(incomeType, basePath) {
67
64
  if (basePath === void 0) { basePath = application_paths_1.paths.PAYG; }
@@ -73,14 +70,14 @@ function getIncomeMapping(incomeType, basePath) {
73
70
  }
74
71
  if ((0, is_income_type_1.isFullDocOrLowDocIncome)(incomeType)) {
75
72
  return {
76
- incomes: "".concat(basePath, ".IncomeRecent"),
77
73
  companyId: "".concat(basePath, ".@UniqueID"),
74
+ incomes: "".concat(basePath, ".IncomeRecent"),
78
75
  incomeRecent: "".concat(basePath, ".IncomeRecent"),
79
76
  incomePrevious: "".concat(basePath, ".IncomePrevious"),
80
77
  gross: "".concat(basePath, ".DeclaredIncome.@IncomeAmount")
81
78
  };
82
79
  }
83
- if ((0, is_income_type_1.isPaygIncome)(incomeType) || (0, is_income_type_1.isSelfEmployedIncome)(incomeType)) {
80
+ if ((0, is_income_type_1.isPaygIncome)(incomeType)) {
84
81
  var _a = exports.EmploymentIncomeTypeMapping[incomeType], amount = _a.amount, frequency = _a.frequency;
85
82
  var mapping = {
86
83
  amount: "".concat(basePath, ".").concat(amount),
@@ -126,9 +123,6 @@ function generateIncome(payload, storedApplication) {
126
123
  else if ((0, is_income_type_1.isPaygIncome)(incomeType)) {
127
124
  incomeMapping = getIncomeMapping(incomeType, application_paths_1.paths.PAYG);
128
125
  }
129
- else if ((0, is_income_type_1.isSelfEmployedIncome)(incomeType)) {
130
- incomeMapping = getIncomeMapping(incomeType, application_paths_1.paths.SelfEmployed);
131
- }
132
126
  else if ((0, is_income_type_1.isFullDocOrLowDocIncome)(incomeType)) {
133
127
  var basePath = 'Package.Content.Application.CompanyApplicant[0]';
134
128
  incomeMapping = getIncomeMapping(incomeType, basePath);
@@ -35,7 +35,7 @@ export declare function isFullDocOrLowDocIncome(incomeType: IncomeType): boolean
35
35
  /**
36
36
  * @description Checks if an Income event is a valid rental income event.
37
37
  * @param {Income} income Income.
38
- * @returns {boolean} true if event is a valid Rental Income.
38
+ * @returns {boolean} true if income type is RENTAL_INCOME and an assetId exists.
39
39
  */
40
40
  export declare function isValidRentalIncomeEvent({ assetId, type: incomeType }: Income): boolean;
41
41
  /**
@@ -66,11 +66,11 @@ exports.isFullDocOrLowDocIncome = isFullDocOrLowDocIncome;
66
66
  /**
67
67
  * @description Checks if an Income event is a valid rental income event.
68
68
  * @param {Income} income Income.
69
- * @returns {boolean} true if event is a valid Rental Income.
69
+ * @returns {boolean} true if income type is RENTAL_INCOME and an assetId exists.
70
70
  */
71
71
  function isValidRentalIncomeEvent(_a) {
72
72
  var assetId = _a.assetId, incomeType = _a.type;
73
- return isRentalIncome(incomeType) && !assetId;
73
+ return isRentalIncome(incomeType) && !!assetId;
74
74
  }
75
75
  exports.isValidRentalIncomeEvent = isValidRentalIncomeEvent;
76
76
  /**
@@ -99,7 +99,7 @@ exports.isValidPaygIncomeEvent = isValidPaygIncomeEvent;
99
99
  function isValidSelfEmployedIncomeEvent(_a, applicants) {
100
100
  var percentOwned = _a.percentOwned, employmentId = _a.employmentId, incomeType = _a.type;
101
101
  if (applicants === void 0) { applicants = []; }
102
- if (!isSelfEmployedIncome(incomeType))
102
+ if (!isFullDocOrLowDocIncome(incomeType))
103
103
  return false;
104
104
  var applicantId = (0, lodash_1.get)(percentOwned, 'owners[0].applicantId') || getStoredApplicantId(applicants, employmentId, 'PAYG');
105
105
  if (!applicantId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lendi/integrations-transform",
3
- "version": "1.1.1",
3
+ "version": "1.1.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",