@lendi/integrations-transform 1.1.0 → 1.1.5

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.
Files changed (38) hide show
  1. package/lib/schemas/public-income-event.json +99 -1
  2. package/lib/transform-events/generate-asset-liability-link.js +2 -2
  3. package/lib/transform-events/generate-asset.js +32 -32
  4. package/lib/transform-events/generate-credit-report-rebuilt.js +1 -1
  5. package/lib/transform-events/generate-employment.js +17 -17
  6. package/lib/transform-events/generate-funding-position.js +6 -6
  7. package/lib/transform-events/generate-income.d.ts +20 -32
  8. package/lib/transform-events/generate-income.js +145 -146
  9. package/lib/transform-events/generate-liability.js +13 -13
  10. package/lib/transform-events/generate-lixi-percentowned.d.ts +3 -6
  11. package/lib/transform-events/generate-lixi-percentowned.js +1 -0
  12. package/lib/transform-events/generate-opportunity.js +2 -2
  13. package/lib/transform-events/generate-required-document.js +7 -7
  14. package/lib/transform-events/transform-applicant.js +21 -21
  15. package/lib/transform-events/transform-application.js +4 -4
  16. package/lib/transform-events/transform-expenses.js +3 -3
  17. package/lib/types/enum-mappings/alieo-frequency.d.ts +6 -3
  18. package/lib/types/enum-mappings/alieo-frequency.js +8 -2
  19. package/lib/types/events/applicant-delete.d.ts +42 -0
  20. package/lib/types/events/applicant-delete.js +15 -0
  21. package/lib/types/events/asset-delete.d.ts +33 -0
  22. package/lib/types/events/asset-delete.js +15 -0
  23. package/lib/types/events/asset-liability-relation-delete.d.ts +52 -0
  24. package/lib/types/events/asset-liability-relation-delete.js +15 -0
  25. package/lib/types/events/employment-delete.d.ts +19 -0
  26. package/lib/types/events/employment-delete.js +7 -0
  27. package/lib/types/events/expense-delete.d.ts +21 -0
  28. package/lib/types/events/expense-delete.js +7 -0
  29. package/lib/types/events/income-delete.d.ts +33 -0
  30. package/lib/types/events/income-delete.js +15 -0
  31. package/lib/types/events/liability-delete.d.ts +17 -0
  32. package/lib/types/events/liability-delete.js +7 -0
  33. package/lib/types/events/public-income.d.ts +37 -3
  34. package/lib/types/events/public-income.js +2 -0
  35. package/lib/utils/is-income-type.d.ts +72 -0
  36. package/lib/utils/is-income-type.js +138 -0
  37. package/lib/utils/normalise-date.js +1 -1
  38. package/package.json +2 -2
@@ -29,12 +29,87 @@
29
29
  },
30
30
  "owners": {
31
31
  "type": "array",
32
+ "minItems": 1,
32
33
  "items": {
33
34
  "$ref": "#/definitions/ownership"
34
35
  }
35
36
  }
36
37
  }
37
38
  },
39
+ "year": {
40
+ "type": "number",
41
+ "description": "Year the vehicle was made."
42
+ },
43
+ "AddBackDefinition": {
44
+ "type": "object",
45
+ "description": "add-back is an expense that is added back to the profits of the business",
46
+ "properties": {
47
+ "depreciation": {
48
+ "type": "number",
49
+ "example": 3200
50
+ },
51
+ "interest": {
52
+ "type": "number",
53
+ "example": 4600
54
+ },
55
+ "lease": {
56
+ "type": "number",
57
+ "example": 7600
58
+ },
59
+ "nonRecurringExpenses": {
60
+ "type": "number",
61
+ "example": 7810
62
+ },
63
+ "salary": {
64
+ "type": "number",
65
+ "example": 9000
66
+ },
67
+ "superannuationExcess": {
68
+ "type": "number",
69
+ "example": 1300
70
+ },
71
+ "other": {
72
+ "type": "number",
73
+ "example": 6600
74
+ }
75
+ }
76
+ },
77
+ "BASDefinition": {
78
+ "type": "object",
79
+ "description": "Business activity statement details",
80
+ "properties": {
81
+ "quarter": {
82
+ "type": "number",
83
+ "example": 1,
84
+ "enum": [1, 2, 3, 4]
85
+ },
86
+ "salesAmount": {
87
+ "type": "number",
88
+ "example": 54570
89
+ }
90
+ },
91
+ "required": ["quarter"]
92
+ },
93
+ "IncomeBusinessDetails": {
94
+ "type": "object",
95
+ "description": "Earnings for a company over a specified financial year",
96
+ "properties": {
97
+ "year": {
98
+ "$ref": "#/definitions/year"
99
+ },
100
+ "companyProfitBeforeTax": {
101
+ "type": "number",
102
+ "example": 200000
103
+ },
104
+ "addback": {
105
+ "$ref": "#/definitions/AddBackDefinition"
106
+ },
107
+ "nonRecurringIncome": {
108
+ "type": "number",
109
+ "example": 9100
110
+ }
111
+ }
112
+ },
38
113
  "incomeDefinition": {
39
114
  "type": "object",
40
115
  "required": ["id", "applicationId", "income"],
@@ -52,7 +127,7 @@
52
127
  },
53
128
  "income": {
54
129
  "type": "object",
55
- "required": ["amount", "frequency", "type", "percentOwned"],
130
+ "required": ["type"],
56
131
  "properties": {
57
132
  "amount": {
58
133
  "type": "number"
@@ -71,6 +146,27 @@
71
146
  "description": {
72
147
  "type": "string"
73
148
  },
149
+ "companyId": {
150
+ "type": "string",
151
+ "format": "uuid"
152
+ },
153
+ "gross": {
154
+ "type": "number",
155
+ "example": 235000
156
+ },
157
+ "incomes": {
158
+ "type": "array",
159
+ "items": {
160
+ "$ref": "#/definitions/IncomeBusinessDetails"
161
+ }
162
+ },
163
+ "bas": {
164
+ "type": "array",
165
+ "uniqueItems": true,
166
+ "items": {
167
+ "$ref": "#/definitions/BASDefinition"
168
+ }
169
+ },
74
170
  "employmentId": {
75
171
  "type": "string",
76
172
  "format": "uuid",
@@ -102,6 +198,8 @@
102
198
  "PAYG_SALARY_SACRIFICE",
103
199
  "RENTAL_INCOME",
104
200
  "SELF_EMPLOYED_BUSINESS_INCOME",
201
+ "SELF_EMPLOYED_BUSINESS_INCOME_FULL_DOC",
202
+ "SELF_EMPLOYED_BUSINESS_INCOME_LOW_DOC",
105
203
  "SUPER_ANNUITY_PENSION",
106
204
  "WORKERS_COMPENSATION"
107
205
  ]
@@ -14,8 +14,8 @@ function generateAssetLiabilityLink(_a) {
14
14
  var partialApplication = {};
15
15
  var assetLiabilityMapping = {
16
16
  applicationId: application_paths_1.paths.ApplicationId,
17
- liabilityId: application_paths_1.paths.Liability + ".@UniqueID",
18
- assetId: application_paths_1.paths.Liability + ".Security[0].@x_Security"
17
+ liabilityId: "".concat(application_paths_1.paths.Liability, ".@UniqueID"),
18
+ assetId: "".concat(application_paths_1.paths.Liability, ".Security[0].@x_Security")
19
19
  };
20
20
  (0, lodash_1.set)(partialApplication, assetLiabilityMapping.applicationId, applicationId);
21
21
  for (var _i = 0, _b = Object.entries(relation); _i < _b.length; _i++) {
@@ -22,17 +22,17 @@ var toBePurchasedMapping = {
22
22
  "false": lixi_internal_request_1.AssetTransactionList.Owns
23
23
  };
24
24
  var assetMapping = {
25
- make: application_paths_1.paths.NonRealEstateAsset + ".MotorVehicle.@Make",
26
- year: application_paths_1.paths.NonRealEstateAsset + ".MotorVehicle.@Year",
27
- model: application_paths_1.paths.NonRealEstateAsset + ".MotorVehicle.@Model",
28
- estimatedValue: application_paths_1.paths.NonRealEstateAsset + ".EstimatedValue.@Value",
29
- zoneType: application_paths_1.paths.RealEstateAsset + ".Zoning.@Type",
30
- toBeUsedAsSecurity: application_paths_1.paths.RealEstateAsset + ".@ToBeUsedAsSecurity",
31
- toBePurchased: application_paths_1.paths.RealEstateAsset + ".@Transaction",
32
- primaryPurpose: application_paths_1.paths.RealEstateAsset + ".@PrimaryPurpose",
33
- propertyStatus: application_paths_1.paths.RealEstateAsset + ".@Status",
34
- financialInstitution: application_paths_1.paths.NonRealEstateAsset + ".FinancialAsset.AccountNumber.@FinancialInstitution",
35
- propertyType: application_paths_1.paths.RealEstateAsset + ".Residential.@Type",
25
+ make: "".concat(application_paths_1.paths.NonRealEstateAsset, ".MotorVehicle.@Make"),
26
+ year: "".concat(application_paths_1.paths.NonRealEstateAsset, ".MotorVehicle.@Year"),
27
+ model: "".concat(application_paths_1.paths.NonRealEstateAsset, ".MotorVehicle.@Model"),
28
+ estimatedValue: "".concat(application_paths_1.paths.NonRealEstateAsset, ".EstimatedValue.@Value"),
29
+ zoneType: "".concat(application_paths_1.paths.RealEstateAsset, ".Zoning.@Type"),
30
+ toBeUsedAsSecurity: "".concat(application_paths_1.paths.RealEstateAsset, ".@ToBeUsedAsSecurity"),
31
+ toBePurchased: "".concat(application_paths_1.paths.RealEstateAsset, ".@Transaction"),
32
+ primaryPurpose: "".concat(application_paths_1.paths.RealEstateAsset, ".@PrimaryPurpose"),
33
+ propertyStatus: "".concat(application_paths_1.paths.RealEstateAsset, ".@Status"),
34
+ financialInstitution: "".concat(application_paths_1.paths.NonRealEstateAsset, ".FinancialAsset.AccountNumber.@FinancialInstitution"),
35
+ propertyType: "".concat(application_paths_1.paths.RealEstateAsset, ".Residential.@Type"),
36
36
  address: application_paths_1.paths.Address
37
37
  };
38
38
  exports.residentialTypeList = Object.values(lixi_internal_request_1.ResidentialTypeList);
@@ -52,40 +52,40 @@ function generateAsset(_a) {
52
52
  var isPropertyAsset = asset.type === public_asset_1.AssetType.Property;
53
53
  switch (asset.type) {
54
54
  case public_asset_1.AssetType.Vehicle:
55
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".@Type", lixi_internal_request_1.NonRealEstateAssetTypeList.MotorVehicleAndTransport);
55
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), lixi_internal_request_1.NonRealEstateAssetTypeList.MotorVehicleAndTransport);
56
56
  break;
57
57
  case public_asset_1.AssetType.Property:
58
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".@MultipleDwellings", lixi_internal_request_1.YesNoList.No);
58
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".@MultipleDwellings"), lixi_internal_request_1.YesNoList.No);
59
59
  break;
60
60
  case public_asset_1.AssetType.HomeContents:
61
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".@Type", lixi_internal_request_1.NonRealEstateAssetTypeList.Other);
62
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".OtherAsset.@Type", lixi_internal_request_1.OtherAssetTypeList.HomeContents);
61
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), lixi_internal_request_1.NonRealEstateAssetTypeList.Other);
62
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".OtherAsset.@Type"), lixi_internal_request_1.OtherAssetTypeList.HomeContents);
63
63
  break;
64
64
  case public_asset_1.AssetType.Gifts:
65
65
  case public_asset_1.AssetType.OtherAsset:
66
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".@Type", lixi_internal_request_1.NonRealEstateAssetTypeList.Other);
66
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), lixi_internal_request_1.NonRealEstateAssetTypeList.Other);
67
67
  if (asset.description)
68
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".OtherAsset.@Description", asset.description);
68
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".OtherAsset.@Description"), asset.description);
69
69
  break;
70
70
  case public_asset_1.AssetType.Shares:
71
71
  case public_asset_1.AssetType.Superannuation:
72
72
  case public_asset_1.AssetType.TermDeposit:
73
73
  case public_asset_1.AssetType.SavingCheckAccount:
74
74
  case public_asset_1.AssetType.ManagedFunds:
75
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".@Type", lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset);
76
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".FinancialAsset.@Type", public_financial_asset_1.financialAssetMapping[asset.type]);
75
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset);
76
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".FinancialAsset.@Type"), public_financial_asset_1.financialAssetMapping[asset.type]);
77
77
  break;
78
78
  default:
79
- logger_1.logger.warn({ message: "Unhandled asset type: " + asset.type, applicationId: applicationId });
79
+ logger_1.logger.warn({ message: "Unhandled asset type: ".concat(asset.type), applicationId: applicationId });
80
80
  return;
81
81
  }
82
82
  if (isPropertyAsset) {
83
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".@UniqueID", id);
84
- assetMapping.percentOwned = application_paths_1.paths.RealEstateAsset + ".PercentOwned";
83
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".@UniqueID"), id);
84
+ assetMapping.percentOwned = "".concat(application_paths_1.paths.RealEstateAsset, ".PercentOwned");
85
85
  }
86
86
  else {
87
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.NonRealEstateAsset + ".@UniqueID", id);
88
- assetMapping.percentOwned = application_paths_1.paths.NonRealEstateAsset + ".PercentOwned";
87
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@UniqueID"), id);
88
+ assetMapping.percentOwned = "".concat(application_paths_1.paths.NonRealEstateAsset, ".PercentOwned");
89
89
  }
90
90
  for (var _i = 0, _b = Object.entries(asset); _i < _b.length; _i++) {
91
91
  var _c = _b[_i], key = _c[0], value = _c[1];
@@ -106,7 +106,7 @@ function generateAsset(_a) {
106
106
  break;
107
107
  case 'estimatedValue':
108
108
  if (isPropertyAsset) {
109
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".EstimatedValue.@Value", value);
109
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".EstimatedValue.@Value"), value);
110
110
  }
111
111
  else {
112
112
  (0, lodash_1.set)(partialApplication, assetMapping[key], value);
@@ -115,19 +115,19 @@ function generateAsset(_a) {
115
115
  case 'propertyType':
116
116
  var mappedValue = public_property_type_1.propertyTypeMapping[value];
117
117
  if (exports.residentialTypeList.includes(mappedValue)) {
118
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".Residential.@Type", mappedValue);
118
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".Residential.@Type"), mappedValue);
119
119
  }
120
120
  else if (exports.propertyTypeNameList.includes(mappedValue)) {
121
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".PropertyType.@PropertyTypeName", mappedValue);
122
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".PropertyType.@CategoryTypeName", lixi_internal_request_1.Custom2CategoryTypeNameList.Residential);
121
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".PropertyType.@PropertyTypeName"), mappedValue);
122
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".PropertyType.@CategoryTypeName"), lixi_internal_request_1.Custom2CategoryTypeNameList.Residential);
123
123
  }
124
124
  else {
125
- logger_1.logger.warn({ message: "Unknown propertyType " + value + " for asset " + id, applicationId: applicationId });
125
+ logger_1.logger.warn({ message: "Unknown propertyType ".concat(value, " for asset ").concat(id), applicationId: applicationId });
126
126
  }
127
127
  break;
128
128
  case 'zoneType':
129
129
  if (asset.zoneType === public_asset_1.ZoneType.Commercial) {
130
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".Commercial.@Type", lixi_internal_request_1.OtherAssetTypeList.Other);
130
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".Commercial.@Type"), lixi_internal_request_1.OtherAssetTypeList.Other);
131
131
  (0, lodash_1.set)(partialApplication, assetMapping[key], lixi_internal_request_1.Custom4TypeList.Commercial);
132
132
  }
133
133
  else {
@@ -144,8 +144,8 @@ function generateAsset(_a) {
144
144
  (0, lodash_1.set)(partialApplication, assetMapping[key], value.toString());
145
145
  break;
146
146
  case 'address':
147
- var addressId = id + "-address";
148
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RealEstateAsset + ".@x_Address", addressId);
147
+ var addressId = "".concat(id, "-address");
148
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".@x_Address"), addressId);
149
149
  (0, lodash_1.set)(partialApplication, assetMapping[key], (0, generate_address_1.generateAddress)(value, addressId));
150
150
  break;
151
151
  case 'percentOwned':
@@ -12,7 +12,7 @@ var application_paths_1 = require("@lendi/integrations-protocol/lib/utils/applic
12
12
  */
13
13
  function generateCreditReportRebuilt(creditReport) {
14
14
  var applicantId = creditReport.applicantId, raw = creditReport.raw, source = creditReport.source;
15
- var id = applicantId + "-creditReport";
15
+ var id = "".concat(applicantId, "-creditReport");
16
16
  var attachment = {
17
17
  '@Filename': 'Credit Report',
18
18
  '@UniqueID': id,
@@ -29,7 +29,7 @@ function generateEmployment(employment) {
29
29
  isEmployed = true;
30
30
  employmentPath = application_paths_1.paths.PAYG;
31
31
  // Setting default for onProbation. If field exists in event value will get overwritten.
32
- (0, lodash_1.set)(partialApplication, employmentPath + ".@OnProbation", lixi_internal_request_1.YesNoList.No);
32
+ (0, lodash_1.set)(partialApplication, "".concat(employmentPath, ".@OnProbation"), lixi_internal_request_1.YesNoList.No);
33
33
  break;
34
34
  case public_employment_1.EmploymentType.SelfEmployed:
35
35
  isEmployed = true;
@@ -37,24 +37,24 @@ function generateEmployment(employment) {
37
37
  break;
38
38
  case public_employment_1.EmploymentType.NotWorking:
39
39
  employmentPath = application_paths_1.paths.NotEmployed;
40
- (0, lodash_1.set)(partialApplication, employmentPath + ".Income.@OtherIncomeAmount", 0);
41
- (0, lodash_1.set)(partialApplication, employmentPath + ".Income.@OtherIncomeFrequency", lixi_internal_request_1.List.Fortnightly);
40
+ (0, lodash_1.set)(partialApplication, "".concat(employmentPath, ".Income.@OtherIncomeAmount"), 0);
41
+ (0, lodash_1.set)(partialApplication, "".concat(employmentPath, ".Income.@OtherIncomeFrequency"), lixi_internal_request_1.List.Fortnightly);
42
42
  break;
43
43
  default:
44
- logger_1.logger.warn({ message: "Unknown EmploymentType " + employment.employmentType, applicationId: applicationId });
44
+ logger_1.logger.warn({ message: "Unknown EmploymentType ".concat(employment.employmentType), applicationId: applicationId });
45
45
  }
46
46
  var employmentMapping = {
47
47
  applicationId: application_paths_1.paths.ApplicationId,
48
- applicantId: application_paths_1.paths.PersonApplicant + ".@UniqueID",
49
- id: employmentPath + ".@UniqueID",
50
- abn: application_paths_1.paths.RelatedCompany + ".@ABN",
51
- businessName: application_paths_1.paths.RelatedCompany + ".@BusinessName",
52
- type: employmentPath + ".@Status",
53
- employmentBasis: employmentPath + ".@Basis",
54
- startDate: employmentPath + ".@StartDate",
55
- endDate: employmentPath + ".@EndDate",
56
- role: employmentPath + ".@Occupation",
57
- onProbation: employmentPath + ".@OnProbation"
48
+ applicantId: "".concat(application_paths_1.paths.PersonApplicant, ".@UniqueID"),
49
+ id: "".concat(employmentPath, ".@UniqueID"),
50
+ abn: "".concat(application_paths_1.paths.RelatedCompany, ".@ABN"),
51
+ businessName: "".concat(application_paths_1.paths.RelatedCompany, ".@BusinessName"),
52
+ type: "".concat(employmentPath, ".@Status"),
53
+ employmentBasis: "".concat(employmentPath, ".@Basis"),
54
+ startDate: "".concat(employmentPath, ".@StartDate"),
55
+ endDate: "".concat(employmentPath, ".@EndDate"),
56
+ role: "".concat(employmentPath, ".@Occupation"),
57
+ onProbation: "".concat(employmentPath, ".@OnProbation")
58
58
  };
59
59
  for (var _i = 0, _a = Object.entries(employment); _i < _a.length; _i++) {
60
60
  var _b = _a[_i], key = _b[0], value = _b[1];
@@ -76,8 +76,8 @@ function generateEmployment(employment) {
76
76
  case 'id':
77
77
  (0, lodash_1.set)(partialApplication, employmentMapping[key], value);
78
78
  if (isEmployed) {
79
- (0, lodash_1.set)(partialApplication, employmentPath + ".@x_Employer", value + "-businessName");
80
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.RelatedCompany + ".@UniqueID", value + "-businessName");
79
+ (0, lodash_1.set)(partialApplication, "".concat(employmentPath, ".@x_Employer"), "".concat(value, "-businessName"));
80
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RelatedCompany, ".@UniqueID"), "".concat(value, "-businessName"));
81
81
  }
82
82
  break;
83
83
  case 'onProbation':
@@ -89,7 +89,7 @@ function generateEmployment(employment) {
89
89
  case 'role':
90
90
  var _c = value.anzsco, anzsco = _c === void 0 ? {} : _c;
91
91
  if (anzsco.code) {
92
- (0, lodash_1.set)(partialApplication, employmentPath + ".@ANZSCOOccupationCode", anzsco.code.toString());
92
+ (0, lodash_1.set)(partialApplication, "".concat(employmentPath, ".@ANZSCOOccupationCode"), anzsco.code.toString());
93
93
  }
94
94
  if (anzsco.occupation) {
95
95
  (0, lodash_1.set)(partialApplication, employmentMapping[key], anzsco.occupation);
@@ -16,11 +16,11 @@ function generateFundingPosition(fundingPosition) {
16
16
  var applicationId = fundingPosition.applicationId, id = fundingPosition.id;
17
17
  var fundingPositionMapping = {
18
18
  applicationId: application_paths_1.paths.ApplicationId,
19
- fundsRequested: application_paths_1.paths.RolledUpAmounts + ".@TotalNewFunds",
20
- lvr: application_paths_1.paths.Summary + ".LoanToValuationRatio.@ApplicationLVR",
19
+ fundsRequested: "".concat(application_paths_1.paths.RolledUpAmounts, ".@TotalNewFunds"),
20
+ lvr: "".concat(application_paths_1.paths.Summary, ".LoanToValuationRatio.@ApplicationLVR"),
21
21
  totalGovernmentContributions: application_paths_1.paths.ContributionFunds,
22
22
  totalDeposit: application_paths_1.paths.ContributionFunds,
23
- totalCashOut: application_paths_1.paths.EquityRelease + ".Amount.@LumpSum",
23
+ totalCashOut: "".concat(application_paths_1.paths.EquityRelease, ".Amount.@LumpSum"),
24
24
  fundsRequiredBreakdown: application_paths_1.paths.SummaryFee
25
25
  };
26
26
  for (var _i = 0, _a = Object.entries(fundingPosition); _i < _a.length; _i++) {
@@ -32,7 +32,7 @@ function generateFundingPosition(fundingPosition) {
32
32
  contributionFunds.push({
33
33
  '@Amount': value,
34
34
  '@Type': funding_position_1.contributionMapping[key],
35
- '@UniqueID': id + "-" + key
35
+ '@UniqueID': "".concat(id, "-").concat(key)
36
36
  });
37
37
  break;
38
38
  case 'fundsRequiredBreakdown':
@@ -40,7 +40,7 @@ function generateFundingPosition(fundingPosition) {
40
40
  break;
41
41
  case 'totalCashOut':
42
42
  (0, lodash_1.set)(partialApplication, fundingPositionMapping[key], value);
43
- (0, lodash_1.set)(partialApplication, application_paths_1.paths.LoanDetail + ".@UniqueID", applicationId + "-loanDetails");
43
+ (0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.LoanDetail, ".@UniqueID"), "".concat(applicationId, "-loanDetails"));
44
44
  break;
45
45
  case 'fundsRequested':
46
46
  (0, lodash_1.set)(partialApplication, fundingPositionMapping[key], Math.round(value));
@@ -71,7 +71,7 @@ function getFees(fundsRequiredBreakDown, id) {
71
71
  '@Amount': value,
72
72
  '@Category': funding_position_1.categoryMapping[key],
73
73
  '@Type': funding_position_1.typeMapping[key],
74
- '@UniqueID': id + "-" + key
74
+ '@UniqueID': "".concat(id, "-").concat(key)
75
75
  };
76
76
  if (descriptionList.includes(key)) {
77
77
  fee['@Description'] = funding_position_1.descriptionMapping[key];
@@ -1,13 +1,13 @@
1
- import { Frequency, OwnershipProportion as PercentOwned, IncomeDefinition as IncomePayload } from '../types/events/public-income';
2
- import { PersonApplicant } from '@lendi/integrations-protocol/lib/types/lixi-internal-request';
1
+ import { IncomeElement } from '@lendi/integrations-credit-protocol/types/lixi-internal-request';
2
+ import { RentalIncome } from '@lendi/integrations-protocol/lib/types/lixi-internal-request';
3
+ import { Frequency, IncomeBusinessDetails, IncomeDefinition as IncomePayload, IncomeType, Ownership } from '../types/events/public-income';
4
+ import { PartialApplication } from '../types/partial-application';
3
5
  export interface AmountFrequency {
4
6
  amount: string;
5
7
  frequency?: string;
6
8
  }
7
9
  export declare const EmploymentIncomeTypeMapping: Record<string, AmountFrequency>;
8
- export declare function isPaygIncome(incomeType: string): boolean;
9
- export declare function isSelfEmployedIncome(incomeType: string): boolean;
10
- export declare function isRentalIncome(incomeType: string): boolean;
10
+ export declare function getIncomeMapping(incomeType: IncomeType): Record<string, string>;
11
11
  /**
12
12
  * Generates an partial application from a partial income event.
13
13
  *
@@ -15,35 +15,23 @@ export declare function isRentalIncome(incomeType: string): boolean;
15
15
  * @param storedApplication: Current state of the application.
16
16
  * @return partialApplication an incomplete application.
17
17
  */
18
- export declare function generateIncome(payload: IncomePayload, storedApplication: any): {};
19
- /**
20
- * Gets the applicant id if given employmentId belongs to it.
21
- *
22
- * @param application
23
- * @param employmentId
24
- */
25
- export declare function getApplicantIdForEmploymentId(application?: any, employmentId?: string): string | null;
26
- /**
27
- * Checks if given employment id belongs to given applicant.
28
- *
29
- * @param applicant
30
- * @param employmentId
31
- */
32
- export declare function containsEmploymentId(applicant: PersonApplicant, employmentId: string): boolean;
33
- /**
34
- * Gets the employmentId if given income is employment income.
35
- *
36
- * @param payload
37
- */
38
- export declare function getEmploymentIdForIncome(payload: IncomePayload): string | undefined;
18
+ export declare function generateIncome(payload: IncomePayload, applicantId?: string): PartialApplication;
39
19
  /**
40
20
  * Creates Rental Income array.
41
- * @param owners List of owners.
42
21
  * @param amount Amount
43
22
  * @param frequency Frequency
23
+ * @param ownership Owners.
24
+ */
25
+ export declare function createRentalIncome(amount: number, frequency: Frequency, ownership: Ownership[]): RentalIncome[];
26
+ export interface SelfEmploymentIncomeMapping {
27
+ year: string;
28
+ companyProfitBeforeTax: string;
29
+ addback: Record<string, string>;
30
+ nonRecurringIncome: string;
31
+ }
32
+ /**
33
+ * @description Transform a Self Employed Income Details to LIXI
34
+ * @param data Financial Year Income Details for Self Employed Income.
35
+ * @returns {IncomeElement} LIXI Income for the Self Employed.
44
36
  */
45
- export declare function createRentalIncome({ owners }: PercentOwned, amount: number, frequency: Frequency): {
46
- '@Frequency': import("@lendi/integrations-protocol/lib/types/lixi-internal-request").List;
47
- '@RentalIncome': number;
48
- '@x_Owner': string;
49
- }[];
37
+ export declare function generateIncomeBusinessDetails(data: IncomeBusinessDetails): IncomeElement;