@lendi/integrations-transform 1.1.9 → 1.2.3
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 +2 -1
- package/lib/index.js +2 -1
- package/lib/schemas/public-asset-event.json +86 -93
- package/lib/transform-events/generate-liability.js +2 -2
- package/lib/transform-events/transform-applicant.js +5 -8
- package/lib/transform-events/transform-application.js +3 -4
- package/lib/transform-events/transform-asset-address.d.ts +19 -0
- package/lib/transform-events/transform-asset-address.js +83 -0
- package/lib/transform-events/transform-asset.d.ts +28 -0
- package/lib/transform-events/transform-asset.js +203 -0
- package/lib/transform-events/transform-expenses.js +3 -4
- package/lib/transform-events/transform-income.js +7 -9
- package/lib/transform-events/{generate-lixi-percentowned.d.ts → transform-percent-owned.d.ts} +1 -1
- package/lib/transform-events/{generate-lixi-percentowned.js → transform-percent-owned.js} +5 -4
- package/lib/types/enum-mappings/asset-type.d.ts +3 -0
- package/lib/types/enum-mappings/asset-type.js +18 -0
- package/lib/types/enum-mappings/index.d.ts +26 -0
- package/lib/types/enum-mappings/index.js +38 -0
- package/lib/types/enum-mappings/to-be-purchased.d.ts +5 -0
- package/lib/types/enum-mappings/to-be-purchased.js +8 -0
- package/lib/types/enum-mappings/to-be-used-as-security.d.ts +5 -0
- package/lib/types/enum-mappings/to-be-used-as-security.js +8 -0
- package/lib/types/events/public-asset.d.ts +16 -17
- package/lib/types/events/public-asset.js +3 -0
- package/lib/update-application/merge-application.d.ts +8 -0
- package/lib/update-application/merge-application.js +132 -0
- package/lib/utils/address-tools.d.ts +14 -1
- package/lib/utils/address-tools.js +35 -3
- package/lib/utils/generate-address.d.ts +3 -4
- package/lib/utils/generate-address.js +8 -9
- package/lib/utils/is-asset-type.d.ts +25 -0
- package/lib/utils/is-asset-type.js +46 -0
- package/package.json +3 -3
- package/lib/transform-events/generate-asset.d.ts +0 -17
- package/lib/transform-events/generate-asset.js +0 -178
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
exports.__esModule = true;
|
|
14
|
+
exports.getAssetMapping = exports.getPropertyType = exports.transformAsset = exports.residentialTypeList = exports.propertyTypeNameList = void 0;
|
|
15
|
+
var lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
|
|
16
|
+
var application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
|
|
17
|
+
var lixi_internal_request_2 = require("@lendi/integrations-protocol/lib/types/lixi-internal-request");
|
|
18
|
+
var lodash_1 = require("lodash");
|
|
19
|
+
var logger_1 = require("../logger");
|
|
20
|
+
var enum_mappings_1 = require("../types/enum-mappings");
|
|
21
|
+
var public_asset_1 = require("../types/events/public-asset");
|
|
22
|
+
var get_financial_institution_1 = require("../utils/get-financial-institution");
|
|
23
|
+
var is_asset_type_1 = require("../utils/is-asset-type");
|
|
24
|
+
var transform_asset_address_1 = require("./transform-asset-address");
|
|
25
|
+
var transform_percent_owned_1 = require("./transform-percent-owned");
|
|
26
|
+
exports.propertyTypeNameList = Object.values(lixi_internal_request_2.Custom2PropertyTypeNameList);
|
|
27
|
+
exports.residentialTypeList = Object.values(lixi_internal_request_1.ResidentialTypeList);
|
|
28
|
+
/**
|
|
29
|
+
* Generates a partial internal request from a partial public asset event.
|
|
30
|
+
*
|
|
31
|
+
* @param {Payload} asset - A partial public asset.
|
|
32
|
+
* @return {PartialApplication} A partial InternalRequest.
|
|
33
|
+
*/
|
|
34
|
+
function transformAsset(_a) {
|
|
35
|
+
var asset = _a.asset, applicationId = _a.applicationId, id = _a.id;
|
|
36
|
+
var isPropertyAsset = (0, is_asset_type_1.isRealEstateAsset)(asset);
|
|
37
|
+
var idPath = isPropertyAsset ? "".concat(application_paths_1.paths.RealEstateAsset, ".@UniqueID") : "".concat(application_paths_1.paths.NonRealEstateAsset, ".@UniqueID");
|
|
38
|
+
var addressId = "".concat(id, "-address");
|
|
39
|
+
var assetMapping = getAssetMapping(asset);
|
|
40
|
+
var partialApplication = {};
|
|
41
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.ApplicationId, applicationId);
|
|
42
|
+
(0, lodash_1.set)(partialApplication, idPath, id);
|
|
43
|
+
if (isPropertyAsset) {
|
|
44
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".@MultipleDwellings"), lixi_internal_request_1.YesNoList.No);
|
|
45
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".@x_Address"), addressId);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), enum_mappings_1.assetTypeMapping[asset.type]);
|
|
49
|
+
}
|
|
50
|
+
if ((0, is_asset_type_1.isFinancialAsset)(asset)) {
|
|
51
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset);
|
|
52
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".FinancialAsset.@Type"), enum_mappings_1.financialAssetMapping[asset.type]);
|
|
53
|
+
}
|
|
54
|
+
if ((0, is_asset_type_1.isOtherAsset)(asset)) {
|
|
55
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), lixi_internal_request_1.NonRealEstateAssetTypeList.Other);
|
|
56
|
+
}
|
|
57
|
+
switch (asset.type) {
|
|
58
|
+
case public_asset_1.AssetType.Vehicle:
|
|
59
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".@Type"), lixi_internal_request_1.NonRealEstateAssetTypeList.MotorVehicleAndTransport);
|
|
60
|
+
break;
|
|
61
|
+
case public_asset_1.AssetType.HomeContents:
|
|
62
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".OtherAsset.@Type"), lixi_internal_request_1.OtherAssetTypeList.HomeContents);
|
|
63
|
+
break;
|
|
64
|
+
case public_asset_1.AssetType.Gifts:
|
|
65
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".OtherAsset.@Description"), asset.description || 'Asset Gifts');
|
|
66
|
+
break;
|
|
67
|
+
case public_asset_1.AssetType.OtherAsset:
|
|
68
|
+
if (asset.description) {
|
|
69
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.NonRealEstateAsset, ".OtherAsset.@Description"), asset.description);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
for (var _i = 0, _b = Object.entries(asset); _i < _b.length; _i++) {
|
|
74
|
+
var _c = _b[_i], key = _c[0], value = _c[1];
|
|
75
|
+
if (assetMapping[key]) {
|
|
76
|
+
switch (key) {
|
|
77
|
+
case 'contractDetails':
|
|
78
|
+
var contractDate = value.contractDate;
|
|
79
|
+
if (contractDate)
|
|
80
|
+
(0, lodash_1.set)(partialApplication, assetMapping.contractDate, contractDate);
|
|
81
|
+
break;
|
|
82
|
+
case 'primaryPurpose':
|
|
83
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.primaryPurposeMapping[value]);
|
|
84
|
+
break;
|
|
85
|
+
case 'toBePurchased':
|
|
86
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.toBePurchasedMapping[value]);
|
|
87
|
+
break;
|
|
88
|
+
case 'propertyStatus':
|
|
89
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.propertyStatusMapping[value]);
|
|
90
|
+
break;
|
|
91
|
+
case 'toBeUsedAsSecurity':
|
|
92
|
+
if (isPropertyAsset)
|
|
93
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.toBeUsedAsSecurityMapping[value]);
|
|
94
|
+
break;
|
|
95
|
+
case 'propertyType':
|
|
96
|
+
var propertyTypeMapping_1 = getPropertyType(value);
|
|
97
|
+
if (!propertyTypeMapping_1) {
|
|
98
|
+
logger_1.logger.warn({ message: "Unknown propertyType ".concat(value, " for asset ").concat(id), applicationId: applicationId });
|
|
99
|
+
}
|
|
100
|
+
var path = propertyTypeMapping_1.path, mappedValue = propertyTypeMapping_1.value;
|
|
101
|
+
(0, lodash_1.set)(partialApplication, path, mappedValue);
|
|
102
|
+
break;
|
|
103
|
+
case 'zoneType':
|
|
104
|
+
if (asset.zoneType === public_asset_1.ZoneType.Commercial) {
|
|
105
|
+
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.RealEstateAsset, ".Commercial.@Type"), lixi_internal_request_1.OtherAssetTypeList.Other);
|
|
106
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], lixi_internal_request_1.Custom6TypeList.Commercial);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], lixi_internal_request_1.Custom6TypeList.Residential);
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
case 'financialInstitution':
|
|
113
|
+
if ((0, is_asset_type_1.isFinancialAsset)(asset)) {
|
|
114
|
+
var financialInstitution = (0, get_financial_institution_1.getFinancialInstitution)(value.toString());
|
|
115
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], financialInstitution);
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case 'year':
|
|
119
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], value.toString());
|
|
120
|
+
break;
|
|
121
|
+
case 'address':
|
|
122
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], (0, transform_asset_address_1.transformAddress)(value, addressId));
|
|
123
|
+
break;
|
|
124
|
+
case 'percentOwned':
|
|
125
|
+
var percentOwned = (0, transform_percent_owned_1.transformPercentOwned)(value);
|
|
126
|
+
if (percentOwned) {
|
|
127
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], percentOwned);
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
(0, lodash_1.set)(partialApplication, assetMapping[key], value);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return partialApplication;
|
|
137
|
+
}
|
|
138
|
+
exports.transformAsset = transformAsset;
|
|
139
|
+
/**
|
|
140
|
+
* @description Map the propertyType to a RealEstateAsset path and the value.
|
|
141
|
+
* @param {PropertyType} propertyType - A propertyType.
|
|
142
|
+
* @returns {PropertyTypeMapping | null} A path and value to be used for property type mapping.
|
|
143
|
+
*/
|
|
144
|
+
function getPropertyType(propertyType) {
|
|
145
|
+
var value = enum_mappings_1.propertyTypeMapping[propertyType];
|
|
146
|
+
if (exports.residentialTypeList.includes(value)) {
|
|
147
|
+
return {
|
|
148
|
+
path: "".concat(application_paths_1.paths.RealEstateAsset, ".Residential"),
|
|
149
|
+
value: {
|
|
150
|
+
'@Type': value
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (exports.propertyTypeNameList.includes(value)) {
|
|
155
|
+
return {
|
|
156
|
+
path: "".concat(application_paths_1.paths.RealEstateAsset, ".PropertyType"),
|
|
157
|
+
value: {
|
|
158
|
+
'@PropertyTypeName': value,
|
|
159
|
+
'@CategoryTypeName': lixi_internal_request_2.Custom1CategoryTypeNameList.Residential
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
exports.getPropertyType = getPropertyType;
|
|
166
|
+
/**
|
|
167
|
+
* @description Get the asset transform mapping for various asset types.
|
|
168
|
+
* @param {Asset} asset An Asset
|
|
169
|
+
* @returns {Record<string, string>} Asset Transform Mapping.
|
|
170
|
+
*/
|
|
171
|
+
function getAssetMapping(asset) {
|
|
172
|
+
var estimatedValue = "".concat(application_paths_1.paths.NonRealEstateAsset, ".EstimatedValue.@Value");
|
|
173
|
+
var percentOwned = "".concat(application_paths_1.paths.NonRealEstateAsset, ".PercentOwned");
|
|
174
|
+
var baseMapping = {
|
|
175
|
+
estimatedValue: estimatedValue,
|
|
176
|
+
percentOwned: percentOwned
|
|
177
|
+
};
|
|
178
|
+
if ((0, is_asset_type_1.isRealEstateAsset)(asset)) {
|
|
179
|
+
estimatedValue = "".concat(application_paths_1.paths.RealEstateAsset, ".EstimatedValue.@Value");
|
|
180
|
+
percentOwned = "".concat(application_paths_1.paths.RealEstateAsset, ".PercentOwned");
|
|
181
|
+
return {
|
|
182
|
+
address: application_paths_1.paths.Address,
|
|
183
|
+
contractDetails: 'contractDetails',
|
|
184
|
+
contractDate: "".concat(application_paths_1.paths.RealEstateAsset, ".ContractDetails.@ContractDate"),
|
|
185
|
+
estimatedValue: estimatedValue,
|
|
186
|
+
percentOwned: percentOwned,
|
|
187
|
+
primaryPurpose: "".concat(application_paths_1.paths.RealEstateAsset, ".@PrimaryPurpose"),
|
|
188
|
+
propertyStatus: "".concat(application_paths_1.paths.RealEstateAsset, ".@Status"),
|
|
189
|
+
propertyType: "".concat(application_paths_1.paths.RealEstateAsset, ".Residential"),
|
|
190
|
+
toBePurchased: "".concat(application_paths_1.paths.RealEstateAsset, ".@Transaction"),
|
|
191
|
+
toBeUsedAsSecurity: "".concat(application_paths_1.paths.RealEstateAsset, ".@ToBeUsedAsSecurity"),
|
|
192
|
+
zoneType: "".concat(application_paths_1.paths.RealEstateAsset, ".Zoning.@Type")
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if ((0, is_asset_type_1.isMotorVehicle)(asset)) {
|
|
196
|
+
return __assign(__assign({}, baseMapping), { make: "".concat(application_paths_1.paths.NonRealEstateAsset, ".MotorVehicle.@Make"), model: "".concat(application_paths_1.paths.NonRealEstateAsset, ".MotorVehicle.@Model"), year: "".concat(application_paths_1.paths.NonRealEstateAsset, ".MotorVehicle.@Year") });
|
|
197
|
+
}
|
|
198
|
+
if ((0, is_asset_type_1.isFinancialAsset)(asset)) {
|
|
199
|
+
return __assign(__assign({}, baseMapping), { financialInstitution: "".concat(application_paths_1.paths.NonRealEstateAsset, ".FinancialAsset.AccountNumber.@FinancialInstitution"), financialInstitutionAccountNumber: "".concat(application_paths_1.paths.NonRealEstateAsset, ".FinancialAsset.AccountNumber.@AccountNumber"), financialInstitutionBsb: "".concat(application_paths_1.paths.NonRealEstateAsset, ".FinancialAsset.AccountNumber.@BSB") });
|
|
200
|
+
}
|
|
201
|
+
return baseMapping;
|
|
202
|
+
}
|
|
203
|
+
exports.getAssetMapping = getAssetMapping;
|
|
@@ -14,8 +14,7 @@ exports.__esModule = true;
|
|
|
14
14
|
exports.isLivingExpenseEstimate = exports.isOtherCommitment = exports.normaliseExpenseAmount = exports.transformExpense = exports.transformExpenses = exports.otherCommitmentExpenseTypes = void 0;
|
|
15
15
|
var application_paths_1 = require("@lendi/integrations-protocol/lib/utils/application-paths");
|
|
16
16
|
var lodash_1 = require("lodash");
|
|
17
|
-
var
|
|
18
|
-
var living_expense_1 = require("../types/enum-mappings/living-expense");
|
|
17
|
+
var enum_mappings_1 = require("../types/enum-mappings/");
|
|
19
18
|
var public_expense_1 = require("../types/events/public-expense");
|
|
20
19
|
exports.otherCommitmentExpenseTypes = [
|
|
21
20
|
public_expense_1.ExpenseType.Board,
|
|
@@ -72,10 +71,10 @@ exports.transformExpenses = transformExpenses;
|
|
|
72
71
|
function transformExpense(expense, applicantId, index, id) {
|
|
73
72
|
return {
|
|
74
73
|
'@Amount': expense.amount,
|
|
75
|
-
'@Category':
|
|
74
|
+
'@Category': enum_mappings_1.livingExpenseMapping[expense.type],
|
|
76
75
|
'@Description': expense.type,
|
|
77
76
|
'@UniqueID': isOtherCommitment(expense) ? "".concat(id, "-commitment-").concat(index) : "".concat(id, "-living-expense-").concat(index),
|
|
78
|
-
'@Frequency':
|
|
77
|
+
'@Frequency': enum_mappings_1.frequencyMapping[expense.frequency],
|
|
79
78
|
PercentResponsible: {
|
|
80
79
|
Owner: [
|
|
81
80
|
{
|
|
@@ -27,13 +27,11 @@ exports.generateBAS = exports.generateIncomeBusinessDetails = exports.createRent
|
|
|
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");
|
|
30
|
-
var
|
|
31
|
-
var government_benefits_1 = require("../types/enum-mappings/government-benefits");
|
|
32
|
-
var income_type_1 = require("../types/enum-mappings/income-type");
|
|
30
|
+
var enum_mappings_1 = require("../types/enum-mappings");
|
|
33
31
|
var public_income_1 = require("../types/events/public-income");
|
|
34
32
|
var is_income_type_1 = require("../utils/is-income-type");
|
|
35
33
|
var round_decimal_1 = require("../utils/round-decimal");
|
|
36
|
-
var
|
|
34
|
+
var transform_percent_owned_1 = require("./transform-percent-owned");
|
|
37
35
|
var netWorkAllowanceAmount = 'Income.@NetWorkAllowanceAmount';
|
|
38
36
|
var netWorkAllowanceFrequency = 'Income.@NetWorkAllowanceFrequency';
|
|
39
37
|
// Income types mapping from internal to LIXI types /paths.
|
|
@@ -147,11 +145,11 @@ function transformIncome(payload, applicantId) {
|
|
|
147
145
|
(0, lodash_1.set)(partialApplication, incomeMapping[key], generateBAS(basWithAmount));
|
|
148
146
|
break;
|
|
149
147
|
case 'frequency':
|
|
150
|
-
(0, lodash_1.set)(partialApplication, incomeMapping[key],
|
|
148
|
+
(0, lodash_1.set)(partialApplication, incomeMapping[key], enum_mappings_1.incomeExpenseFrequencyMapping[value]);
|
|
151
149
|
break;
|
|
152
150
|
case 'percentOwned':
|
|
153
151
|
var ownership = value;
|
|
154
|
-
var percentOwned = (0,
|
|
152
|
+
var percentOwned = (0, transform_percent_owned_1.transformPercentOwned)(ownership);
|
|
155
153
|
if ((0, is_income_type_1.isRentalIncome)(incomeType)) {
|
|
156
154
|
percentOwned = createRentalIncome(incomeAmount, incomeFrequency, ownership.owners);
|
|
157
155
|
}
|
|
@@ -161,7 +159,7 @@ function transformIncome(payload, applicantId) {
|
|
|
161
159
|
break;
|
|
162
160
|
case 'type':
|
|
163
161
|
if (!(0, is_income_type_1.isRentalIncome)(incomeType)) {
|
|
164
|
-
var mappedType =
|
|
162
|
+
var mappedType = enum_mappings_1.otherIncomeMapping[value];
|
|
165
163
|
if ((0, is_income_type_1.isOtherIncomeWithDesc)(value)) {
|
|
166
164
|
(0, lodash_1.set)(partialApplication, "".concat(application_paths_1.paths.OtherIncome, ".@Description"), mappedType);
|
|
167
165
|
(0, lodash_1.set)(partialApplication, incomeMapping[key], lixi_internal_request_1.OtherIncomeTypeList.OtherIncome);
|
|
@@ -172,7 +170,7 @@ function transformIncome(payload, applicantId) {
|
|
|
172
170
|
}
|
|
173
171
|
break;
|
|
174
172
|
case 'benefitType':
|
|
175
|
-
(0, lodash_1.set)(partialApplication, incomeMapping[key],
|
|
173
|
+
(0, lodash_1.set)(partialApplication, incomeMapping[key], enum_mappings_1.governmentBenefitsMapping[value]);
|
|
176
174
|
break;
|
|
177
175
|
case 'incomes':
|
|
178
176
|
var sortedIncomeList = value
|
|
@@ -206,7 +204,7 @@ function createRentalIncome(amount, frequency, ownership) {
|
|
|
206
204
|
var percent = owner.percent, applicantId = owner.applicantId;
|
|
207
205
|
var ownerAmount = amount * percent;
|
|
208
206
|
rentalIncome.push({
|
|
209
|
-
'@Frequency':
|
|
207
|
+
'@Frequency': enum_mappings_1.rentalIncomeFrequencyMapping[frequency],
|
|
210
208
|
'@RentalAmount': ownerAmount,
|
|
211
209
|
'@x_Owner': applicantId
|
|
212
210
|
});
|
package/lib/transform-events/{generate-lixi-percentowned.d.ts → transform-percent-owned.d.ts}
RENAMED
|
@@ -6,4 +6,4 @@ import { PercentOwned as LIXIPercentOwned } from '@lendi/integrations-protocol/l
|
|
|
6
6
|
* @param percentOwned PercentOwned for an asset or liability on public liability event.
|
|
7
7
|
* @returns {LIXIPercentOwned} transformed Lixi PercentOwned.
|
|
8
8
|
*/
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function transformPercentOwned({ owners }: PercentOwned): LIXIPercentOwned;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformPercentOwned = void 0;
|
|
4
|
+
var round_decimal_1 = require("../utils/round-decimal");
|
|
4
5
|
/**
|
|
5
6
|
* Transform percentOwned to lixi's format.
|
|
6
7
|
*
|
|
7
8
|
* @param percentOwned PercentOwned for an asset or liability on public liability event.
|
|
8
9
|
* @returns {LIXIPercentOwned} transformed Lixi PercentOwned.
|
|
9
10
|
*/
|
|
10
|
-
function
|
|
11
|
+
function transformPercentOwned(_a) {
|
|
11
12
|
var _b = _a.owners, owners = _b === void 0 ? [] : _b;
|
|
12
13
|
if (owners.length === 0)
|
|
13
14
|
return null;
|
|
@@ -15,10 +16,10 @@ function generateLIXIPercentOwned(_a) {
|
|
|
15
16
|
Owner: owners.map(function (_a) {
|
|
16
17
|
var percent = _a.percent, applicantId = _a.applicantId;
|
|
17
18
|
return ({
|
|
18
|
-
'@Percent': percent * 100,
|
|
19
|
+
'@Percent': (0, round_decimal_1.roundDecimal)(percent * 100),
|
|
19
20
|
'@x_Party': applicantId
|
|
20
21
|
});
|
|
21
22
|
})
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
exports.
|
|
25
|
+
exports.transformPercentOwned = transformPercentOwned;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.assetTypeMapping = void 0;
|
|
5
|
+
var lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
|
|
6
|
+
var public_asset_1 = require("../events/public-asset");
|
|
7
|
+
exports.assetTypeMapping = (_a = {},
|
|
8
|
+
_a[public_asset_1.AssetType.Gifts] = lixi_internal_request_1.NonRealEstateAssetTypeList.Other,
|
|
9
|
+
_a[public_asset_1.AssetType.HomeContents] = lixi_internal_request_1.NonRealEstateAssetTypeList.Other,
|
|
10
|
+
_a[public_asset_1.AssetType.ManagedFunds] = lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
|
|
11
|
+
_a[public_asset_1.AssetType.OtherAsset] = lixi_internal_request_1.NonRealEstateAssetTypeList.Other,
|
|
12
|
+
_a[public_asset_1.AssetType.Property] = null,
|
|
13
|
+
_a[public_asset_1.AssetType.SavingCheckAccount] = lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
|
|
14
|
+
_a[public_asset_1.AssetType.Shares] = lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
|
|
15
|
+
_a[public_asset_1.AssetType.Superannuation] = lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
|
|
16
|
+
_a[public_asset_1.AssetType.TermDeposit] = lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
|
|
17
|
+
_a[public_asset_1.AssetType.Vehicle] = lixi_internal_request_1.NonRealEstateAssetTypeList.MotorVehicleAndTransport,
|
|
18
|
+
_a);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './alieo-frequency';
|
|
2
|
+
export * from './asset-type';
|
|
3
|
+
export * from './country-code';
|
|
4
|
+
export * from './employment-basis';
|
|
5
|
+
export * from './expense-frequency';
|
|
6
|
+
export * from './funding-position';
|
|
7
|
+
export * from './government-benefits';
|
|
8
|
+
export * from './housing-status';
|
|
9
|
+
export * from './income-type';
|
|
10
|
+
export * from './liability-payment-type';
|
|
11
|
+
export * from './liability-type';
|
|
12
|
+
export * from './living-expense';
|
|
13
|
+
export * from './marital-status';
|
|
14
|
+
export * from './postcode';
|
|
15
|
+
export * from './preferred-repayment';
|
|
16
|
+
export * from './proof-of-identity';
|
|
17
|
+
export * from './public-financial-asset';
|
|
18
|
+
export * from './public-primary-purpose';
|
|
19
|
+
export * from './public-property-status';
|
|
20
|
+
export * from './public-property-type';
|
|
21
|
+
export * from './residency-status';
|
|
22
|
+
export * from './title-gender';
|
|
23
|
+
export * from './title';
|
|
24
|
+
export * from './to-be-purchased';
|
|
25
|
+
export * from './to-be-used-as-security';
|
|
26
|
+
export * from './transaction-type';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
exports.__esModule = true;
|
|
13
|
+
__exportStar(require("./alieo-frequency"), exports);
|
|
14
|
+
__exportStar(require("./asset-type"), exports);
|
|
15
|
+
__exportStar(require("./country-code"), exports);
|
|
16
|
+
__exportStar(require("./employment-basis"), exports);
|
|
17
|
+
__exportStar(require("./expense-frequency"), exports);
|
|
18
|
+
__exportStar(require("./funding-position"), exports);
|
|
19
|
+
__exportStar(require("./government-benefits"), exports);
|
|
20
|
+
__exportStar(require("./housing-status"), exports);
|
|
21
|
+
__exportStar(require("./income-type"), exports);
|
|
22
|
+
__exportStar(require("./liability-payment-type"), exports);
|
|
23
|
+
__exportStar(require("./liability-type"), exports);
|
|
24
|
+
__exportStar(require("./living-expense"), exports);
|
|
25
|
+
__exportStar(require("./marital-status"), exports);
|
|
26
|
+
__exportStar(require("./postcode"), exports);
|
|
27
|
+
__exportStar(require("./preferred-repayment"), exports);
|
|
28
|
+
__exportStar(require("./proof-of-identity"), exports);
|
|
29
|
+
__exportStar(require("./public-financial-asset"), exports);
|
|
30
|
+
__exportStar(require("./public-primary-purpose"), exports);
|
|
31
|
+
__exportStar(require("./public-property-status"), exports);
|
|
32
|
+
__exportStar(require("./public-property-type"), exports);
|
|
33
|
+
__exportStar(require("./residency-status"), exports);
|
|
34
|
+
__exportStar(require("./title-gender"), exports);
|
|
35
|
+
__exportStar(require("./title"), exports);
|
|
36
|
+
__exportStar(require("./to-be-purchased"), exports);
|
|
37
|
+
__exportStar(require("./to-be-used-as-security"), exports);
|
|
38
|
+
__exportStar(require("./transaction-type"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.toBePurchasedMapping = void 0;
|
|
4
|
+
var lixi_internal_request_1 = require("@lendi/integrations-protocol/lib/types/lixi-internal-request");
|
|
5
|
+
exports.toBePurchasedMapping = {
|
|
6
|
+
"true": lixi_internal_request_1.AssetTransactionList.Purchasing,
|
|
7
|
+
"false": lixi_internal_request_1.AssetTransactionList.Owns
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.toBeUsedAsSecurityMapping = void 0;
|
|
4
|
+
var lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
|
|
5
|
+
exports.toBeUsedAsSecurityMapping = {
|
|
6
|
+
"true": lixi_internal_request_1.YesNoList.Yes,
|
|
7
|
+
"false": lixi_internal_request_1.YesNoList.No
|
|
8
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Create
|
|
2
|
+
* Create or update
|
|
3
3
|
*/
|
|
4
4
|
export interface PublicAsset {
|
|
5
|
-
payload:
|
|
6
|
-
type: Type;
|
|
5
|
+
payload: Payload;
|
|
7
6
|
/**
|
|
8
7
|
* schema version
|
|
9
8
|
*/
|
|
9
|
+
type: Type;
|
|
10
10
|
version: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* create
|
|
13
|
+
* create Asset payload
|
|
14
14
|
*/
|
|
15
|
-
export interface
|
|
15
|
+
export interface Payload {
|
|
16
16
|
applicationId: string;
|
|
17
17
|
asset: Asset;
|
|
18
18
|
/**
|
|
@@ -26,9 +26,12 @@ export interface Asset {
|
|
|
26
26
|
constructionDetails?: ConstructionDetails;
|
|
27
27
|
contractDetails?: ContractDetails;
|
|
28
28
|
contractPriceAmount?: number;
|
|
29
|
+
dataType?: string;
|
|
29
30
|
description?: string;
|
|
30
31
|
estimatedValue?: number;
|
|
31
32
|
financialInstitution?: string;
|
|
33
|
+
financialInstitutionAccountNumber?: string;
|
|
34
|
+
financialInstitutionBsb?: string;
|
|
32
35
|
financialInstitutionShortName?: string;
|
|
33
36
|
knockDownToRebuild?: boolean;
|
|
34
37
|
make?: string;
|
|
@@ -37,6 +40,7 @@ export interface Asset {
|
|
|
37
40
|
primaryPurpose?: PrimaryPurpose;
|
|
38
41
|
propertyStatus?: PropertyStatus;
|
|
39
42
|
propertyType?: PropertyType;
|
|
43
|
+
relationId?: string;
|
|
40
44
|
toBePurchased?: boolean;
|
|
41
45
|
toBeSold?: boolean;
|
|
42
46
|
toBeUsedAsSecurity?: boolean;
|
|
@@ -46,7 +50,7 @@ export interface Asset {
|
|
|
46
50
|
}
|
|
47
51
|
export interface Address {
|
|
48
52
|
/**
|
|
49
|
-
* The
|
|
53
|
+
* The suburb name
|
|
50
54
|
*/
|
|
51
55
|
city?: string;
|
|
52
56
|
country?: Countries;
|
|
@@ -55,12 +59,12 @@ export interface Address {
|
|
|
55
59
|
*/
|
|
56
60
|
formatted?: string;
|
|
57
61
|
/**
|
|
58
|
-
*
|
|
62
|
+
* A 4 digit postcode
|
|
59
63
|
*/
|
|
60
64
|
postcode?: string;
|
|
61
65
|
standard?: AddressStandard;
|
|
62
66
|
/**
|
|
63
|
-
*
|
|
67
|
+
* One our great nation's states
|
|
64
68
|
*/
|
|
65
69
|
state?: string;
|
|
66
70
|
}
|
|
@@ -310,10 +314,6 @@ export interface AddressStandard {
|
|
|
310
314
|
* The building name
|
|
311
315
|
*/
|
|
312
316
|
buildingName?: string;
|
|
313
|
-
/**
|
|
314
|
-
* Postal address, usually a PO Box or Locked Bag
|
|
315
|
-
*/
|
|
316
|
-
deliveryAddress?: string;
|
|
317
317
|
/**
|
|
318
318
|
* The level of the unit/apartment
|
|
319
319
|
*/
|
|
@@ -330,10 +330,6 @@ export interface AddressStandard {
|
|
|
330
330
|
* The street number
|
|
331
331
|
*/
|
|
332
332
|
streetNumber?: string;
|
|
333
|
-
/**
|
|
334
|
-
* The street suffix
|
|
335
|
-
*/
|
|
336
|
-
streetSuffix?: string;
|
|
337
333
|
/**
|
|
338
334
|
* The type of the street i.e. road
|
|
339
335
|
*/
|
|
@@ -370,7 +366,7 @@ export interface ContractDetails {
|
|
|
370
366
|
estimatedSettlementDate?: string;
|
|
371
367
|
}
|
|
372
368
|
export interface PercentOwned {
|
|
373
|
-
owners
|
|
369
|
+
owners: ApplicantOwnership[];
|
|
374
370
|
/**
|
|
375
371
|
* Indicate whether ownership proportions are equal, specified individually for each one or
|
|
376
372
|
* not specified.
|
|
@@ -463,6 +459,9 @@ export declare enum ActionedByRole {
|
|
|
463
459
|
Customer = "customer",
|
|
464
460
|
Team = "team"
|
|
465
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* schema version
|
|
464
|
+
*/
|
|
466
465
|
export declare enum Type {
|
|
467
466
|
AssetCreated = "AssetCreated",
|
|
468
467
|
AssetUpdated = "AssetUpdated"
|
|
@@ -312,6 +312,9 @@ var ActionedByRole;
|
|
|
312
312
|
ActionedByRole["Customer"] = "customer";
|
|
313
313
|
ActionedByRole["Team"] = "team";
|
|
314
314
|
})(ActionedByRole = exports.ActionedByRole || (exports.ActionedByRole = {}));
|
|
315
|
+
/**
|
|
316
|
+
* schema version
|
|
317
|
+
*/
|
|
315
318
|
var Type;
|
|
316
319
|
(function (Type) {
|
|
317
320
|
Type["AssetCreated"] = "AssetCreated";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep merges the application and custom handles specific arrays
|
|
3
|
+
*
|
|
4
|
+
* @param newApplication new application coming from events.
|
|
5
|
+
* @param existingApplication a saved dynamo application.
|
|
6
|
+
* @return merged application.
|
|
7
|
+
*/
|
|
8
|
+
export declare function deepMergeApplication(existingApplication: object | undefined, newApplication: object): any;
|