@lendi/act-credit-decisions-transform 2.0.21 → 2.0.23

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 (28) hide show
  1. package/lib/schemas/credit-report-retrieved-event.json +827 -10
  2. package/lib/transform-events/generate-asset-liability-link.js +1 -2
  3. package/lib/transform-events/generate-credit-report-rebuilt.d.ts +1 -1
  4. package/lib/transform-events/generate-credit-report-rebuilt.js +1 -2
  5. package/lib/transform-events/transform-applicant.js +2 -2
  6. package/lib/transform-events/transform-application-workflow.js +1 -2
  7. package/lib/transform-events/transform-application.js +1 -2
  8. package/lib/transform-events/transform-asset-address.js +4 -4
  9. package/lib/transform-events/transform-asset.js +8 -8
  10. package/lib/transform-events/transform-bcm-status-updated.js +1 -2
  11. package/lib/transform-events/transform-employment.js +1 -2
  12. package/lib/transform-events/transform-expenses.js +6 -6
  13. package/lib/transform-events/transform-funding-position.js +2 -3
  14. package/lib/transform-events/transform-income.js +6 -6
  15. package/lib/transform-events/transform-liability.js +1 -2
  16. package/lib/transform-events/transform-percent-owned.js +1 -2
  17. package/lib/types/events/credit-report-retrieved.d.ts +561 -5
  18. package/lib/types/events/credit-report-retrieved.js +297 -6
  19. package/lib/update-application/merge-application.js +1 -2
  20. package/lib/utils/address-tools.js +8 -8
  21. package/lib/utils/clean-up.js +1 -2
  22. package/lib/utils/generate-address.js +3 -3
  23. package/lib/utils/get-financial-institution.js +1 -2
  24. package/lib/utils/is-asset-type.js +4 -5
  25. package/lib/utils/is-income-type.js +9 -9
  26. package/lib/utils/normalise-date.js +1 -2
  27. package/lib/utils/round-decimal.js +1 -2
  28. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateAssetLiabilityLink = void 0;
3
+ exports.generateAssetLiabilityLink = generateAssetLiabilityLink;
4
4
  const lodash_1 = require("lodash");
5
5
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
6
6
  /**
@@ -26,4 +26,3 @@ function generateAssetLiabilityLink({ applicationId, relation }) {
26
26
  }
27
27
  return partialApplication;
28
28
  }
29
- exports.generateAssetLiabilityLink = generateAssetLiabilityLink;
@@ -1,4 +1,4 @@
1
- import { PayloadObject as CreditReportPayload } from '../types/events/credit-report-retrieved';
1
+ import { Payload as CreditReportPayload } from '../types/events/credit-report-retrieved';
2
2
  /**
3
3
  * Generates LIXI compliant `Attachment` and `CreditAssessment` objects which
4
4
  * use credit report data fetched from Equifax.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateCreditReportRebuilt = void 0;
3
+ exports.generateCreditReportRebuilt = generateCreditReportRebuilt;
4
4
  const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
5
5
  const lodash_1 = require("lodash");
6
6
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
@@ -38,4 +38,3 @@ function generateCreditReportRebuilt(creditReport) {
38
38
  (0, lodash_1.set)(partialApplication, application_paths_1.paths.Report, [report]);
39
39
  return partialApplication;
40
40
  }
41
- exports.generateCreditReportRebuilt = generateCreditReportRebuilt;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformApplicant = exports.booleanMapping = void 0;
3
+ exports.booleanMapping = void 0;
4
+ exports.transformApplicant = transformApplicant;
4
5
  const lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
5
6
  const lixi_internal_request_2 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
6
7
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
@@ -177,4 +178,3 @@ function transformApplicant(applicant) {
177
178
  }
178
179
  return partialApplication;
179
180
  }
180
- exports.transformApplicant = transformApplicant;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformApplicationWorkflow = void 0;
3
+ exports.transformApplicationWorkflow = transformApplicationWorkflow;
4
4
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
5
5
  const lodash_1 = require("lodash");
6
6
  const application_workflow_1 = require("../types/events/application-workflow");
@@ -27,4 +27,3 @@ function transformApplicationWorkflow(applicationWorkflowEventPayload) {
27
27
  (0, lodash_1.set)(partialApplication, application_paths_1.paths.InstructionsStatus, statusInstructionDetails);
28
28
  return partialApplication;
29
29
  }
30
- exports.transformApplicationWorkflow = transformApplicationWorkflow;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformApplication = void 0;
3
+ exports.transformApplication = transformApplication;
4
4
  const lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
5
5
  const application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
6
6
  const application_paths_2 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
@@ -64,4 +64,3 @@ function transformApplication(opportunity, options = {}) {
64
64
  }
65
65
  return partialApplication;
66
66
  }
67
- exports.transformApplication = transformApplication;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformStandard = exports.transformAddress = exports.standardMapping = exports.getAddressMapping = void 0;
3
+ exports.standardMapping = void 0;
4
+ exports.getAddressMapping = getAddressMapping;
5
+ exports.transformAddress = transformAddress;
6
+ exports.transformStandard = transformStandard;
4
7
  const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
5
8
  const lodash_1 = require("lodash");
6
9
  const enum_mappings_1 = require("../types/enum-mappings");
@@ -19,7 +22,6 @@ function getAddressMapping(address) {
19
22
  formatted: '@Country',
20
23
  };
21
24
  }
22
- exports.getAddressMapping = getAddressMapping;
23
25
  exports.standardMapping = {
24
26
  streetName: '@StreetName',
25
27
  streetType: '@StreetType',
@@ -69,7 +71,6 @@ function transformAddress(address, id) {
69
71
  }
70
72
  return transformedAddress;
71
73
  }
72
- exports.transformAddress = transformAddress;
73
74
  /**
74
75
  * @description Generates an address standard.
75
76
  * @param {AddressStandard} addressStandard An address standard object.
@@ -84,4 +85,3 @@ function transformStandard(addressStandard) {
84
85
  }
85
86
  return transformedStandard;
86
87
  }
87
- exports.transformStandard = transformStandard;
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeAmounts = exports.determineOccupancy = exports.generatePropertyExpenses = exports.generateLivingExpenses = exports.getAssetMapping = exports.getPropertyType = exports.transformAsset = exports.residentialTypeList = exports.propertyTypeNameList = void 0;
3
+ exports.residentialTypeList = exports.propertyTypeNameList = void 0;
4
+ exports.transformAsset = transformAsset;
5
+ exports.getPropertyType = getPropertyType;
6
+ exports.getAssetMapping = getAssetMapping;
7
+ exports.generateLivingExpenses = generateLivingExpenses;
8
+ exports.generatePropertyExpenses = generatePropertyExpenses;
9
+ exports.determineOccupancy = determineOccupancy;
10
+ exports.normalizeAmounts = normalizeAmounts;
4
11
  const lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
5
12
  const application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
6
13
  const lixi_internal_request_2 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
@@ -181,7 +188,6 @@ function transformAsset({ asset, applicationId, id }) {
181
188
  }
182
189
  return partialApplication;
183
190
  }
184
- exports.transformAsset = transformAsset;
185
191
  /**
186
192
  * @description Map the propertyType to a RealEstateAsset path and the value.
187
193
  * @param {PropertyType} propertyType - A propertyType.
@@ -208,7 +214,6 @@ function getPropertyType(propertyType) {
208
214
  }
209
215
  return null;
210
216
  }
211
- exports.getPropertyType = getPropertyType;
212
217
  /**
213
218
  * @description Get the asset transform mapping for various asset types.
214
219
  * @param {Asset} asset An Asset
@@ -250,7 +255,6 @@ function getAssetMapping(asset) {
250
255
  }
251
256
  return baseMapping;
252
257
  }
253
- exports.getAssetMapping = getAssetMapping;
254
258
  /**
255
259
  * Creates living expense items from a propertyExpense object.
256
260
  *
@@ -286,7 +290,6 @@ function generateLivingExpenses(percentOwned, assetId, propertyExpenses) {
286
290
  });
287
291
  return livingExpenses;
288
292
  }
289
- exports.generateLivingExpenses = generateLivingExpenses;
290
293
  /**
291
294
  * Pre-sum the body strata and land tax amount into one record.
292
295
  * When the BodyCorporateFeesStrataFeesAndLandTax is fully deprecated, we can remove this function to let the StrataBodyCorporateFees and LandTax to flow out as normal
@@ -330,7 +333,6 @@ function generatePropertyExpenses(propertyExpenses) {
330
333
  };
331
334
  });
332
335
  }
333
- exports.generatePropertyExpenses = generatePropertyExpenses;
334
336
  /**
335
337
  * Determines the occupancy based on the list of property expense types available.
336
338
  *
@@ -349,7 +351,6 @@ function determineOccupancy(propertyExpenses) {
349
351
  return lixi_internal_request_1.OccupancyList.OwnerPrimary;
350
352
  }
351
353
  }
352
- exports.determineOccupancy = determineOccupancy;
353
354
  /**
354
355
  * Calculates the correct amount and frequency.
355
356
  *
@@ -362,4 +363,3 @@ function normalizeAmounts(expense) {
362
363
  }
363
364
  return expense;
364
365
  }
365
- exports.normalizeAmounts = normalizeAmounts;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.transformBcmStatusUpdated = void 0;
12
+ exports.transformBcmStatusUpdated = transformBcmStatusUpdated;
13
13
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
14
14
  const lodash_1 = require("lodash");
15
15
  const bcm_application_status_updated_1 = require("../types/events/bcm-application-status-updated");
@@ -36,4 +36,3 @@ function transformBcmStatusUpdated(bcmStatusUpdatedPayload) {
36
36
  return partialApplication;
37
37
  });
38
38
  }
39
- exports.transformBcmStatusUpdated = transformBcmStatusUpdated;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformEmployment = void 0;
3
+ exports.transformEmployment = transformEmployment;
4
4
  const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
5
5
  const lodash_1 = require("lodash");
6
6
  const application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
@@ -107,4 +107,3 @@ function transformEmployment(employment, isSelfEmployed) {
107
107
  }
108
108
  return partialApplication;
109
109
  }
110
- exports.transformEmployment = transformEmployment;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLivingExpenseEstimate = exports.isOtherCommitment = exports.normaliseExpenseAmount = exports.transformExpense = exports.transformExpenses = exports.otherCommitmentExpenseTypes = void 0;
3
+ exports.otherCommitmentExpenseTypes = void 0;
4
+ exports.transformExpenses = transformExpenses;
5
+ exports.transformExpense = transformExpense;
6
+ exports.normaliseExpenseAmount = normaliseExpenseAmount;
7
+ exports.isOtherCommitment = isOtherCommitment;
8
+ exports.isLivingExpenseEstimate = isLivingExpenseEstimate;
4
9
  const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
5
10
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
6
11
  const lodash_1 = require("lodash");
@@ -58,7 +63,6 @@ function transformExpenses(expense) {
58
63
  }
59
64
  return partialApplication;
60
65
  }
61
- exports.transformExpenses = transformExpenses;
62
66
  /**
63
67
  * transforms the living expense from the expense array on the event.
64
68
  *
@@ -89,7 +93,6 @@ function transformExpense(expense, applicantId, index, id) {
89
93
  },
90
94
  };
91
95
  }
92
- exports.transformExpense = transformExpense;
93
96
  /**
94
97
  * @description Normalises expense by amount to 0 if not provided and scales quarterly spending up to yearly.
95
98
  * @param {Expense} expense An expense
@@ -106,7 +109,6 @@ function normaliseExpenseAmount(expense) {
106
109
  }
107
110
  return expense;
108
111
  }
109
- exports.normaliseExpenseAmount = normaliseExpenseAmount;
110
112
  /**
111
113
  * Pre-sum the body strata and land tax amount into one record.
112
114
  * When the BodyCorporateFeesStrataFeesAndLandTax is fully deprecated, we can remove this function to let the StrataBodyCorporateFees and LandTax to flow out as normal
@@ -141,7 +143,6 @@ function preSumUpStrataExpense(expenses) {
141
143
  function isOtherCommitment(expense) {
142
144
  return exports.otherCommitmentExpenseTypes.includes(expense.type);
143
145
  }
144
- exports.isOtherCommitment = isOtherCommitment;
145
146
  /**
146
147
  * @description Check if expense type is LivingExpenseEstimate.
147
148
  * @param {Expense} expense An Expense item.
@@ -150,4 +151,3 @@ exports.isOtherCommitment = isOtherCommitment;
150
151
  function isLivingExpenseEstimate(expense) {
151
152
  return expense.type === public_expense_1.ExpenseType.LivingExpensesEstimate;
152
153
  }
153
- exports.isLivingExpenseEstimate = isLivingExpenseEstimate;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFees = exports.transformFundingPosition = void 0;
3
+ exports.transformFundingPosition = transformFundingPosition;
4
+ exports.getFees = getFees;
4
5
  const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
5
6
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
6
7
  const lodash_1 = require("lodash");
@@ -68,7 +69,6 @@ function transformFundingPosition(fundingPosition, uniqueIdSuffix = 'loanDetails
68
69
  (0, lodash_1.set)(partialApplication, application_paths_1.paths.ContributionFunds, contributionFunds);
69
70
  return partialApplication;
70
71
  }
71
- exports.transformFundingPosition = transformFundingPosition;
72
72
  /**
73
73
  * getFee
74
74
  *
@@ -104,4 +104,3 @@ function getFees(fundsRequiredBreakDown, lmi, lmiIncluded, id) {
104
104
  return fee;
105
105
  });
106
106
  }
107
- exports.getFees = getFees;
@@ -11,7 +11,12 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  return t;
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.generateBAS = exports.generateIncomeBusinessDetails = exports.createRentalIncome = exports.transformIncome = exports.getIncomeMapping = exports.EmploymentIncomeTypeMapping = void 0;
14
+ exports.EmploymentIncomeTypeMapping = void 0;
15
+ exports.getIncomeMapping = getIncomeMapping;
16
+ exports.transformIncome = transformIncome;
17
+ exports.createRentalIncome = createRentalIncome;
18
+ exports.generateIncomeBusinessDetails = generateIncomeBusinessDetails;
19
+ exports.generateBAS = generateBAS;
15
20
  const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
16
21
  const application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
17
22
  const lodash_1 = require("lodash");
@@ -112,7 +117,6 @@ function getIncomeMapping(incomeType) {
112
117
  benefitType: `${basePath}.@GovernmentBenefitsType`,
113
118
  };
114
119
  }
115
- exports.getIncomeMapping = getIncomeMapping;
116
120
  /**
117
121
  * Generates an partial application from a partial income event.
118
122
  *
@@ -190,7 +194,6 @@ function transformIncome(payload, applicantId = undefined) {
190
194
  }
191
195
  return partialApplication;
192
196
  }
193
- exports.transformIncome = transformIncome;
194
197
  /**
195
198
  * Creates Rental Income array.
196
199
  *
@@ -215,7 +218,6 @@ function createRentalIncome(amount, frequency, ownership = []) {
215
218
  }
216
219
  return rentalIncome;
217
220
  }
218
- exports.createRentalIncome = createRentalIncome;
219
221
  const selfEmploymentIncomeMapping = {
220
222
  year: '@StartDate',
221
223
  companyProfitBeforeTax: '@ProfitBeforeTax',
@@ -262,7 +264,6 @@ function generateIncomeBusinessDetails(data) {
262
264
  }
263
265
  return income;
264
266
  }
265
- exports.generateIncomeBusinessDetails = generateIncomeBusinessDetails;
266
267
  /**
267
268
  * Generates the BAS array from the bas definition on the event.
268
269
  *
@@ -274,4 +275,3 @@ function generateBAS(bas) {
274
275
  '@SalesAmount': bas.salesAmount,
275
276
  }));
276
277
  }
277
- exports.generateBAS = generateBAS;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformLiability = void 0;
3
+ exports.transformLiability = transformLiability;
4
4
  const application_paths_1 = require("@lendi/act-eac-integrations-protocol/lib/utils/application-paths");
5
5
  const application_paths_2 = require("@lendi/integrations-credit-protocol/utils/application-paths");
6
6
  const lodash_1 = require("lodash");
@@ -126,4 +126,3 @@ function transformLiability({ applicationId, id, liability }) {
126
126
  }
127
127
  return partialApplication;
128
128
  }
129
- exports.transformLiability = transformLiability;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformPercentOwned = void 0;
3
+ exports.transformPercentOwned = transformPercentOwned;
4
4
  const round_decimal_1 = require("../utils/round-decimal");
5
5
  /**
6
6
  * Transform percentOwned to lixi's format.
@@ -19,4 +19,3 @@ function transformPercentOwned({ owners = [] }) {
19
19
  })),
20
20
  };
21
21
  }
22
- exports.transformPercentOwned = transformPercentOwned;