@lendi/integrations-transform 1.0.7 → 1.1.1

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 (156) hide show
  1. package/lib/index.d.ts +7 -0
  2. package/lib/index.js +20 -0
  3. package/lib/logger.d.ts +2 -0
  4. package/lib/logger.js +5 -0
  5. package/lib/schemas/credit-report-retrieved-event.json +57 -0
  6. package/lib/schemas/public-applicant-event.json +652 -0
  7. package/lib/schemas/public-application-event.json +224 -0
  8. package/lib/schemas/public-asset-event.json +633 -0
  9. package/lib/schemas/public-asset-liability-relation-delete-event.json +74 -0
  10. package/lib/schemas/public-asset-liability-relation-event.json +73 -0
  11. package/lib/schemas/public-create-applicant-event.json +610 -0
  12. package/lib/schemas/public-delete-applicant-event.json +66 -0
  13. package/lib/schemas/public-delete-asset-event.json +53 -0
  14. package/lib/schemas/public-delete-income-event.json +55 -0
  15. package/lib/schemas/public-employment-delete-event.json +31 -0
  16. package/lib/schemas/public-employment-event.json +302 -0
  17. package/lib/schemas/public-expense-delete-event.json +41 -0
  18. package/lib/schemas/public-expense-event.json +132 -0
  19. package/lib/schemas/public-funding-position-event.json +289 -0
  20. package/lib/schemas/public-income-event.json +242 -0
  21. package/lib/schemas/public-liability-delete-event.json +37 -0
  22. package/lib/schemas/public-liability-event.json +234 -0
  23. package/lib/schemas/public-required-document-event.json +98 -0
  24. package/lib/schemas/public-update-applicant-event.json +607 -0
  25. package/lib/schemas/sf-opportunity-event-out.json +138 -0
  26. package/lib/transform-events/generate-asset-liability-link.d.ts +8 -0
  27. package/lib/transform-events/generate-asset-liability-link.js +29 -0
  28. package/lib/transform-events/generate-asset.d.ts +17 -0
  29. package/lib/transform-events/generate-asset.js +178 -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/generate-employment.d.ts +8 -0
  33. package/lib/transform-events/generate-employment.js +106 -0
  34. package/lib/transform-events/generate-funding-position.d.ts +18 -0
  35. package/lib/transform-events/generate-funding-position.js +82 -0
  36. package/lib/transform-events/generate-income.d.ts +37 -0
  37. package/lib/transform-events/generate-income.js +254 -0
  38. package/lib/transform-events/generate-liability.d.ts +8 -0
  39. package/lib/transform-events/generate-liability.js +87 -0
  40. package/lib/transform-events/generate-lixi-percentowned.d.ts +9 -0
  41. package/lib/transform-events/generate-lixi-percentowned.js +24 -0
  42. package/lib/transform-events/generate-opportunity.d.ts +8 -0
  43. package/lib/transform-events/generate-opportunity.js +32 -0
  44. package/lib/transform-events/generate-required-document.d.ts +8 -0
  45. package/lib/transform-events/generate-required-document.js +54 -0
  46. package/lib/transform-events/transform-applicant.d.ts +33 -0
  47. package/lib/transform-events/transform-applicant.js +189 -0
  48. package/lib/transform-events/transform-application.d.ts +8 -0
  49. package/lib/transform-events/transform-application.js +54 -0
  50. package/lib/transform-events/transform-expenses.d.ts +37 -0
  51. package/lib/transform-events/transform-expenses.js +121 -0
  52. package/lib/types/enum-mappings/alieo-frequency.d.ts +15 -0
  53. package/lib/types/enum-mappings/alieo-frequency.js +26 -0
  54. package/lib/types/enum-mappings/country-code.d.ts +7 -0
  55. package/lib/types/enum-mappings/country-code.js +247 -0
  56. package/lib/types/enum-mappings/employment-basis.d.ts +7 -0
  57. package/lib/types/enum-mappings/employment-basis.js +13 -0
  58. package/lib/types/enum-mappings/expense-frequency.d.ts +7 -0
  59. package/lib/types/enum-mappings/expense-frequency.js +12 -0
  60. package/lib/types/enum-mappings/funding-position.d.ts +18 -0
  61. package/lib/types/enum-mappings/funding-position.js +34 -0
  62. package/lib/types/enum-mappings/government-benefits.d.ts +7 -0
  63. package/lib/types/enum-mappings/government-benefits.js +11 -0
  64. package/lib/types/enum-mappings/housing-status.d.ts +7 -0
  65. package/lib/types/enum-mappings/housing-status.js +16 -0
  66. package/lib/types/enum-mappings/income-type.d.ts +7 -0
  67. package/lib/types/enum-mappings/income-type.js +17 -0
  68. package/lib/types/enum-mappings/liability-payment-type.d.ts +7 -0
  69. package/lib/types/enum-mappings/liability-payment-type.js +10 -0
  70. package/lib/types/enum-mappings/liability-type.d.ts +7 -0
  71. package/lib/types/enum-mappings/liability-type.js +22 -0
  72. package/lib/types/enum-mappings/living-expense.d.ts +7 -0
  73. package/lib/types/enum-mappings/living-expense.js +31 -0
  74. package/lib/types/enum-mappings/marital-status.d.ts +7 -0
  75. package/lib/types/enum-mappings/marital-status.js +13 -0
  76. package/lib/types/enum-mappings/postcode.d.ts +6 -0
  77. package/lib/types/enum-mappings/postcode.js +16 -0
  78. package/lib/types/enum-mappings/preferred-repayment.d.ts +7 -0
  79. package/lib/types/enum-mappings/preferred-repayment.js +11 -0
  80. package/lib/types/enum-mappings/proof-of-identity.d.ts +7 -0
  81. package/lib/types/enum-mappings/proof-of-identity.js +11 -0
  82. package/lib/types/enum-mappings/public-financial-asset.d.ts +7 -0
  83. package/lib/types/enum-mappings/public-financial-asset.js +13 -0
  84. package/lib/types/enum-mappings/public-primary-purpose.d.ts +7 -0
  85. package/lib/types/enum-mappings/public-primary-purpose.js +10 -0
  86. package/lib/types/enum-mappings/public-property-status.d.ts +7 -0
  87. package/lib/types/enum-mappings/public-property-status.js +12 -0
  88. package/lib/types/enum-mappings/public-property-type.d.ts +7 -0
  89. package/lib/types/enum-mappings/public-property-type.js +24 -0
  90. package/lib/types/enum-mappings/residency-status.d.ts +7 -0
  91. package/lib/types/enum-mappings/residency-status.js +12 -0
  92. package/lib/types/enum-mappings/title-gender.d.ts +7 -0
  93. package/lib/types/enum-mappings/title-gender.js +14 -0
  94. package/lib/types/enum-mappings/title.d.ts +7 -0
  95. package/lib/types/enum-mappings/title.js +14 -0
  96. package/lib/types/enum-mappings/transaction-type.d.ts +7 -0
  97. package/lib/types/enum-mappings/transaction-type.js +10 -0
  98. package/lib/types/events/applicant-delete.d.ts +42 -0
  99. package/lib/types/events/applicant-delete.js +15 -0
  100. package/lib/types/events/asset-delete.d.ts +33 -0
  101. package/lib/types/events/asset-delete.js +15 -0
  102. package/lib/types/events/asset-liability-relation-delete.d.ts +52 -0
  103. package/lib/types/events/asset-liability-relation-delete.js +15 -0
  104. package/lib/types/events/credit-report-retrieved.d.ts +36 -0
  105. package/lib/types/events/credit-report-retrieved.js +15 -0
  106. package/lib/types/events/employment-delete.d.ts +19 -0
  107. package/lib/types/events/employment-delete.js +7 -0
  108. package/lib/types/events/expense-delete.d.ts +21 -0
  109. package/lib/types/events/expense-delete.js +7 -0
  110. package/lib/types/events/funding-position.d.ts +116 -0
  111. package/lib/types/events/funding-position.js +34 -0
  112. package/lib/types/events/income-delete.d.ts +33 -0
  113. package/lib/types/events/income-delete.js +15 -0
  114. package/lib/types/events/liability-delete.d.ts +17 -0
  115. package/lib/types/events/liability-delete.js +7 -0
  116. package/lib/types/events/opportunity.d.ts +102 -0
  117. package/lib/types/events/opportunity.js +47 -0
  118. package/lib/types/events/public-applicant.d.ts +485 -0
  119. package/lib/types/events/public-applicant.js +343 -0
  120. package/lib/types/events/public-application.d.ts +145 -0
  121. package/lib/types/events/public-application.js +100 -0
  122. package/lib/types/events/public-asset-liability-relation.d.ts +52 -0
  123. package/lib/types/events/public-asset-liability-relation.js +15 -0
  124. package/lib/types/events/public-asset.d.ts +469 -0
  125. package/lib/types/events/public-asset.js +319 -0
  126. package/lib/types/events/public-employment.d.ts +190 -0
  127. package/lib/types/events/public-employment.js +69 -0
  128. package/lib/types/events/public-expense.d.ts +83 -0
  129. package/lib/types/events/public-expense.js +50 -0
  130. package/lib/types/events/public-funding-position.d.ts +226 -0
  131. package/lib/types/events/public-funding-position.js +7 -0
  132. package/lib/types/events/public-income.d.ts +144 -0
  133. package/lib/types/events/public-income.js +65 -0
  134. package/lib/types/events/public-liability.d.ts +133 -0
  135. package/lib/types/events/public-liability.js +68 -0
  136. package/lib/types/events/public-required-document.d.ts +99 -0
  137. package/lib/types/events/public-required-document.js +44 -0
  138. package/lib/types/partial-application.d.ts +3 -0
  139. package/lib/types/partial-application.js +2 -0
  140. package/lib/types/recursive-partial.d.ts +3 -0
  141. package/lib/types/recursive-partial.js +2 -0
  142. package/lib/utils/address-tools.d.ts +69 -0
  143. package/lib/utils/address-tools.js +146 -0
  144. package/lib/utils/clean-up.d.ts +7 -0
  145. package/lib/utils/clean-up.js +24 -0
  146. package/lib/utils/generate-address.d.ts +19 -0
  147. package/lib/utils/generate-address.js +102 -0
  148. package/lib/utils/get-financial-institution.d.ts +7 -0
  149. package/lib/utils/get-financial-institution.js +16 -0
  150. package/lib/utils/is-income-type.d.ts +83 -0
  151. package/lib/utils/is-income-type.js +166 -0
  152. package/lib/utils/normalise-date.d.ts +8 -0
  153. package/lib/utils/normalise-date.js +17 -0
  154. package/lib/utils/round-decimal.d.ts +6 -0
  155. package/lib/utils/round-decimal.js +12 -0
  156. package/package.json +10 -7
@@ -0,0 +1,224 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema#",
3
+ "_comment.definitions": "****** Definitions of objects used in applications *****",
4
+ "definitions": {
5
+ "id": {
6
+ "description": "uuid of application",
7
+ "type": "string"
8
+ },
9
+ "brokerPrimaryPurpose": {
10
+ "description": "Additional data point for broker to capture primary purpose, other than the preliminary primary purpose associated with current user journey for new purchase or refinance",
11
+ "enum": [
12
+ "COMMERCIAL",
13
+ "CONSTRUCTION",
14
+ "CONSTRUCTION_AND_PURCHASE",
15
+ "CONSTRUCTION_AND_REFINANCE",
16
+ "INTERNAL_REFINANCE",
17
+ "NEW_PURCHASE",
18
+ "PRE_APPROVAL",
19
+ "PURCHASE",
20
+ "PURCHASE_AND_REFINANCE",
21
+ "REFINANCE",
22
+ "SLR",
23
+ "TOP_UP",
24
+ "VARIATION"
25
+ ]
26
+ },
27
+ "customerId": {
28
+ "description": "Id of the customer",
29
+ "type": "string"
30
+ },
31
+ "name": {
32
+ "description": "Nickname of application a customer can assign.",
33
+ "type": "string"
34
+ },
35
+ "clonedFromApplicationId": {
36
+ "description": "Cloned Application UUID.",
37
+ "type": "string",
38
+ "maxLength": 255
39
+ },
40
+ "hidden": {
41
+ "description": "Identifies whether the application is hidden to customer or not.",
42
+ "type": "boolean"
43
+ },
44
+ "applicationMeta": {
45
+ "type": "object",
46
+ "additionalProperties": false,
47
+ "description": "The metadata of the application",
48
+ "properties": {
49
+ "actionedBy": {
50
+ "description": "uuid of user who made the action (create/update/delete)",
51
+ "type": "string"
52
+ },
53
+ "actionedByRole": {
54
+ "description": "role of the user that made the action",
55
+ "enum": ["team", "customer"]
56
+ },
57
+ "actionedOn": {
58
+ "description": "date of action (create/update/delete)",
59
+ "type": "string"
60
+ }
61
+ }
62
+ },
63
+ "eligibleForFHOG": {
64
+ "description": "First Home Owner Grant",
65
+ "enum": ["YES", "NO", "NOT_SURE"]
66
+ },
67
+ "paymentType": {
68
+ "enum": ["INTEREST_ONLY", "PRINCIPAL_AND_INTEREST", "STILL_DECIDING"]
69
+ },
70
+ "desiredFeatures": {
71
+ "type": "array",
72
+ "items": {
73
+ "enum": ["MOBILE_APP", "MAJOR_LENDER", "FIXED_RATE", "OFFSET_OR_REDRAW"]
74
+ }
75
+ },
76
+ "purchaseReason": {
77
+ "enum": ["LOAN_APPROVAL", "LOAN_ELIGIBILITY", "LOAN_AFFORDABILITY"]
78
+ },
79
+ "purchaseSituation": {
80
+ "enum": ["CONTRACTS_EXCHANGED", "OFFER_MADE", "BUYING_SOON", "EXPLORING_OPTIONS"]
81
+ },
82
+ "hasSelfEmploymentProof": {
83
+ "type": "boolean"
84
+ },
85
+ "totalMonthlyExpenses": {
86
+ "type": "number"
87
+ },
88
+ "numberOfDependants": {
89
+ "type": "number"
90
+ },
91
+ "contributions": {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "object",
95
+ "properties": {
96
+ "type": {
97
+ "type": "string",
98
+ "enum": ["DEPOSIT"]
99
+ },
100
+ "amount": {
101
+ "type": "number"
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "refinancingReasons": {
107
+ "type": "array",
108
+ "items": {
109
+ "enum": ["CONSOLIDATE_CASHOUT", "FASTER_PAYOFF", "DECREASE_REPAYMENTS", "CONSTRUCTION"]
110
+ }
111
+ },
112
+ "payload": {
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "properties": {
116
+ "id": {
117
+ "$ref": "#/definitions/id"
118
+ },
119
+ "meta": {
120
+ "$ref": "#/definitions/applicationMeta"
121
+ },
122
+ "brokerPrimaryPurpose": {
123
+ "$ref": "#/definitions/brokerPrimaryPurpose"
124
+ },
125
+ "customerId": {
126
+ "$ref": "#/definitions/customerId"
127
+ },
128
+ "name": {
129
+ "$ref": "#/definitions/name"
130
+ },
131
+ "clonedFromApplicationId": {
132
+ "$ref": "#/definitions/clonedFromApplicationId"
133
+ },
134
+ "hidden": {
135
+ "$ref": "#/definitions/hidden"
136
+ },
137
+ "brand": {
138
+ "enum": ["lendi", "domain", "domain variation", "lendi variation"]
139
+ },
140
+ "preliminary": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "properties": {
144
+ "purchaseReason": {
145
+ "$ref": "#/definitions/purchaseReason"
146
+ },
147
+ "purchaseSituation": {
148
+ "$ref": "#/definitions/purchaseSituation"
149
+ },
150
+ "isSellingExistingProperty": {
151
+ "type": "boolean"
152
+ },
153
+ "hasConstructionWithin6Months": {
154
+ "type": "boolean"
155
+ },
156
+ "primaryPurpose": {
157
+ "type": "string",
158
+ "enum": ["NEW_PURCHASE", "REFINANCE"]
159
+ },
160
+ "refinancingReasons": {
161
+ "$ref": "#/definitions/refinancingReasons"
162
+ },
163
+ "consolidateAmount": {
164
+ "type": "number"
165
+ },
166
+ "cashoutAmount": {
167
+ "type": "number"
168
+ },
169
+ "urgency": {
170
+ "enum": ["NOT_URGENT", "URGENT"]
171
+ },
172
+ "eligibleForFHOG": {
173
+ "$ref": "#/definitions/eligibleForFHOG"
174
+ },
175
+ "paymentType": {
176
+ "$ref": "#/definitions/paymentType"
177
+ },
178
+ "desiredFeatures": {
179
+ "$ref": "#/definitions/desiredFeatures"
180
+ },
181
+ "hasSelfEmploymentProof": {
182
+ "$ref": "#/definitions/hasSelfEmploymentProof"
183
+ },
184
+ "totalMonthlyExpenses": {
185
+ "$ref": "#/definitions/totalMonthlyExpenses"
186
+ },
187
+ "numberOfDependants": {
188
+ "$ref": "#/definitions/numberOfDependants"
189
+ },
190
+ "contributions": {
191
+ "$ref": "#/definitions/contributions"
192
+ }
193
+ }
194
+ }
195
+ },
196
+ "required": ["id", "preliminary"]
197
+ }
198
+ },
199
+ "_comment": "****** Our main object that uses all the refs above *******",
200
+ "type": "object",
201
+ "title": "application",
202
+ "description": "main object",
203
+ "oneOf": [
204
+ {
205
+ "_comment": "Creating or updating an application depends on the client sending the latest state",
206
+ "type": "object",
207
+ "additionalProperties": false,
208
+ "properties": {
209
+ "version": {
210
+ "type": "string",
211
+ "description": "schema version"
212
+ },
213
+ "type": {
214
+ "type": "string",
215
+ "enum": ["CreateApplication", "UpdateApplication", "MigrateApplication"]
216
+ },
217
+ "payload": {
218
+ "$ref": "#/definitions/payload"
219
+ }
220
+ },
221
+ "required": ["version", "type", "payload"]
222
+ }
223
+ ]
224
+ }