@lendi/act-credit-decisions-transform 1.9.0

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 (204) hide show
  1. package/README.md +31 -0
  2. package/lib/index.d.ts +11 -0
  3. package/lib/index.js +28 -0
  4. package/lib/logger.d.ts +1 -0
  5. package/lib/logger.js +5 -0
  6. package/lib/schemas/application-workflow-event.json +240 -0
  7. package/lib/schemas/credit-report-retrieved-event.json +57 -0
  8. package/lib/schemas/public-applicant-event.json +910 -0
  9. package/lib/schemas/public-application-event.json +250 -0
  10. package/lib/schemas/public-asset-event.json +679 -0
  11. package/lib/schemas/public-asset-liability-relation-delete-event.json +74 -0
  12. package/lib/schemas/public-asset-liability-relation-event.json +73 -0
  13. package/lib/schemas/public-create-applicant-event.json +609 -0
  14. package/lib/schemas/public-delete-applicant-event.json +66 -0
  15. package/lib/schemas/public-delete-asset-event.json +53 -0
  16. package/lib/schemas/public-delete-income-event.json +55 -0
  17. package/lib/schemas/public-employment-delete-event.json +31 -0
  18. package/lib/schemas/public-employment-event.json +278 -0
  19. package/lib/schemas/public-expense-delete-event.json +41 -0
  20. package/lib/schemas/public-expense-event.json +133 -0
  21. package/lib/schemas/public-funding-position-event.json +419 -0
  22. package/lib/schemas/public-income-event.json +242 -0
  23. package/lib/schemas/public-liability-delete-event.json +37 -0
  24. package/lib/schemas/public-liability-event.json +262 -0
  25. package/lib/schemas/public-required-document-event.json +366 -0
  26. package/lib/schemas/public-update-applicant-event.json +606 -0
  27. package/lib/schemas/sf-opportunity-event-out.json +138 -0
  28. package/lib/transform-events/generate-asset-liability-link.d.ts +10 -0
  29. package/lib/transform-events/generate-asset-liability-link.js +29 -0
  30. package/lib/transform-events/generate-credit-report-rebuilt.d.ts +8 -0
  31. package/lib/transform-events/generate-credit-report-rebuilt.js +41 -0
  32. package/lib/transform-events/transform-applicant.d.ts +8 -0
  33. package/lib/transform-events/transform-applicant.js +180 -0
  34. package/lib/transform-events/transform-application-workflow.d.ts +8 -0
  35. package/lib/transform-events/transform-application-workflow.js +30 -0
  36. package/lib/transform-events/transform-application.d.ts +20 -0
  37. package/lib/transform-events/transform-application.js +67 -0
  38. package/lib/transform-events/transform-asset-address.d.ts +25 -0
  39. package/lib/transform-events/transform-asset-address.js +87 -0
  40. package/lib/transform-events/transform-asset.d.ts +58 -0
  41. package/lib/transform-events/transform-asset.js +337 -0
  42. package/lib/transform-events/transform-employment.d.ts +8 -0
  43. package/lib/transform-events/transform-employment.js +106 -0
  44. package/lib/transform-events/transform-expenses.d.ts +41 -0
  45. package/lib/transform-events/transform-expenses.js +121 -0
  46. package/lib/transform-events/transform-funding-position.d.ts +21 -0
  47. package/lib/transform-events/transform-funding-position.js +107 -0
  48. package/lib/transform-events/transform-income.d.ts +48 -0
  49. package/lib/transform-events/transform-income.js +260 -0
  50. package/lib/transform-events/transform-liability.d.ts +12 -0
  51. package/lib/transform-events/transform-liability.js +117 -0
  52. package/lib/transform-events/transform-percent-owned.d.ts +10 -0
  53. package/lib/transform-events/transform-percent-owned.js +22 -0
  54. package/lib/transform-events/transform-required-document.d.ts +67 -0
  55. package/lib/transform-events/transform-required-document.js +148 -0
  56. package/lib/types/enum-mappings/alieo-frequency.d.ts +15 -0
  57. package/lib/types/enum-mappings/alieo-frequency.js +25 -0
  58. package/lib/types/enum-mappings/applicant-gender.d.ts +6 -0
  59. package/lib/types/enum-mappings/applicant-gender.js +11 -0
  60. package/lib/types/enum-mappings/applicant-type.d.ts +6 -0
  61. package/lib/types/enum-mappings/applicant-type.js +10 -0
  62. package/lib/types/enum-mappings/asset-type.d.ts +3 -0
  63. package/lib/types/enum-mappings/asset-type.js +17 -0
  64. package/lib/types/enum-mappings/builder-type.d.ts +7 -0
  65. package/lib/types/enum-mappings/builder-type.js +9 -0
  66. package/lib/types/enum-mappings/company-structure.d.ts +7 -0
  67. package/lib/types/enum-mappings/company-structure.js +10 -0
  68. package/lib/types/enum-mappings/company-type.d.ts +7 -0
  69. package/lib/types/enum-mappings/company-type.js +11 -0
  70. package/lib/types/enum-mappings/construction-type.d.ts +7 -0
  71. package/lib/types/enum-mappings/construction-type.js +10 -0
  72. package/lib/types/enum-mappings/country-code.d.ts +7 -0
  73. package/lib/types/enum-mappings/country-code.js +246 -0
  74. package/lib/types/enum-mappings/employment-basis.d.ts +7 -0
  75. package/lib/types/enum-mappings/employment-basis.js +12 -0
  76. package/lib/types/enum-mappings/expense-frequency.d.ts +7 -0
  77. package/lib/types/enum-mappings/expense-frequency.js +11 -0
  78. package/lib/types/enum-mappings/funding-position.d.ts +18 -0
  79. package/lib/types/enum-mappings/funding-position.js +36 -0
  80. package/lib/types/enum-mappings/government-benefits.d.ts +7 -0
  81. package/lib/types/enum-mappings/government-benefits.js +10 -0
  82. package/lib/types/enum-mappings/guarantor-relationship-type.d.ts +3 -0
  83. package/lib/types/enum-mappings/guarantor-relationship-type.js +16 -0
  84. package/lib/types/enum-mappings/housing-status.d.ts +7 -0
  85. package/lib/types/enum-mappings/housing-status.js +15 -0
  86. package/lib/types/enum-mappings/income-type.d.ts +7 -0
  87. package/lib/types/enum-mappings/income-type.js +16 -0
  88. package/lib/types/enum-mappings/index.d.ts +27 -0
  89. package/lib/types/enum-mappings/index.js +43 -0
  90. package/lib/types/enum-mappings/liability-payment-type.d.ts +7 -0
  91. package/lib/types/enum-mappings/liability-payment-type.js +9 -0
  92. package/lib/types/enum-mappings/liability-type.d.ts +7 -0
  93. package/lib/types/enum-mappings/liability-type.js +21 -0
  94. package/lib/types/enum-mappings/living-expense.d.ts +7 -0
  95. package/lib/types/enum-mappings/living-expense.js +31 -0
  96. package/lib/types/enum-mappings/marital-status.d.ts +7 -0
  97. package/lib/types/enum-mappings/marital-status.js +12 -0
  98. package/lib/types/enum-mappings/postcode.d.ts +6 -0
  99. package/lib/types/enum-mappings/postcode.js +15 -0
  100. package/lib/types/enum-mappings/preferred-repayment.d.ts +7 -0
  101. package/lib/types/enum-mappings/preferred-repayment.js +10 -0
  102. package/lib/types/enum-mappings/proof-of-identity.d.ts +7 -0
  103. package/lib/types/enum-mappings/proof-of-identity.js +10 -0
  104. package/lib/types/enum-mappings/property-expense-category.d.ts +7 -0
  105. package/lib/types/enum-mappings/property-expense-category.js +11 -0
  106. package/lib/types/enum-mappings/public-financial-asset.d.ts +7 -0
  107. package/lib/types/enum-mappings/public-financial-asset.js +12 -0
  108. package/lib/types/enum-mappings/public-primary-purpose.d.ts +7 -0
  109. package/lib/types/enum-mappings/public-primary-purpose.js +9 -0
  110. package/lib/types/enum-mappings/public-property-status.d.ts +7 -0
  111. package/lib/types/enum-mappings/public-property-status.js +11 -0
  112. package/lib/types/enum-mappings/public-property-type.d.ts +7 -0
  113. package/lib/types/enum-mappings/public-property-type.js +23 -0
  114. package/lib/types/enum-mappings/residency-status.d.ts +7 -0
  115. package/lib/types/enum-mappings/residency-status.js +11 -0
  116. package/lib/types/enum-mappings/title-gender.d.ts +7 -0
  117. package/lib/types/enum-mappings/title-gender.js +13 -0
  118. package/lib/types/enum-mappings/title.d.ts +7 -0
  119. package/lib/types/enum-mappings/title.js +13 -0
  120. package/lib/types/enum-mappings/to-be-purchased.d.ts +5 -0
  121. package/lib/types/enum-mappings/to-be-purchased.js +8 -0
  122. package/lib/types/enum-mappings/to-be-used-as-security.d.ts +5 -0
  123. package/lib/types/enum-mappings/to-be-used-as-security.js +8 -0
  124. package/lib/types/enum-mappings/transaction-type.d.ts +7 -0
  125. package/lib/types/enum-mappings/transaction-type.js +9 -0
  126. package/lib/types/enum-mappings/trust.d.ts +7 -0
  127. package/lib/types/enum-mappings/trust.js +14 -0
  128. package/lib/types/enum-mappings/verification.d.ts +3 -0
  129. package/lib/types/enum-mappings/verification.js +13 -0
  130. package/lib/types/events/applicant-delete.d.ts +42 -0
  131. package/lib/types/events/applicant-delete.js +15 -0
  132. package/lib/types/events/application-workflow.d.ts +233 -0
  133. package/lib/types/events/application-workflow.js +172 -0
  134. package/lib/types/events/asset-delete.d.ts +33 -0
  135. package/lib/types/events/asset-delete.js +15 -0
  136. package/lib/types/events/asset-liability-relation-delete.d.ts +52 -0
  137. package/lib/types/events/asset-liability-relation-delete.js +15 -0
  138. package/lib/types/events/credit-report-retrieved.d.ts +36 -0
  139. package/lib/types/events/credit-report-retrieved.js +15 -0
  140. package/lib/types/events/employment-delete.d.ts +19 -0
  141. package/lib/types/events/employment-delete.js +7 -0
  142. package/lib/types/events/expense-delete.d.ts +21 -0
  143. package/lib/types/events/expense-delete.js +7 -0
  144. package/lib/types/events/funding-position.d.ts +116 -0
  145. package/lib/types/events/funding-position.js +34 -0
  146. package/lib/types/events/income-delete.d.ts +33 -0
  147. package/lib/types/events/income-delete.js +15 -0
  148. package/lib/types/events/liability-delete.d.ts +17 -0
  149. package/lib/types/events/liability-delete.js +7 -0
  150. package/lib/types/events/opportunity.d.ts +102 -0
  151. package/lib/types/events/opportunity.js +47 -0
  152. package/lib/types/events/public-applicant.d.ts +628 -0
  153. package/lib/types/events/public-applicant.js +411 -0
  154. package/lib/types/events/public-application.d.ts +151 -0
  155. package/lib/types/events/public-application.js +103 -0
  156. package/lib/types/events/public-asset-liability-relation.d.ts +52 -0
  157. package/lib/types/events/public-asset-liability-relation.js +15 -0
  158. package/lib/types/events/public-asset.d.ts +502 -0
  159. package/lib/types/events/public-asset.js +348 -0
  160. package/lib/types/events/public-employment.d.ts +121 -0
  161. package/lib/types/events/public-employment.js +46 -0
  162. package/lib/types/events/public-expense.d.ts +84 -0
  163. package/lib/types/events/public-expense.js +51 -0
  164. package/lib/types/events/public-funding-position.d.ts +341 -0
  165. package/lib/types/events/public-funding-position.js +20 -0
  166. package/lib/types/events/public-income.d.ts +144 -0
  167. package/lib/types/events/public-income.js +65 -0
  168. package/lib/types/events/public-liability.d.ts +140 -0
  169. package/lib/types/events/public-liability.js +68 -0
  170. package/lib/types/events/public-required-document.d.ts +374 -0
  171. package/lib/types/events/public-required-document.js +297 -0
  172. package/lib/types/partial-application.d.ts +3 -0
  173. package/lib/types/partial-application.js +2 -0
  174. package/lib/types/recursive-partial.d.ts +3 -0
  175. package/lib/types/recursive-partial.js +2 -0
  176. package/lib/update-application/merge-application.d.ts +14 -0
  177. package/lib/update-application/merge-application.js +175 -0
  178. package/lib/update-application/remove-ids-not-required.d.ts +11 -0
  179. package/lib/update-application/remove-ids-not-required.js +63 -0
  180. package/lib/update-application/update-primary-applicant.d.ts +27 -0
  181. package/lib/update-application/update-primary-applicant.js +46 -0
  182. package/lib/utils/address-tools.d.ts +84 -0
  183. package/lib/utils/address-tools.js +176 -0
  184. package/lib/utils/clean-up.d.ts +7 -0
  185. package/lib/utils/clean-up.js +24 -0
  186. package/lib/utils/errors.d.ts +28 -0
  187. package/lib/utils/errors.js +43 -0
  188. package/lib/utils/formatYesNo.d.ts +8 -0
  189. package/lib/utils/formatYesNo.js +12 -0
  190. package/lib/utils/generate-address.d.ts +19 -0
  191. package/lib/utils/generate-address.js +97 -0
  192. package/lib/utils/get-financial-institution.d.ts +8 -0
  193. package/lib/utils/get-financial-institution.js +17 -0
  194. package/lib/utils/is-asset-type.d.ts +25 -0
  195. package/lib/utils/is-asset-type.js +46 -0
  196. package/lib/utils/is-income-type.d.ts +73 -0
  197. package/lib/utils/is-income-type.js +134 -0
  198. package/lib/utils/iso-date.d.ts +7 -0
  199. package/lib/utils/iso-date.js +12 -0
  200. package/lib/utils/normalise-date.d.ts +8 -0
  201. package/lib/utils/normalise-date.js +17 -0
  202. package/lib/utils/round-decimal.d.ts +6 -0
  203. package/lib/utils/round-decimal.js +12 -0
  204. package/package.json +78 -0
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformStandard = exports.transformAddress = exports.standardMapping = exports.getAddressMapping = void 0;
4
+ const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
5
+ const lodash_1 = require("lodash");
6
+ const enum_mappings_1 = require("../types/enum-mappings");
7
+ const address_tools_1 = require("../utils/address-tools");
8
+ /**
9
+ *
10
+ * @param address
11
+ */
12
+ function getAddressMapping(address) {
13
+ return {
14
+ city: '@Suburb',
15
+ country: '@Country',
16
+ postcode: (0, address_tools_1.isOverseasAddress)(address) ? '@OverseasPostCode' : '@AustralianPostCode',
17
+ state: (0, address_tools_1.isOverseasAddress)(address) ? '@OverseasState' : '@AustralianState',
18
+ standard: 'Standard',
19
+ formatted: '@Country',
20
+ };
21
+ }
22
+ exports.getAddressMapping = getAddressMapping;
23
+ exports.standardMapping = {
24
+ streetName: '@StreetName',
25
+ streetType: '@StreetType',
26
+ streetNumber: '@StreetNumber',
27
+ level: '@Level',
28
+ unit: '@Unit',
29
+ };
30
+ /**
31
+ * Generates an address for an asset.
32
+ *
33
+ * @param address: An address object.
34
+ * @param id: address event id.
35
+ * @param toBeUsedAsSecurity
36
+ * @param address
37
+ * @param id
38
+ * @returns A transformed address object.
39
+ */
40
+ function transformAddress(address, id) {
41
+ const transformedAddress = {
42
+ '@UniqueID': id,
43
+ };
44
+ const addressMapping = getAddressMapping(address);
45
+ // for an Australian address: if no postcode is provided, infer one from the state:
46
+ if (!(0, address_tools_1.isOverseasAddress)(address) && address.state && !address.postcode) {
47
+ address.postcode = enum_mappings_1.postcodeMapping[address.state];
48
+ }
49
+ for (const [key, value] of Object.entries(address)) {
50
+ if (addressMapping[key]) {
51
+ switch (key) {
52
+ case 'standard':
53
+ (0, lodash_1.set)(transformedAddress, addressMapping[key], transformStandard(value));
54
+ break;
55
+ case 'country':
56
+ (0, lodash_1.set)(transformedAddress, addressMapping[key], (0, address_tools_1.isOverseasAddress)(address) ? enum_mappings_1.countryCodeMapping[value] : lixi_internal_request_1.CountryCodeList.Au);
57
+ break;
58
+ case 'formatted':
59
+ if (!address.country) {
60
+ const country = (0, address_tools_1.extractCountryFromFormatted)(value);
61
+ (0, lodash_1.set)(transformedAddress, addressMapping[key], enum_mappings_1.countryCodeMapping[country]);
62
+ }
63
+ break;
64
+ default:
65
+ (0, lodash_1.set)(transformedAddress, addressMapping[key], value);
66
+ break;
67
+ }
68
+ }
69
+ }
70
+ return transformedAddress;
71
+ }
72
+ exports.transformAddress = transformAddress;
73
+ /**
74
+ * @description Generates an address standard.
75
+ * @param {AddressStandard} addressStandard An address standard object.
76
+ * @returns {Partial<Standard>} A transformed standard object.
77
+ */
78
+ function transformStandard(addressStandard) {
79
+ const transformedStandard = {};
80
+ for (const [key, value] of Object.entries(addressStandard)) {
81
+ if (exports.standardMapping[key]) {
82
+ (0, lodash_1.set)(transformedStandard, exports.standardMapping[key], value);
83
+ }
84
+ }
85
+ return transformedStandard;
86
+ }
87
+ exports.transformStandard = transformStandard;
@@ -0,0 +1,58 @@
1
+ import { LivingExpense, OccupancyList, PropertyExpense as LIXIPropertyExpense } from '@lendi/integrations-credit-protocol/types/lixi-internal-request';
2
+ import { PropertyType as LixiPropertyType, Residential } from '@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request';
3
+ import { Asset, Payload, PercentOwned, PropertyExpense, PropertyType } from '../types/events/public-asset';
4
+ import { PartialApplication } from '../types/partial-application';
5
+ export interface PropertyTypeMapping {
6
+ path: string;
7
+ value: Residential | LixiPropertyType;
8
+ }
9
+ export declare const propertyTypeNameList: string[];
10
+ export declare const residentialTypeList: string[];
11
+ /**
12
+ * Generates a partial internal request from a partial public asset event.
13
+ *
14
+ * @param {Payload} asset - A partial public asset.
15
+ * @returns {PartialApplication} A partial InternalRequest.
16
+ */
17
+ export declare function transformAsset({ asset, applicationId, id }: Payload): PartialApplication;
18
+ /**
19
+ * @description Map the propertyType to a RealEstateAsset path and the value.
20
+ * @param {PropertyType} propertyType - A propertyType.
21
+ * @returns {PropertyTypeMapping | null} A path and value to be used for property type mapping.
22
+ */
23
+ export declare function getPropertyType(propertyType: PropertyType): PropertyTypeMapping | null;
24
+ /**
25
+ * @description Get the asset transform mapping for various asset types.
26
+ * @param {Asset} asset An Asset
27
+ * @returns {Record<string, string>} Asset Transform Mapping.
28
+ */
29
+ export declare function getAssetMapping(asset: Asset): Record<string, string>;
30
+ /**
31
+ * Creates living expense items from a propertyExpense object.
32
+ *
33
+ * @param percentOwned: owners of the property
34
+ * @param assetId: Asset id
35
+ * @param propertyExpenses: propertyExpenses items
36
+ * @param percentOwned
37
+ * @param assetId
38
+ * @param propertyExpenses
39
+ */
40
+ export declare function generateLivingExpenses(percentOwned: PercentOwned, assetId: string, propertyExpenses: PropertyExpense[]): LivingExpense[];
41
+ /**
42
+ * Creates PropertyExpense array on RealEstateAsset from the same array on the event.
43
+ *
44
+ * @param propertyExpenses
45
+ */
46
+ export declare function generatePropertyExpenses(propertyExpenses: PropertyExpense[]): LIXIPropertyExpense[];
47
+ /**
48
+ * Determines the occupancy based on the list of property expense types available.
49
+ *
50
+ * @param propertyExpenses
51
+ */
52
+ export declare function determineOccupancy(propertyExpenses: PropertyExpense[]): OccupancyList;
53
+ /**
54
+ * Calculates the correct amount and frequency.
55
+ *
56
+ * @param expense
57
+ */
58
+ export declare function normalizeAmounts(expense: PropertyExpense): PropertyExpense;
@@ -0,0 +1,337 @@
1
+ "use strict";
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;
4
+ const lixi_internal_request_1 = require("@lendi/integrations-credit-protocol/types/lixi-internal-request");
5
+ const application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
6
+ const lixi_internal_request_2 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
7
+ const lodash_1 = require("lodash");
8
+ const uuid_1 = require("uuid");
9
+ const __1 = require("..");
10
+ const logger_1 = require("../logger");
11
+ const enum_mappings_1 = require("../types/enum-mappings");
12
+ const builder_type_1 = require("../types/enum-mappings/builder-type");
13
+ const construction_type_1 = require("../types/enum-mappings/construction-type");
14
+ const public_asset_1 = require("../types/events/public-asset");
15
+ const public_expense_1 = require("../types/events/public-expense");
16
+ const get_financial_institution_1 = require("../utils/get-financial-institution");
17
+ const is_asset_type_1 = require("../utils/is-asset-type");
18
+ const round_decimal_1 = require("../utils/round-decimal");
19
+ const transform_asset_address_1 = require("./transform-asset-address");
20
+ const transform_percent_owned_1 = require("./transform-percent-owned");
21
+ exports.propertyTypeNameList = Object.values(lixi_internal_request_2.Custom2PropertyTypeNameList);
22
+ exports.residentialTypeList = Object.values(lixi_internal_request_1.ResidentialTypeList);
23
+ // will add this path to protocol
24
+ const constructionDetailsPath = `${application_paths_1.paths.RealEstateAsset}.ConstructionDetails`;
25
+ const constructionDetailsMapping = {
26
+ builderType: `${constructionDetailsPath}.@BuilderType`,
27
+ buildPriceAmount: `${constructionDetailsPath}.@BuildPriceAmount`,
28
+ constructionType: `${constructionDetailsPath}.@Type`,
29
+ estimatedValue: `${constructionDetailsPath}.@TotalAmount`,
30
+ isFixedPriceContract: `${constructionDetailsPath}.@FixedPriceContract`,
31
+ landEstimatedValue: `${constructionDetailsPath}.@LandValue`,
32
+ otherConstructionCosts: `${constructionDetailsPath}.@OutOfContractItemsCost`,
33
+ };
34
+ /**
35
+ * Generates a partial internal request from a partial public asset event.
36
+ *
37
+ * @param {Payload} asset - A partial public asset.
38
+ * @returns {PartialApplication} A partial InternalRequest.
39
+ */
40
+ function transformAsset({ asset, applicationId, id }) {
41
+ var _a;
42
+ const isPropertyAsset = (0, is_asset_type_1.isRealEstateAsset)(asset);
43
+ const idPath = isPropertyAsset ? `${application_paths_1.paths.RealEstateAsset}.@UniqueID` : `${application_paths_1.paths.NonRealEstateAsset}.@UniqueID`;
44
+ const addressId = `${id}-address`;
45
+ const assetMapping = getAssetMapping(asset);
46
+ const partialApplication = {};
47
+ (0, lodash_1.set)(partialApplication, application_paths_1.paths.ApplicationId, applicationId);
48
+ (0, lodash_1.set)(partialApplication, idPath, id);
49
+ if (isPropertyAsset) {
50
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.RealEstateAsset}.@MultipleDwellings`, lixi_internal_request_1.YesNoList.No);
51
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.RealEstateAsset}.@x_Address`, addressId);
52
+ }
53
+ else {
54
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.@Type`, enum_mappings_1.assetTypeMapping[asset.type]);
55
+ }
56
+ if ((0, is_asset_type_1.isFinancialAsset)(asset)) {
57
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.@Type`, lixi_internal_request_1.NonRealEstateAssetTypeList.FinancialAsset);
58
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.FinancialAsset.@Type`, enum_mappings_1.financialAssetMapping[asset.type]);
59
+ }
60
+ if ((0, is_asset_type_1.isOtherAsset)(asset)) {
61
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.@Type`, lixi_internal_request_1.NonRealEstateAssetTypeList.Other);
62
+ }
63
+ switch (asset.type) {
64
+ case public_asset_1.AssetType.Vehicle:
65
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.@Type`, lixi_internal_request_1.NonRealEstateAssetTypeList.MotorVehicleAndTransport);
66
+ break;
67
+ case public_asset_1.AssetType.HomeContents:
68
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.OtherAsset.@Type`, lixi_internal_request_1.OtherAssetTypeList.HomeContents);
69
+ break;
70
+ case public_asset_1.AssetType.Gifts:
71
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.OtherAsset.@Description`, asset.description || 'Asset Gifts');
72
+ break;
73
+ case public_asset_1.AssetType.OtherAsset:
74
+ if (asset.description) {
75
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.NonRealEstateAsset}.OtherAsset.@Description`, asset.description);
76
+ }
77
+ break;
78
+ }
79
+ for (const [key, value] of Object.entries(asset)) {
80
+ if (assetMapping[key]) {
81
+ switch (key) {
82
+ case 'contractDetails':
83
+ const { contractDate, estimatedSettlementDate } = value;
84
+ if (contractDate)
85
+ (0, lodash_1.set)(partialApplication, assetMapping.contractDate, contractDate);
86
+ if (estimatedSettlementDate)
87
+ (0, lodash_1.set)(partialApplication, assetMapping.estimatedSettlementDate, estimatedSettlementDate);
88
+ break;
89
+ case 'primaryPurpose':
90
+ (0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.primaryPurposeMapping[value]);
91
+ break;
92
+ case 'toBePurchased':
93
+ (0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.toBePurchasedMapping[value]);
94
+ break;
95
+ case 'propertyExpenses':
96
+ if (!asset.percentOwned || (0, lodash_1.isEmpty)((_a = asset.percentOwned) === null || _a === void 0 ? void 0 : _a.owners)) {
97
+ break;
98
+ }
99
+ const propertyExpenses = generatePropertyExpenses(value);
100
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.RealEstateAsset}.PropertyExpense`, propertyExpenses);
101
+ const livingExpenses = generateLivingExpenses(asset.percentOwned, id, value);
102
+ (0, lodash_1.set)(partialApplication, assetMapping[key], livingExpenses);
103
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.RealEstateAsset}.@Occupancy`, determineOccupancy(value));
104
+ break;
105
+ case 'propertyStatus':
106
+ (0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.propertyStatusMapping[value]);
107
+ break;
108
+ case 'toBeUsedAsSecurity':
109
+ if (isPropertyAsset)
110
+ (0, lodash_1.set)(partialApplication, assetMapping[key], enum_mappings_1.toBeUsedAsSecurityMapping[value]);
111
+ break;
112
+ case 'propertyType':
113
+ const propertyTypeMapping = getPropertyType(value);
114
+ if (!propertyTypeMapping) {
115
+ logger_1.logger.warn({ message: `Unknown propertyType ${value} for asset ${id}`, applicationId });
116
+ }
117
+ const { path, value: mappedValue } = propertyTypeMapping;
118
+ (0, lodash_1.set)(partialApplication, path, mappedValue);
119
+ break;
120
+ case 'zoneType':
121
+ if (asset.zoneType === public_asset_1.ZoneType.Commercial) {
122
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.RealEstateAsset}.Commercial.@Type`, lixi_internal_request_1.OtherAssetTypeList.Other);
123
+ (0, lodash_1.set)(partialApplication, assetMapping[key], lixi_internal_request_1.Custom6TypeList.Commercial);
124
+ }
125
+ else {
126
+ (0, lodash_1.set)(partialApplication, assetMapping[key], lixi_internal_request_1.Custom6TypeList.Residential);
127
+ }
128
+ break;
129
+ case 'financialInstitution':
130
+ if ((0, is_asset_type_1.isFinancialAsset)(asset)) {
131
+ const financialInstitution = (0, get_financial_institution_1.getFinancialInstitution)(value.toString());
132
+ (0, lodash_1.set)(partialApplication, assetMapping[key], financialInstitution);
133
+ }
134
+ break;
135
+ case 'year':
136
+ (0, lodash_1.set)(partialApplication, assetMapping[key], value.toString());
137
+ break;
138
+ case 'address':
139
+ (0, lodash_1.set)(partialApplication, assetMapping[key], (0, transform_asset_address_1.transformAddress)(value, addressId));
140
+ break;
141
+ case 'isConstruction':
142
+ (0, lodash_1.set)(partialApplication, assetMapping[key], (0, __1.booleanMapping)(value));
143
+ break;
144
+ case 'percentOwned':
145
+ const percentOwned = (0, transform_percent_owned_1.transformPercentOwned)(value);
146
+ if (percentOwned) {
147
+ (0, lodash_1.set)(partialApplication, assetMapping[key], percentOwned);
148
+ }
149
+ break;
150
+ case 'constructionDetails':
151
+ for (const [key, constructionDetailsValue] of Object.entries(value)) {
152
+ switch (key) {
153
+ case 'builderType':
154
+ (0, lodash_1.set)(partialApplication, constructionDetailsMapping[key], builder_type_1.builderTypeMapping[constructionDetailsValue]);
155
+ break;
156
+ case 'constructionType':
157
+ (0, lodash_1.set)(partialApplication, constructionDetailsMapping[key], construction_type_1.constructionTypeMapping[constructionDetailsValue]);
158
+ break;
159
+ case 'isFixedPriceContract':
160
+ (0, lodash_1.set)(partialApplication, constructionDetailsMapping[key], (0, __1.booleanMapping)(constructionDetailsValue));
161
+ break;
162
+ default:
163
+ (0, lodash_1.set)(partialApplication, constructionDetailsMapping[key], constructionDetailsValue);
164
+ break;
165
+ }
166
+ }
167
+ break;
168
+ case 'estimatedValue':
169
+ if (asset.isConstruction) {
170
+ (0, lodash_1.set)(partialApplication, constructionDetailsMapping[key], Math.trunc(value));
171
+ }
172
+ (0, lodash_1.set)(partialApplication, assetMapping[key], Math.trunc(value));
173
+ break;
174
+ default:
175
+ (0, lodash_1.set)(partialApplication, assetMapping[key], value);
176
+ break;
177
+ }
178
+ }
179
+ }
180
+ return partialApplication;
181
+ }
182
+ exports.transformAsset = transformAsset;
183
+ /**
184
+ * @description Map the propertyType to a RealEstateAsset path and the value.
185
+ * @param {PropertyType} propertyType - A propertyType.
186
+ * @returns {PropertyTypeMapping | null} A path and value to be used for property type mapping.
187
+ */
188
+ function getPropertyType(propertyType) {
189
+ const value = enum_mappings_1.propertyTypeMapping[propertyType];
190
+ if (exports.residentialTypeList.includes(value)) {
191
+ return {
192
+ path: `${application_paths_1.paths.RealEstateAsset}.Residential`,
193
+ value: {
194
+ '@Type': value,
195
+ },
196
+ };
197
+ }
198
+ if (exports.propertyTypeNameList.includes(value)) {
199
+ return {
200
+ path: `${application_paths_1.paths.RealEstateAsset}.PropertyType`,
201
+ value: {
202
+ '@PropertyTypeName': value,
203
+ '@CategoryTypeName': lixi_internal_request_2.Custom1CategoryTypeNameList.Residential,
204
+ },
205
+ };
206
+ }
207
+ return null;
208
+ }
209
+ exports.getPropertyType = getPropertyType;
210
+ /**
211
+ * @description Get the asset transform mapping for various asset types.
212
+ * @param {Asset} asset An Asset
213
+ * @returns {Record<string, string>} Asset Transform Mapping.
214
+ */
215
+ function getAssetMapping(asset) {
216
+ let estimatedValue = `${application_paths_1.paths.NonRealEstateAsset}.EstimatedValue.@Value`;
217
+ let percentOwned = `${application_paths_1.paths.NonRealEstateAsset}.PercentOwned`;
218
+ const baseMapping = {
219
+ estimatedValue,
220
+ percentOwned,
221
+ };
222
+ if ((0, is_asset_type_1.isRealEstateAsset)(asset)) {
223
+ estimatedValue = `${application_paths_1.paths.RealEstateAsset}.EstimatedValue.@Value`;
224
+ percentOwned = `${application_paths_1.paths.RealEstateAsset}.PercentOwned`;
225
+ return {
226
+ address: application_paths_1.paths.Address,
227
+ contractDetails: 'contractDetails',
228
+ contractDate: `${application_paths_1.paths.RealEstateAsset}.ContractDetails.@ContractDate`,
229
+ estimatedSettlementDate: `${application_paths_1.paths.RealEstateAsset}.ContractDetails.@EstimatedSettlementDate`,
230
+ estimatedValue,
231
+ percentOwned,
232
+ primaryPurpose: `${application_paths_1.paths.RealEstateAsset}.@PrimaryPurpose`,
233
+ propertyExpenses: application_paths_1.paths.LivingExpenses,
234
+ propertyStatus: `${application_paths_1.paths.RealEstateAsset}.@Status`,
235
+ propertyType: `${application_paths_1.paths.RealEstateAsset}.Residential`,
236
+ toBePurchased: `${application_paths_1.paths.RealEstateAsset}.@Transaction`,
237
+ toBeUsedAsSecurity: `${application_paths_1.paths.RealEstateAsset}.@ToBeUsedAsSecurity`,
238
+ zoneType: `${application_paths_1.paths.RealEstateAsset}.Zoning.@Type`,
239
+ isConstruction: `${application_paths_1.paths.RealEstateAsset}.@Construction`,
240
+ constructionDetails: `${application_paths_1.paths.RealEstateAsset}.ConstructionDetails`,
241
+ };
242
+ }
243
+ if ((0, is_asset_type_1.isMotorVehicle)(asset)) {
244
+ return Object.assign(Object.assign({}, baseMapping), { make: `${application_paths_1.paths.NonRealEstateAsset}.MotorVehicle.@Make`, model: `${application_paths_1.paths.NonRealEstateAsset}.MotorVehicle.@Model`, year: `${application_paths_1.paths.NonRealEstateAsset}.MotorVehicle.@Year` });
245
+ }
246
+ if ((0, is_asset_type_1.isFinancialAsset)(asset)) {
247
+ return Object.assign(Object.assign({}, baseMapping), { financialInstitution: `${application_paths_1.paths.NonRealEstateAsset}.FinancialAsset.AccountNumber.@FinancialInstitution`, financialInstitutionAccountNumber: `${application_paths_1.paths.NonRealEstateAsset}.FinancialAsset.AccountNumber.@AccountNumber`, financialInstitutionBsb: `${application_paths_1.paths.NonRealEstateAsset}.FinancialAsset.AccountNumber.@BSB` });
248
+ }
249
+ return baseMapping;
250
+ }
251
+ exports.getAssetMapping = getAssetMapping;
252
+ /**
253
+ * Creates living expense items from a propertyExpense object.
254
+ *
255
+ * @param percentOwned: owners of the property
256
+ * @param assetId: Asset id
257
+ * @param propertyExpenses: propertyExpenses items
258
+ * @param percentOwned
259
+ * @param assetId
260
+ * @param propertyExpenses
261
+ */
262
+ function generateLivingExpenses(percentOwned, assetId, propertyExpenses) {
263
+ let livingExpenses = [];
264
+ const filteredPropertyExpenses = propertyExpenses.filter((expense) => expense.amount !== undefined);
265
+ percentOwned.owners.forEach((owner) => {
266
+ const expenses = filteredPropertyExpenses.map((expense) => {
267
+ normalizeAmounts(expense);
268
+ return {
269
+ '@Amount': (0, round_decimal_1.roundDecimal)(expense.amount * owner.percent),
270
+ '@Category': enum_mappings_1.livingExpenseMapping[expense.type],
271
+ '@Frequency': enum_mappings_1.incomeExpenseFrequencyMapping[expense.frequency],
272
+ '@UniqueID': `${(0, uuid_1.v4)()}--${assetId}`,
273
+ PercentResponsible: {
274
+ Owner: [
275
+ {
276
+ '@Percent': 100,
277
+ '@x_Party': owner.applicantId,
278
+ },
279
+ ],
280
+ },
281
+ };
282
+ });
283
+ livingExpenses = livingExpenses.concat(expenses);
284
+ });
285
+ return livingExpenses;
286
+ }
287
+ exports.generateLivingExpenses = generateLivingExpenses;
288
+ /**
289
+ * Creates PropertyExpense array on RealEstateAsset from the same array on the event.
290
+ *
291
+ * @param propertyExpenses
292
+ */
293
+ function generatePropertyExpenses(propertyExpenses) {
294
+ return propertyExpenses
295
+ .filter((expense) => expense.amount !== undefined)
296
+ .map((expense) => {
297
+ normalizeAmounts(expense);
298
+ return {
299
+ '@Amount': expense.amount,
300
+ '@Category': enum_mappings_1.propertyExpenseCategoryMapping[expense.type],
301
+ '@Frequency': enum_mappings_1.incomeExpenseFrequencyMapping[expense.frequency],
302
+ };
303
+ });
304
+ }
305
+ exports.generatePropertyExpenses = generatePropertyExpenses;
306
+ /**
307
+ * Determines the occupancy based on the list of property expense types available.
308
+ *
309
+ * @param propertyExpenses
310
+ */
311
+ function determineOccupancy(propertyExpenses) {
312
+ const propertyExpenseCategoryList = propertyExpenses.map((expense) => expense.type);
313
+ if (propertyExpenseCategoryList.includes(public_asset_1.PropertyExpenseType.InvestmentPropertyRunningCosts)) {
314
+ return lixi_internal_request_1.OccupancyList.NonOwner;
315
+ }
316
+ else if (propertyExpenseCategoryList.includes(public_asset_1.PropertyExpenseType.PrimaryResidenceRunningCosts && public_asset_1.PropertyExpenseType.SecondaryResidenceRunningCosts)) {
317
+ return lixi_internal_request_1.OccupancyList.OwnerSecondary;
318
+ }
319
+ else if (propertyExpenseCategoryList.some((item) => item !== public_asset_1.PropertyExpenseType.SecondaryResidenceRunningCosts &&
320
+ item === public_asset_1.PropertyExpenseType.PrimaryResidenceRunningCosts)) {
321
+ return lixi_internal_request_1.OccupancyList.OwnerPrimary;
322
+ }
323
+ }
324
+ exports.determineOccupancy = determineOccupancy;
325
+ /**
326
+ * Calculates the correct amount and frequency.
327
+ *
328
+ * @param expense
329
+ */
330
+ function normalizeAmounts(expense) {
331
+ if (expense.frequency === public_expense_1.Frequency.Quarterly) {
332
+ expense.frequency = public_expense_1.Frequency.Yearly;
333
+ expense.amount *= 4;
334
+ }
335
+ return expense;
336
+ }
337
+ exports.normalizeAmounts = normalizeAmounts;
@@ -0,0 +1,8 @@
1
+ import { Payload } from '../types/events/public-employment';
2
+ /**
3
+ * Generates a partial application from a employment event.
4
+ *
5
+ * @param employment a employment event payload.
6
+ * @returns partialApplication an incomplete application.
7
+ */
8
+ export declare function transformEmployment(employment: Payload, isSelfEmployed: boolean): {};
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformEmployment = void 0;
4
+ const lixi_internal_request_1 = require("@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request");
5
+ const lodash_1 = require("lodash");
6
+ const application_paths_1 = require("@lendi/integrations-credit-protocol/utils/application-paths");
7
+ const logger_1 = require("../logger");
8
+ const public_employment_1 = require("../types/events/public-employment");
9
+ const enum_mappings_1 = require("../types/enum-mappings");
10
+ /**
11
+ * Generates a partial application from a employment event.
12
+ *
13
+ * @param employment a employment event payload.
14
+ * @returns partialApplication an incomplete application.
15
+ */
16
+ function transformEmployment(employment, isSelfEmployed) {
17
+ const partialApplication = {};
18
+ let employmentPath = application_paths_1.paths.PAYG;
19
+ const companyId = employment.companyId;
20
+ const { applicationId } = employment;
21
+ // Each one Employment object can only contain one of the three types. Set the three object to undefined so that the
22
+ // other two types will be removed from the final result.
23
+ // @pliu 19/11/19
24
+ (0, lodash_1.set)(partialApplication, application_paths_1.paths.PAYG, undefined);
25
+ (0, lodash_1.set)(partialApplication, application_paths_1.paths.SelfEmployed, undefined);
26
+ (0, lodash_1.set)(partialApplication, application_paths_1.paths.NotEmployed, undefined);
27
+ switch (employment.employmentType) {
28
+ case public_employment_1.EmploymentType.Employee:
29
+ employmentPath = application_paths_1.paths.PAYG;
30
+ // Setting default for onProbation. If field exists in event value will get overwritten.
31
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.@OnProbation`, lixi_internal_request_1.YesNoList.No);
32
+ break;
33
+ case public_employment_1.EmploymentType.SelfEmployed:
34
+ employmentPath = application_paths_1.paths.SelfEmployed;
35
+ if (companyId && isSelfEmployed) {
36
+ (0, lodash_1.set)(partialApplication, `${application_paths_1.paths.CompanyApplicant}.@UniqueID`, companyId);
37
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.@x_Employer`, companyId);
38
+ break;
39
+ }
40
+ break;
41
+ case public_employment_1.EmploymentType.NotWorking:
42
+ employmentPath = application_paths_1.paths.NotEmployed;
43
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.Income.@OtherIncomeAmount`, 0);
44
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.Income.@OtherIncomeFrequency`, lixi_internal_request_1.List.Fortnightly);
45
+ break;
46
+ default:
47
+ logger_1.logger.warn({ message: `Unknown EmploymentType ${employment.employmentType}`, applicationId });
48
+ }
49
+ const employmentMapping = {
50
+ applicationId: application_paths_1.paths.ApplicationId,
51
+ applicantId: `${application_paths_1.paths.PersonApplicant}.@UniqueID`,
52
+ companyId: `${application_paths_1.paths.RelatedCompany}.@UniqueID`,
53
+ id: `${employmentPath}.@UniqueID`,
54
+ type: `${employmentPath}.@Status`,
55
+ employmentBasis: `${employmentPath}.@Basis`,
56
+ startDate: `${employmentPath}.@StartDate`,
57
+ endDate: `${employmentPath}.@EndDate`,
58
+ role: `${employmentPath}.@Occupation`,
59
+ onProbation: `${employmentPath}.@OnProbation`,
60
+ };
61
+ for (const [key, value] of Object.entries(employment)) {
62
+ if (employmentMapping[key]) {
63
+ switch (key) {
64
+ case 'type':
65
+ (0, lodash_1.set)(partialApplication, employmentMapping[key], (0, lodash_1.capitalize)(value));
66
+ break;
67
+ case 'employmentBasis':
68
+ (0, lodash_1.set)(partialApplication, employmentMapping[key], enum_mappings_1.paygEmploymentBasisMapping[value]);
69
+ break;
70
+ case 'companyId':
71
+ if (isSelfEmployed && employment.employmentType === public_employment_1.EmploymentType.Employee) {
72
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.@x_Employer`, value);
73
+ (0, lodash_1.set)(partialApplication, employmentMapping[key], value);
74
+ }
75
+ if (!isSelfEmployed) {
76
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.@x_Employer`, value);
77
+ (0, lodash_1.set)(partialApplication, employmentMapping[key], value);
78
+ }
79
+ break;
80
+ case 'onProbation':
81
+ if (employment.employmentType === public_employment_1.EmploymentType.Employee) {
82
+ const onProbation = value ? lixi_internal_request_1.YesNoList.Yes : lixi_internal_request_1.YesNoList.No;
83
+ (0, lodash_1.set)(partialApplication, employmentMapping[key], onProbation);
84
+ }
85
+ break;
86
+ case 'role':
87
+ const { anzsco = {}, asco = {} } = value;
88
+ if (anzsco.code) {
89
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.@ANZSCOOccupationCode`, anzsco.code.toString());
90
+ }
91
+ if (asco.code) {
92
+ (0, lodash_1.set)(partialApplication, `${employmentPath}.@OccupationCode`, asco.code);
93
+ }
94
+ if (anzsco.occupation) {
95
+ (0, lodash_1.set)(partialApplication, employmentMapping[key], anzsco.occupation);
96
+ }
97
+ break;
98
+ default:
99
+ (0, lodash_1.set)(partialApplication, employmentMapping[key], value);
100
+ break;
101
+ }
102
+ }
103
+ }
104
+ return partialApplication;
105
+ }
106
+ exports.transformEmployment = transformEmployment;
@@ -0,0 +1,41 @@
1
+ import { LivingExpense, OtherCommitment } from '@lendi/act-eac-integrations-protocol/lib/types/lixi-internal-request';
2
+ import { Expense, ExpenseType, Payload as ExpensePayload } from '../types/events/public-expense';
3
+ import { PartialApplication } from '../types/partial-application';
4
+ export declare const otherCommitmentExpenseTypes: ExpenseType[];
5
+ /**
6
+ * @description Transforms expense items on the application from the event.
7
+ * @returns {PartialApplication} A PartialApplication returned by transforming the expense event.
8
+ * @param expense
9
+ */
10
+ export declare function transformExpenses(expense: ExpensePayload): PartialApplication;
11
+ /**
12
+ * transforms the living expense from the expense array on the event.
13
+ *
14
+ * @param expense: Array of expenses on the event.
15
+ * @param applicantId: Event applicantId.
16
+ * @param index: Index of the map.
17
+ * @param id: Id of the event.
18
+ * @param expense
19
+ * @param applicantId
20
+ * @param index
21
+ * @param id
22
+ */
23
+ export declare function transformExpense(expense: Expense, applicantId: string, index: number, id: string): LivingExpense | OtherCommitment;
24
+ /**
25
+ * @description Normalises expense by amount to 0 if not provided and scales quarterly spending up to yearly.
26
+ * @param {Expense} expense An expense
27
+ * @returns {Expense} An normalised expense.
28
+ */
29
+ export declare function normaliseExpenseAmount(expense: Expense): Expense;
30
+ /**
31
+ * @description Verify if expense is an OtherCommitment.
32
+ * @param {Expense} expense Any Expense item.
33
+ * @returns {boolean} Returns true if an expense type is one of other commitment expenses.
34
+ */
35
+ export declare function isOtherCommitment(expense: Expense): boolean;
36
+ /**
37
+ * @description Check if expense type is LivingExpenseEstimate.
38
+ * @param {Expense} expense An Expense item.
39
+ * @returns {boolean} Returns true if an expense type is LivingExpenseEstimate
40
+ */
41
+ export declare function isLivingExpenseEstimate(expense: Expense): boolean;