@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,609 @@
1
+ {
2
+ "definitions": {
3
+ "Payload": {
4
+ "type": "object",
5
+ "oneOf": [
6
+ {
7
+ "$ref": "#/definitions/createApplicantDefinition"
8
+ }
9
+ ]
10
+ },
11
+ "id": {
12
+ "type": "string",
13
+ "format": "uuid"
14
+ },
15
+ "applicantKeyObject": {
16
+ "type": "object",
17
+ "properties": {
18
+ "applicantId": {
19
+ "$ref": "#/definitions/id"
20
+ }
21
+ }
22
+ },
23
+ "applicantMeta": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "description": "The metadata of the applicant",
27
+ "properties": {
28
+ "actionedBy": {
29
+ "description": "uuid of user who made the action (create/update/delete)",
30
+ "type": "string"
31
+ },
32
+ "actionedByRole": {
33
+ "description": "role of the user that made the action",
34
+ "enum": ["team", "customer"]
35
+ }
36
+ },
37
+ "required": ["actionedBy", "actionedByRole"]
38
+ },
39
+ "dependant": {
40
+ "type": "object",
41
+ "properties": {
42
+ "id": {
43
+ "type": "string",
44
+ "format": "uuid",
45
+ "description": "Id for entity."
46
+ },
47
+ "age": {
48
+ "type": "number",
49
+ "minimum": 0
50
+ },
51
+ "isAddedOnThisApplicant": {
52
+ "type": "boolean",
53
+ "description": "Whether dependant was added for this applicant."
54
+ },
55
+ "sharedWith": {
56
+ "$ref": "#/definitions/applicantKeyObject"
57
+ }
58
+ }
59
+ },
60
+ "applicantType": {
61
+ "enum": ["BORROWER", "BORROWER_AND_GUARANTOR", "GUARANTOR"]
62
+ },
63
+ "creditStatus": {
64
+ "enum": ["FAIR", "UNKNOWN", "AVERAGE", "EXCELLENT"],
65
+ "description": "current credit status of the applicant (Customer declared value)"
66
+ },
67
+ "employmentType": {
68
+ "enum": ["EMPLOYEE", "SELF_EMPLOYED", "UNKNOWN"],
69
+ "description": "applicant's employment type"
70
+ },
71
+ "isPrimaryApplicant": {
72
+ "type": "boolean"
73
+ },
74
+ "hasSelfEmploymentProof": {
75
+ "type": "boolean"
76
+ },
77
+ "totalIncomeEstimate": {
78
+ "type": "number",
79
+ "minimum": 0,
80
+ "description": "The applicants estimated total income per financial year. Whole Australian dollars"
81
+ },
82
+ "dateOfBirth": {
83
+ "type": "string",
84
+ "description": "applicant's DOB, in ISO-8601 date format"
85
+ },
86
+ "gender": {
87
+ "enum": ["FEMALE", "MALE", "UNDISCLOSED", "UNKNOWN"]
88
+ },
89
+ "maritalStatus": {
90
+ "enum": ["DE_FACTO", "DIVORCED", "MARRIED", "SINGLE", "UNKNOWN"]
91
+ },
92
+ "residencyStatus": {
93
+ "enum": ["AUSTRALIAN_CITIZEN", "PERMANENT_RESIDENT", "TEMPORARY_RESIDENT", "UNKNOWN"]
94
+ },
95
+ "dependants": {
96
+ "type": "array",
97
+ "items": {
98
+ "$ref": "#/definitions/dependant"
99
+ }
100
+ },
101
+ "firstName": {
102
+ "type": "string",
103
+ "description": "customer's first name"
104
+ },
105
+ "middleName": {
106
+ "type": "string",
107
+ "description": "customer's middle name"
108
+ },
109
+ "lastName": {
110
+ "type": "string",
111
+ "description": "customer's last name"
112
+ },
113
+ "title": {
114
+ "enum": ["DR", "MISS", "MR", "MRS", "MS", "UNKNOWN"]
115
+ },
116
+ "countries": {
117
+ "type": "string",
118
+ "example": "Australia",
119
+ "enum": [
120
+ "Afghanistan",
121
+ "Albania",
122
+ "Algeria",
123
+ "American Samoa",
124
+ "Andorra",
125
+ "Angola",
126
+ "Anguilla",
127
+ "Antarctica",
128
+ "Antigua And Barbuda",
129
+ "Argentina",
130
+ "Armenia",
131
+ "Aruba",
132
+ "Australia",
133
+ "Austria",
134
+ "Azerbaijan",
135
+ "Bahamas",
136
+ "Bahrain",
137
+ "Bangladesh",
138
+ "Barbados",
139
+ "Belarus",
140
+ "Belgium",
141
+ "Belize",
142
+ "Benin",
143
+ "Bermuda",
144
+ "Bhutan",
145
+ "Bolivia",
146
+ "Bosnia And Herzegovina",
147
+ "Botswana",
148
+ "Bouvet Island",
149
+ "Brazil",
150
+ "British Indian Ocean Territory",
151
+ "Brunei Darussalam",
152
+ "Bulgaria",
153
+ "Burkina Faso",
154
+ "Burundi",
155
+ "Cambodia",
156
+ "Cameroon",
157
+ "Canada",
158
+ "Cape Verde",
159
+ "Cayman Islands",
160
+ "Central African Republic",
161
+ "Chad",
162
+ "Chile",
163
+ "China",
164
+ "Christmas Island",
165
+ "Cocos (Keeling) Islands",
166
+ "Colombia",
167
+ "Comoros",
168
+ "Democratic People's Republic of Korea",
169
+ "Democratic Republic Of The Congo",
170
+ "Cook Islands",
171
+ "Costa Rica",
172
+ "Cote D'ivoire",
173
+ "Croatia",
174
+ "Cuba",
175
+ "Cyprus",
176
+ "Czech Republic",
177
+ "Denmark",
178
+ "Djibouti",
179
+ "Dominica",
180
+ "Dominican Republic",
181
+ "East Timor",
182
+ "Ecuador",
183
+ "Egypt",
184
+ "El Salvador",
185
+ "Equatorial Guinea",
186
+ "Eritrea",
187
+ "Estonia",
188
+ "Ethiopia",
189
+ "Falkland Islands",
190
+ "Faroe Islands",
191
+ "Fiji",
192
+ "Finland",
193
+ "France",
194
+ "French Guiana",
195
+ "French Polynesia",
196
+ "French Southern Territories",
197
+ "Gabon",
198
+ "Gambia",
199
+ "Georgia",
200
+ "Germany",
201
+ "Ghana",
202
+ "Gibraltar",
203
+ "Greece",
204
+ "Greenland",
205
+ "Grenada",
206
+ "Guadeloupe",
207
+ "Guam",
208
+ "Guatemala",
209
+ "Guinea",
210
+ "Guinea-bissau",
211
+ "Guyana",
212
+ "Haiti",
213
+ "Heard Island And Mcdonald Islands",
214
+ "Holy See (Vatican City State)",
215
+ "Honduras",
216
+ "Hong Kong",
217
+ "Hungary",
218
+ "Iceland",
219
+ "India",
220
+ "Indonesia",
221
+ "Iran",
222
+ "Iraq",
223
+ "Ireland",
224
+ "Israel",
225
+ "Italy",
226
+ "Jamaica",
227
+ "Japan",
228
+ "Jordan",
229
+ "Kazakstan",
230
+ "Kenya",
231
+ "Kiribati",
232
+ "Kosovo",
233
+ "Kuwait",
234
+ "Kyrgyzstan",
235
+ "Laos",
236
+ "Latvia",
237
+ "Lebanon",
238
+ "Lesotho",
239
+ "Liberia",
240
+ "Libyan Arab Jamahiriya",
241
+ "Liechtenstein",
242
+ "Lithuania",
243
+ "Luxembourg",
244
+ "Macau",
245
+ "Macedonia",
246
+ "Madagascar",
247
+ "Malawi",
248
+ "Malaysia",
249
+ "Maldives",
250
+ "Mali",
251
+ "Malta",
252
+ "Marshall Islands",
253
+ "Martinique",
254
+ "Mauritania",
255
+ "Mauritius",
256
+ "Mayotte",
257
+ "Mexico",
258
+ "Federated States Of Micronesia",
259
+ "Republic Of Moldova",
260
+ "Monaco",
261
+ "Mongolia",
262
+ "Montserrat",
263
+ "Montenegro",
264
+ "Morocco",
265
+ "Mozambique",
266
+ "Myanmar",
267
+ "Namibia",
268
+ "Nauru",
269
+ "Nepal",
270
+ "Netherlands",
271
+ "Netherlands Antilles",
272
+ "New Caledonia",
273
+ "New Zealand",
274
+ "Nicaragua",
275
+ "Niger",
276
+ "Nigeria",
277
+ "Niue",
278
+ "Norfolk Island",
279
+ "Northern Mariana Islands",
280
+ "Norway",
281
+ "Oman",
282
+ "Pakistan",
283
+ "Palau",
284
+ "Palestinian Territory",
285
+ "Panama",
286
+ "Papua New Guinea",
287
+ "Paraguay",
288
+ "Peru",
289
+ "Philippines",
290
+ "Pitcairn",
291
+ "Poland",
292
+ "Portugal",
293
+ "Puerto Rico",
294
+ "Qatar",
295
+ "Romania",
296
+ "Russian Federation",
297
+ "Rwanda",
298
+ "Saint Helena",
299
+ "Saint Kitts And Nevis",
300
+ "Saint Lucia",
301
+ "Saint Pierre And Miquelon",
302
+ "Saint Vincent And The Grenadines",
303
+ "Samoa",
304
+ "San Marino",
305
+ "Sao Tome And Principe",
306
+ "Saudi Arabia",
307
+ "Senegal",
308
+ "Serbia",
309
+ "Seychelles",
310
+ "Sierra Leone",
311
+ "Singapore",
312
+ "Slovakia",
313
+ "Slovenia",
314
+ "Solomon Islands",
315
+ "Somalia",
316
+ "South Africa",
317
+ "South Georgia And The South Sandwich Islands",
318
+ "The Republic of South Korea",
319
+ "Spain",
320
+ "Sri Lanka",
321
+ "Sudan",
322
+ "Suriname",
323
+ "Svalbard And Jan Mayen",
324
+ "Swaziland",
325
+ "Sweden",
326
+ "Switzerland",
327
+ "Syrian Arab Republic",
328
+ "Taiwan",
329
+ "Tajikistan",
330
+ "Tanzania",
331
+ "Thailand",
332
+ "Togo",
333
+ "Tokelau",
334
+ "Tonga",
335
+ "Trinidad And Tobago",
336
+ "Tunisia",
337
+ "Turkey",
338
+ "Turkmenistan",
339
+ "Turks And Caicos Islands",
340
+ "Tuvalu",
341
+ "Uganda",
342
+ "Ukraine",
343
+ "United Arab Emirates",
344
+ "United Kingdom",
345
+ "United States of America",
346
+ "United States Minor Outlying Islands",
347
+ "Uruguay",
348
+ "Uzbekistan",
349
+ "Vanuatu",
350
+ "Venezuela",
351
+ "Vietnam",
352
+ "British Virgin Islands",
353
+ "US Virgin Islands",
354
+ "Wallis And Futuna",
355
+ "Western Sahara",
356
+ "Yemen",
357
+ "Zambia",
358
+ "Zimbabwe"
359
+ ]
360
+ },
361
+ "housingStatusList": {
362
+ "type": "string",
363
+ "enum": [
364
+ "Renting",
365
+ "Boarding",
366
+ "Caravan",
367
+ "Other",
368
+ "Own Home",
369
+ "Own Home Mortgage",
370
+ "Supplied by Employer",
371
+ "With Parents"
372
+ ]
373
+ },
374
+ "otherState": {
375
+ "type": "string",
376
+ "example": "Ohio"
377
+ },
378
+ "AustralianStates": {
379
+ "example": "NSW",
380
+ "type": "string",
381
+ "enum": ["QLD", "NSW", "VIC", "WA", "SA", "TAS", "ACT", "NT"]
382
+ },
383
+ "date": {
384
+ "type": "string",
385
+ "format": "date",
386
+ "example": "2018-07-17"
387
+ },
388
+ "AddressStandard": {
389
+ "type": "object",
390
+ "additionalProperties": false,
391
+ "properties": {
392
+ "streetName": {
393
+ "type": "string"
394
+ },
395
+ "streetNumber": {
396
+ "type": "string"
397
+ },
398
+ "streetType": {
399
+ "type": "string"
400
+ },
401
+ "level": {
402
+ "type": "string"
403
+ },
404
+ "unit": {
405
+ "type": "string"
406
+ }
407
+ }
408
+ },
409
+ "address": {
410
+ "type": "object",
411
+ "additionalProperties": false,
412
+ "properties": {
413
+ "postcode": {
414
+ "type": "string"
415
+ },
416
+ "state": {
417
+ "example": "NSW",
418
+ "type": "string",
419
+ "anyOf": [
420
+ {
421
+ "$ref": "#/definitions/AustralianStates"
422
+ },
423
+ {
424
+ "$ref": "#/definitions/otherState"
425
+ }
426
+ ]
427
+ },
428
+ "city": {
429
+ "type": "string"
430
+ },
431
+ "country": {
432
+ "$ref": "#/definitions/countries"
433
+ },
434
+ "formatted": {
435
+ "type": "string"
436
+ },
437
+ "standard": {
438
+ "$ref": "#/definitions/AddressStandard"
439
+ }
440
+ }
441
+ },
442
+ "commonAddressProperties": {
443
+ "type": "object",
444
+ "properties": {
445
+ "externalId": {
446
+ "$ref": "#/definitions/id"
447
+ },
448
+ "housingStatus": {
449
+ "$ref": "#/definitions/housingStatusList"
450
+ },
451
+ "startDate": {
452
+ "$ref": "#/definitions/date"
453
+ },
454
+ "residentialAddress": {
455
+ "$ref": "#/definitions/address"
456
+ }
457
+ }
458
+ },
459
+ "currentAddress": {
460
+ "$ref": "#/definitions/commonAddressProperties"
461
+ },
462
+ "previousAddresses": {
463
+ "type": "array",
464
+ "minItems": 0,
465
+ "items": {
466
+ "type": "object",
467
+ "allOf": [
468
+ {
469
+ "$ref": "#/definitions/commonAddressProperties"
470
+ },
471
+ {
472
+ "type": "object",
473
+ "properties": {
474
+ "endDate": {
475
+ "$ref": "#/definitions/date"
476
+ }
477
+ }
478
+ }
479
+ ]
480
+ }
481
+ },
482
+ "contact": {
483
+ "type": "object",
484
+ "additionalProperties": false,
485
+ "properties": {
486
+ "currentAddress": {
487
+ "$ref": "#/definitions/currentAddress"
488
+ },
489
+ "mobileNumber": {
490
+ "type": "string",
491
+ "description": "applicant's mobile number formatted in +611234567890"
492
+ },
493
+ "previousAddresses": {
494
+ "$ref": "#/definitions/previousAddresses"
495
+ },
496
+ "emailAddress": {
497
+ "type": "string",
498
+ "description": "The applicant email"
499
+ }
500
+ }
501
+ },
502
+ "invitationStatus": {
503
+ "enum": ["ACCEPTED", "PENDING", "CANCELLED", "EXPIRED"],
504
+ "description": "different invitation statuses an applicant can have"
505
+ },
506
+ "entity": {
507
+ "enum": ["PERSON", "COMPANY"],
508
+ "description": "applicant's entity. For a person applicant this is 'PERSON'"
509
+ },
510
+ "createApplicantDefinition": {
511
+ "type": "object",
512
+ "additionalProperties": false,
513
+ "properties": {
514
+ "id": {
515
+ "$ref": "#/definitions/id",
516
+ "description": "uuid of applicant"
517
+ },
518
+ "applicationId": {
519
+ "$ref": "#/definitions/id",
520
+ "description": "uuid of application"
521
+ },
522
+ "customerId": {
523
+ "$ref": "#/definitions/id",
524
+ "description": "uuid of customer"
525
+ },
526
+ "meta": {
527
+ "$ref": "#/definitions/applicantMeta"
528
+ },
529
+ "applicantType": {
530
+ "$ref": "#/definitions/applicantType"
531
+ },
532
+ "creditStatus": {
533
+ "$ref": "#/definitions/creditStatus"
534
+ },
535
+ "entity": {
536
+ "$ref": "#/definitions/entity"
537
+ },
538
+ "employmentType": {
539
+ "$ref": "#/definitions/employmentType"
540
+ },
541
+ "isPrimaryApplicant": {
542
+ "$ref": "#/definitions/isPrimaryApplicant"
543
+ },
544
+ "hasSelfEmploymentProof": {
545
+ "$ref": "#/definitions/hasSelfEmploymentProof"
546
+ },
547
+ "totalIncomeEstimate": {
548
+ "$ref": "#/definitions/totalIncomeEstimate"
549
+ },
550
+ "dateOfBirth": {
551
+ "$ref": "#/definitions/dateOfBirth"
552
+ },
553
+ "gender": {
554
+ "$ref": "#/definitions/gender"
555
+ },
556
+ "maritalStatus": {
557
+ "$ref": "#/definitions/maritalStatus"
558
+ },
559
+ "maritalDetails": {
560
+ "$ref": "#/definitions/applicantKeyObject"
561
+ },
562
+ "residencyStatus": {
563
+ "$ref": "#/definitions/residencyStatus"
564
+ },
565
+ "dependants": {
566
+ "$ref": "#/definitions/dependants"
567
+ },
568
+ "firstName": {
569
+ "$ref": "#/definitions/firstName"
570
+ },
571
+ "middleName": {
572
+ "$ref": "#/definitions/middleName"
573
+ },
574
+ "lastName": {
575
+ "$ref": "#/definitions/lastName"
576
+ },
577
+ "title": {
578
+ "$ref": "#/definitions/title"
579
+ },
580
+ "contact": {
581
+ "$ref": "#/definitions/contact"
582
+ },
583
+ "invitationStatus": {
584
+ "$ref": "#/definitions/invitationStatus"
585
+ }
586
+ },
587
+ "required": ["id", "applicationId", "customerId", "isPrimaryApplicant", "meta"],
588
+ "description": "create applicant payload"
589
+ }
590
+ },
591
+ "type": "object",
592
+ "title": "The applicant event schema",
593
+ "description": "Create or update.",
594
+ "additionalProperties": false,
595
+ "properties": {
596
+ "version": {
597
+ "type": "string",
598
+ "description": "schema version"
599
+ },
600
+ "type": {
601
+ "type": "string",
602
+ "enum": ["CreateApplicant"]
603
+ },
604
+ "payload": {
605
+ "$ref": "#/definitions/Payload"
606
+ }
607
+ },
608
+ "required": ["version", "payload", "type"]
609
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "definitions": {
3
+ "Payload": {
4
+ "type": "object",
5
+ "oneOf": [
6
+ {
7
+ "$ref": "#/definitions/DeleteApplicantDefinition"
8
+ }
9
+ ]
10
+ },
11
+ "id": {
12
+ "type": "string"
13
+ },
14
+ "applicantMeta": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "description": "The metadata of the applicant",
18
+ "properties": {
19
+ "actionedBy": {
20
+ "description": "uuid of user who made the action (delete)",
21
+ "type": "string"
22
+ },
23
+ "actionedByRole": {
24
+ "description": "role of the user that made the action",
25
+ "enum": ["team", "customer"]
26
+ }
27
+ },
28
+ "required": ["actionedBy", "actionedByRole"]
29
+ },
30
+ "DeleteApplicantDefinition": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "properties": {
34
+ "id": {
35
+ "type": "string"
36
+ },
37
+ "applicationId": {
38
+ "$ref": "#/definitions/id",
39
+ "description": "uuid of application"
40
+ },
41
+ "meta": {
42
+ "$ref": "#/definitions/applicantMeta"
43
+ }
44
+ },
45
+ "required": ["id", "applicationId"]
46
+ }
47
+ },
48
+ "type": "object",
49
+ "title": "The applicant delete event schema",
50
+ "description": "Delete.",
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "version": {
54
+ "type": "string",
55
+ "description": "schema version"
56
+ },
57
+ "type": {
58
+ "type": "string",
59
+ "enum": ["DeleteApplicant"]
60
+ },
61
+ "payload": {
62
+ "$ref": "#/definitions/Payload"
63
+ }
64
+ },
65
+ "required": ["version", "payload", "type"]
66
+ }