@lendi/integrations-transform 1.5.10 → 1.6.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/index.js +26 -10
  3. package/lib/logger.js +5 -2
  4. package/lib/schemas/public-application-event.json +7 -0
  5. package/lib/transform-events/generate-asset-liability-link.js +12 -8
  6. package/lib/transform-events/generate-credit-report-rebuilt.js +12 -8
  7. package/lib/transform-events/generate-employment.js +41 -37
  8. package/lib/transform-events/generate-required-document.d.ts +1 -2
  9. package/lib/transform-events/generate-required-document.js +41 -32
  10. package/lib/transform-events/transform-applicant.js +60 -53
  11. package/lib/transform-events/transform-application-workflow.js +9 -5
  12. package/lib/transform-events/transform-application.d.ts +6 -8
  13. package/lib/transform-events/transform-application.js +30 -25
  14. package/lib/transform-events/transform-asset-address.js +25 -19
  15. package/lib/transform-events/transform-asset.js +128 -118
  16. package/lib/transform-events/transform-expenses.js +39 -31
  17. package/lib/transform-events/transform-funding-position.js +32 -27
  18. package/lib/transform-events/transform-income.js +73 -65
  19. package/lib/transform-events/transform-liability.js +59 -55
  20. package/lib/transform-events/transform-percent-owned.js +7 -3
  21. package/lib/types/enum-mappings/alieo-frequency.js +22 -19
  22. package/lib/types/enum-mappings/asset-type.js +16 -13
  23. package/lib/types/enum-mappings/builder-type.js +8 -5
  24. package/lib/types/enum-mappings/construction-type.js +9 -6
  25. package/lib/types/enum-mappings/country-code.js +245 -242
  26. package/lib/types/enum-mappings/employment-basis.js +11 -8
  27. package/lib/types/enum-mappings/expense-frequency.js +10 -7
  28. package/lib/types/enum-mappings/funding-position.js +32 -29
  29. package/lib/types/enum-mappings/government-benefits.js +9 -6
  30. package/lib/types/enum-mappings/housing-status.js +14 -11
  31. package/lib/types/enum-mappings/income-type.js +15 -12
  32. package/lib/types/enum-mappings/index.js +43 -27
  33. package/lib/types/enum-mappings/liability-payment-type.js +8 -5
  34. package/lib/types/enum-mappings/liability-type.js +20 -17
  35. package/lib/types/enum-mappings/living-expense.js +29 -26
  36. package/lib/types/enum-mappings/marital-status.js +11 -8
  37. package/lib/types/enum-mappings/postcode.js +13 -10
  38. package/lib/types/enum-mappings/preferred-repayment.js +9 -6
  39. package/lib/types/enum-mappings/proof-of-identity.js +9 -6
  40. package/lib/types/enum-mappings/property-expense-category.js +10 -7
  41. package/lib/types/enum-mappings/public-financial-asset.js +11 -8
  42. package/lib/types/enum-mappings/public-primary-purpose.js +8 -5
  43. package/lib/types/enum-mappings/public-property-status.js +10 -7
  44. package/lib/types/enum-mappings/public-property-type.js +22 -19
  45. package/lib/types/enum-mappings/residency-status.js +10 -7
  46. package/lib/types/enum-mappings/title-gender.js +12 -9
  47. package/lib/types/enum-mappings/title.js +12 -9
  48. package/lib/types/enum-mappings/to-be-purchased.js +7 -4
  49. package/lib/types/enum-mappings/to-be-used-as-security.js +7 -4
  50. package/lib/types/enum-mappings/transaction-type.js +8 -5
  51. package/lib/types/enum-mappings/verification.js +12 -9
  52. package/lib/types/events/applicant-delete.js +7 -4
  53. package/lib/types/events/application-workflow.js +13 -10
  54. package/lib/types/events/asset-delete.js +7 -4
  55. package/lib/types/events/asset-liability-relation-delete.js +7 -4
  56. package/lib/types/events/credit-report-retrieved.js +7 -4
  57. package/lib/types/events/employment-delete.js +5 -2
  58. package/lib/types/events/expense-delete.js +5 -2
  59. package/lib/types/events/funding-position.js +9 -6
  60. package/lib/types/events/income-delete.js +7 -4
  61. package/lib/types/events/liability-delete.js +5 -2
  62. package/lib/types/events/opportunity.js +9 -6
  63. package/lib/types/events/public-applicant.js +31 -28
  64. package/lib/types/events/public-application.d.ts +1 -0
  65. package/lib/types/events/public-application.js +29 -26
  66. package/lib/types/events/public-asset-liability-relation.js +7 -4
  67. package/lib/types/events/public-asset.js +29 -26
  68. package/lib/types/events/public-employment.js +21 -18
  69. package/lib/types/events/public-expense.js +11 -8
  70. package/lib/types/events/public-funding-position.js +5 -2
  71. package/lib/types/events/public-income.js +15 -12
  72. package/lib/types/events/public-liability.js +19 -16
  73. package/lib/types/events/public-required-document.js +17 -14
  74. package/lib/types/partial-application.js +2 -1
  75. package/lib/types/recursive-partial.js +2 -1
  76. package/lib/update-application/merge-application.js +6 -2
  77. package/lib/update-application/update-primary-applicant.js +17 -12
  78. package/lib/utils/address-tools.js +43 -33
  79. package/lib/utils/clean-up.js +7 -3
  80. package/lib/utils/formatYesNo.js +6 -2
  81. package/lib/utils/generate-address.js +26 -21
  82. package/lib/utils/get-financial-institution.js +8 -4
  83. package/lib/utils/is-asset-type.js +20 -13
  84. package/lib/utils/is-income-type.js +58 -45
  85. package/lib/utils/iso-date.js +6 -2
  86. package/lib/utils/normalise-date.js +5 -1
  87. package/lib/utils/round-decimal.js +5 -1
  88. package/package.json +3 -3
@@ -1,22 +1,25 @@
1
- import { List as LIXIFrequency } from '@lendi/integrations-protocol/lib/types/lixi-internal-request';
2
- import { RepaymentFrequency } from '../events/public-liability';
3
- import { Frequency } from '../events/public-income';
4
- export const incomeExpenseFrequencyMapping = {
5
- [Frequency.Fortnightly]: LIXIFrequency.Fortnightly,
6
- [Frequency.Monthly]: LIXIFrequency.Monthly,
7
- [Frequency.Weekly]: LIXIFrequency.Weekly,
8
- [Frequency.Quarterly]: LIXIFrequency.Yearly,
9
- [Frequency.Yearly]: LIXIFrequency.Yearly,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rentalIncomeFrequencyMapping = exports.liabilityFrequencyMapping = exports.incomeExpenseFrequencyMapping = void 0;
4
+ const lixi_internal_request_1 = require("@lendi/integrations-protocol/lib/types/lixi-internal-request");
5
+ const public_liability_1 = require("../events/public-liability");
6
+ const public_income_1 = require("../events/public-income");
7
+ exports.incomeExpenseFrequencyMapping = {
8
+ [public_income_1.Frequency.Fortnightly]: lixi_internal_request_1.List.Fortnightly,
9
+ [public_income_1.Frequency.Monthly]: lixi_internal_request_1.List.Monthly,
10
+ [public_income_1.Frequency.Weekly]: lixi_internal_request_1.List.Weekly,
11
+ [public_income_1.Frequency.Quarterly]: lixi_internal_request_1.List.Yearly,
12
+ [public_income_1.Frequency.Yearly]: lixi_internal_request_1.List.Yearly,
10
13
  };
11
- export const liabilityFrequencyMapping = {
12
- [RepaymentFrequency.Yearly]: LIXIFrequency.Yearly,
13
- [RepaymentFrequency.Monthly]: LIXIFrequency.Monthly,
14
- [RepaymentFrequency.Fortnightly]: LIXIFrequency.Fortnightly,
15
- [RepaymentFrequency.Weekly]: LIXIFrequency.Weekly,
14
+ exports.liabilityFrequencyMapping = {
15
+ [public_liability_1.RepaymentFrequency.Yearly]: lixi_internal_request_1.List.Yearly,
16
+ [public_liability_1.RepaymentFrequency.Monthly]: lixi_internal_request_1.List.Monthly,
17
+ [public_liability_1.RepaymentFrequency.Fortnightly]: lixi_internal_request_1.List.Fortnightly,
18
+ [public_liability_1.RepaymentFrequency.Weekly]: lixi_internal_request_1.List.Weekly,
16
19
  };
17
- export const rentalIncomeFrequencyMapping = {
18
- [Frequency.Fortnightly]: LIXIFrequency.Fortnightly,
19
- [Frequency.Monthly]: LIXIFrequency.Monthly,
20
- [Frequency.Weekly]: LIXIFrequency.Weekly,
21
- [Frequency.Yearly]: LIXIFrequency.Yearly,
20
+ exports.rentalIncomeFrequencyMapping = {
21
+ [public_income_1.Frequency.Fortnightly]: lixi_internal_request_1.List.Fortnightly,
22
+ [public_income_1.Frequency.Monthly]: lixi_internal_request_1.List.Monthly,
23
+ [public_income_1.Frequency.Weekly]: lixi_internal_request_1.List.Weekly,
24
+ [public_income_1.Frequency.Yearly]: lixi_internal_request_1.List.Yearly,
22
25
  };
@@ -1,14 +1,17 @@
1
- import { NonRealEstateAssetTypeList } from '@lendi/integrations-credit-protocol/types/lixi-internal-request';
2
- import { AssetType } from '../events/public-asset';
3
- export const assetTypeMapping = {
4
- [AssetType.Gifts]: NonRealEstateAssetTypeList.Other,
5
- [AssetType.HomeContents]: NonRealEstateAssetTypeList.Other,
6
- [AssetType.ManagedFunds]: NonRealEstateAssetTypeList.FinancialAsset,
7
- [AssetType.OtherAsset]: NonRealEstateAssetTypeList.Other,
8
- [AssetType.Property]: null,
9
- [AssetType.SavingCheckAccount]: NonRealEstateAssetTypeList.FinancialAsset,
10
- [AssetType.Shares]: NonRealEstateAssetTypeList.FinancialAsset,
11
- [AssetType.Superannuation]: NonRealEstateAssetTypeList.FinancialAsset,
12
- [AssetType.TermDeposit]: NonRealEstateAssetTypeList.FinancialAsset,
13
- [AssetType.Vehicle]: NonRealEstateAssetTypeList.MotorVehicleAndTransport,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assetTypeMapping = void 0;
4
+ const lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
5
+ const public_asset_1 = require("../events/public-asset");
6
+ exports.assetTypeMapping = {
7
+ [public_asset_1.AssetType.Gifts]: lixi_internal_request_1.NonRealEstateAssetTypeList.Other,
8
+ [public_asset_1.AssetType.HomeContents]: lixi_internal_request_1.NonRealEstateAssetTypeList.Other,
9
+ [public_asset_1.AssetType.ManagedFunds]: lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
10
+ [public_asset_1.AssetType.OtherAsset]: lixi_internal_request_1.NonRealEstateAssetTypeList.Other,
11
+ [public_asset_1.AssetType.Property]: null,
12
+ [public_asset_1.AssetType.SavingCheckAccount]: lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
13
+ [public_asset_1.AssetType.Shares]: lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
14
+ [public_asset_1.AssetType.Superannuation]: lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
15
+ [public_asset_1.AssetType.TermDeposit]: lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset,
16
+ [public_asset_1.AssetType.Vehicle]: lixi_internal_request_1.NonRealEstateAssetTypeList.MotorVehicleAndTransport,
14
17
  };
@@ -1,6 +1,9 @@
1
- import { BuilderTypeList } from '@lendi/integrations-credit-protocol/types/lixi-internal-request';
2
- import { BuilderType } from '../events/public-asset';
3
- export const builderTypeMapping = {
4
- [BuilderType.LicensedBuilder]: BuilderTypeList.LicensedBuilder,
5
- [BuilderType.OwnerBuilder]: BuilderTypeList.OwnerBuilder,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.builderTypeMapping = void 0;
4
+ const lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
5
+ const public_asset_1 = require("../events/public-asset");
6
+ exports.builderTypeMapping = {
7
+ [public_asset_1.BuilderType.LicensedBuilder]: lixi_internal_request_1.BuilderTypeList.LicensedBuilder,
8
+ [public_asset_1.BuilderType.OwnerBuilder]: lixi_internal_request_1.BuilderTypeList.OwnerBuilder,
6
9
  };
@@ -1,7 +1,10 @@
1
- import { ConstructionTypeList } from '@lendi/integrations-credit-protocol/types/lixi-internal-request';
2
- import { ConstructionType } from '../events/public-asset';
3
- export const constructionTypeMapping = {
4
- [ConstructionType.BuildAProperty]: ConstructionTypeList.FullConstruction,
5
- [ConstructionType.KnockdownRebuild]: ConstructionTypeList.HomeExtension,
6
- [ConstructionType.StructuralRenovations]: ConstructionTypeList.Renovation,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.constructionTypeMapping = void 0;
4
+ const lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
5
+ const public_asset_1 = require("../events/public-asset");
6
+ exports.constructionTypeMapping = {
7
+ [public_asset_1.ConstructionType.BuildAProperty]: lixi_internal_request_1.ConstructionTypeList.FullConstruction,
8
+ [public_asset_1.ConstructionType.KnockdownRebuild]: lixi_internal_request_1.ConstructionTypeList.HomeExtension,
9
+ [public_asset_1.ConstructionType.StructuralRenovations]: lixi_internal_request_1.ConstructionTypeList.Renovation,
7
10
  };