@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,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
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "type": "object",
3
+ "definitions": {
4
+ "applicationId": {
5
+ "type": "string",
6
+ "format": "uuid"
7
+ },
8
+ "meta": {
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "description": "The metadata of the alieo",
12
+ "properties": {
13
+ "actionedBy": {
14
+ "description": "uuid of user who made the action (create/update/delete)",
15
+ "type": "string"
16
+ },
17
+ "actionedByRole": {
18
+ "description": "role of the user that made the action",
19
+ "enum": ["team", "customer"]
20
+ }
21
+ },
22
+ "required": ["actionedBy", "actionedByRole"]
23
+ },
24
+ "deletePayloadDefinition": {
25
+ "type": "object",
26
+ "properties": {
27
+ "id": {
28
+ "type": "string"
29
+ },
30
+ "applicationId": {
31
+ "$ref": "#/definitions/applicationId"
32
+ },
33
+ "meta": {
34
+ "$ref": "#/definitions/meta"
35
+ }
36
+ },
37
+ "required": ["id", "applicationId"]
38
+ }
39
+ },
40
+ "properties": {
41
+ "version": {
42
+ "type": "string"
43
+ },
44
+ "type": {
45
+ "type": "string",
46
+ "enum": ["AssetDeleted"]
47
+ },
48
+ "payload": {
49
+ "$ref": "#/definitions/deletePayloadDefinition"
50
+ }
51
+ },
52
+ "required": ["type", "version", "payload"]
53
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "definitions": {
3
+ "applicationId": {
4
+ "type": "string"
5
+ },
6
+ "deleteEntityDefinition": {
7
+ "type": "object",
8
+ "properties": {
9
+ "id": {
10
+ "type": "string"
11
+ },
12
+ "applicationId": {
13
+ "$ref": "#/definitions/applicationId"
14
+ },
15
+ "meta": {
16
+ "$ref": "#/definitions/meta"
17
+ }
18
+ },
19
+ "required": ["id", "applicationId"]
20
+ },
21
+ "deleteIncomeDefinition": {
22
+ "$ref": "#/definitions/deleteEntityDefinition"
23
+ },
24
+ "meta": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "description": "The metadata of the alieo",
28
+ "properties": {
29
+ "actionedBy": {
30
+ "description": "uuid of user who made the action (create/update/delete)",
31
+ "type": "string"
32
+ },
33
+ "actionedByRole": {
34
+ "description": "role of the user that made the action",
35
+ "enum": ["team", "customer"]
36
+ }
37
+ },
38
+ "required": ["actionedBy", "actionedByRole"]
39
+ }
40
+ },
41
+ "type": "object",
42
+ "required": ["type", "version", "payload"],
43
+ "properties": {
44
+ "type": {
45
+ "type": "string",
46
+ "enum": ["IncomeDeleted"]
47
+ },
48
+ "version": {
49
+ "type": "string"
50
+ },
51
+ "payload": {
52
+ "$ref": "#/definitions/deleteIncomeDefinition"
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "version": {
5
+ "type": "string"
6
+ },
7
+ "type": {
8
+ "type": "string",
9
+ "enum": ["EmploymentDeleted"]
10
+ },
11
+ "payload": {
12
+ "type": "object",
13
+ "properties": {
14
+ "id": {
15
+ "type": "string",
16
+ "format": "uuid"
17
+ },
18
+ "applicantId": {
19
+ "type": "string",
20
+ "description": "uuid of applicant"
21
+ },
22
+ "applicationId": {
23
+ "type": "string",
24
+ "description": "uuid of application"
25
+ }
26
+ },
27
+ "required": ["id", "applicationId"]
28
+ }
29
+ },
30
+ "required": ["version", "type", "payload"]
31
+ }
@@ -0,0 +1,302 @@
1
+ {
2
+ "definitions": {
3
+ "payload": {
4
+ "type": "object",
5
+ "$ref": "#/definitions/CreateEmploymentDefinition"
6
+ },
7
+ "PrivateOrPublic": {
8
+ "type": "string",
9
+ "enum": ["PRIVATE", "PUBLIC"]
10
+ },
11
+ "id": {
12
+ "type": "string",
13
+ "format": "uuid"
14
+ },
15
+ "meta": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "description": "The metadata of the alieo",
19
+ "properties": {
20
+ "actionedBy": {
21
+ "description": "uuid of user who made the action (create/update/delete)",
22
+ "type": "string"
23
+ },
24
+ "actionedByRole": {
25
+ "description": "role of the user that made the action",
26
+ "enum": ["team", "customer"]
27
+ }
28
+ },
29
+ "required": ["actionedBy", "actionedByRole"]
30
+ },
31
+ "applicationId": {
32
+ "type": "string"
33
+ },
34
+ "employmentBasis": {
35
+ "type": "string",
36
+ "enum": ["FULL_TIME", "PART_TIME", "CASUAL", "CONTRACTOR", "MATERNITY_LEAVE"]
37
+ },
38
+ "businessName": {
39
+ "type": "string",
40
+ "description": "Name of business",
41
+ "example": "Lendi"
42
+ },
43
+ "abn": {
44
+ "type": "number",
45
+ "description": "ABN of business",
46
+ "exampled": 18611161856
47
+ },
48
+ "abnVerified": {
49
+ "type": "boolean",
50
+ "example": true
51
+ },
52
+ "companyType": {
53
+ "type": "string",
54
+ "enum": ["PRIVATE", "PUBLIC"]
55
+ },
56
+ "australianStates": {
57
+ "type": "string",
58
+ "enum": ["QLD", "NSW", "VIC", "WA", "SA", "TAS", "ACT", "NT"]
59
+ },
60
+ "employerAddress": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "properties": {
64
+ "postcode": {
65
+ "type": "string"
66
+ },
67
+ "state": {
68
+ "$ref": "#/definitions/australianStates"
69
+ },
70
+ "city": {
71
+ "type": "string",
72
+ "example": "Miranda"
73
+ },
74
+ "country": {
75
+ "type": "string",
76
+ "example": "Australia"
77
+ },
78
+ "formatted": {
79
+ "type": "string",
80
+ "example": "8 Clarence st, Miranda, NSW, Australia"
81
+ },
82
+ "standard": {
83
+ "$ref": "#/definitions/addressStandard"
84
+ }
85
+ }
86
+ },
87
+ "businessStructure": {
88
+ "type": "string",
89
+ "enum": ["SOLE_TRADER", "PARTNERSHIP", "COMPANY", "TRUST"]
90
+ },
91
+ "onProbation": {
92
+ "type": "boolean",
93
+ "example": false
94
+ },
95
+ "startDate": {
96
+ "type": "string",
97
+ "format": "date",
98
+ "example": "2018-07-17"
99
+ },
100
+ "endDate": {
101
+ "type": ["string", "null"],
102
+ "format": "date",
103
+ "example": "2018-07-17"
104
+ },
105
+ "maternityLeaveReturnDate": {
106
+ "type": "string",
107
+ "format": "date",
108
+ "description": "Date returning from maternity leave",
109
+ "example": "2020-07-17"
110
+ },
111
+ "role": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "description": "ANZSCO role. Complete list can be found as anzsco property here https://bitbucket.org/lendi-dev/lists/src/master/src/services/occupations/occupations.ts. Official reference: http://anzsco.ozhome.info/anzsco-complete-occupation-list.",
115
+ "properties": {
116
+ "anzsco": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "properties": {
120
+ "code": {
121
+ "type": "number",
122
+ "example": 111312
123
+ },
124
+ "category": {
125
+ "type": "string",
126
+ "example": "MANAGERS"
127
+ },
128
+ "occupation": {
129
+ "type": "string",
130
+ "example": "Member of Parliament"
131
+ }
132
+ }
133
+ },
134
+ "asco": {
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "description": "ASCO role. Complete list can be found as asco property here https://bitbucket.org/lendi-dev/lists/src/master/src/services/occupations/occupations.ts. Official reference: http://anzsco.ozhome.info/anzsco-complete-occupation-list.",
138
+ "properties": {
139
+ "code": {
140
+ "type": "string",
141
+ "example": "1111-11"
142
+ },
143
+ "category": {
144
+ "type": "string",
145
+ "example": "MANAGERS AND ADMINISTRATORS"
146
+ },
147
+ "occupation": {
148
+ "type": "string",
149
+ "example": "Parliamentarian or Councillor"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ },
155
+ "foreignEmployed": {
156
+ "type": "boolean",
157
+ "example": false
158
+ },
159
+ "maternityLeaveReturnBasis": {
160
+ "type": "string",
161
+ "description": "Employment basis after returning from maternity leave.",
162
+ "enum": ["FULL_TIME", "PART_TIME", "CASUAL", "CONTRACTOR"]
163
+ },
164
+ "type": {
165
+ "type": "string",
166
+ "enum": ["PRIMARY", "SECONDARY", "PREVIOUS"]
167
+ },
168
+ "employmentType": {
169
+ "type": "string",
170
+ "enum": ["EMPLOYEE", "SELF_EMPLOYED", "NOT_WORKING"]
171
+ },
172
+ "addressStandard": {
173
+ "type": "object",
174
+ "description": "The address standard",
175
+ "properties": {
176
+ "buildingName": {
177
+ "description": "The building name",
178
+ "type": "string"
179
+ },
180
+ "level": {
181
+ "description": "The level of the unit/apartment",
182
+ "type": "string"
183
+ },
184
+ "lotSection": {
185
+ "description": "The lot number",
186
+ "type": "string"
187
+ },
188
+ "streetName": {
189
+ "description": "The street name",
190
+ "type": "string"
191
+ },
192
+ "streetNumber": {
193
+ "description": "The street number",
194
+ "type": "string"
195
+ },
196
+ "streetType": {
197
+ "description": "The type of the street i.e. road",
198
+ "type": "string"
199
+ },
200
+ "unit": {
201
+ "description": "The unit number",
202
+ "type": "string"
203
+ }
204
+ }
205
+ },
206
+ "CreateEmploymentDefinition": {
207
+ "type": "object",
208
+ "additionalProperties": false,
209
+ "properties": {
210
+ "id": {
211
+ "$ref": "#/definitions/id",
212
+ "description": "uuid of employment"
213
+ },
214
+ "applicantId": {
215
+ "$ref": "#/definitions/id",
216
+ "description": "uuid of applicant"
217
+ },
218
+ "clientId": {
219
+ "$ref": "#/definitions/id",
220
+ "description": "uuid of client"
221
+ },
222
+ "applicationId": {
223
+ "$ref": "#/definitions/id",
224
+ "description": "uuid of application"
225
+ },
226
+ "meta": {
227
+ "$ref": "#/definitions/meta"
228
+ },
229
+ "type": {
230
+ "$ref": "#/definitions/type"
231
+ },
232
+ "employmentType": {
233
+ "$ref": "#/definitions/employmentType"
234
+ },
235
+ "employmentBasis": {
236
+ "$ref": "#/definitions/employmentBasis"
237
+ },
238
+ "businessName": {
239
+ "$ref": "#/definitions/businessName"
240
+ },
241
+ "abn": {
242
+ "$ref": "#/definitions/abn"
243
+ },
244
+ "abnVerified": {
245
+ "$ref": "#/definitions/abnVerified"
246
+ },
247
+ "companyType": {
248
+ "$ref": "#/definitions/companyType"
249
+ },
250
+ "employerAddress": {
251
+ "$ref": "#/definitions/employerAddress"
252
+ },
253
+ "businessStructure": {
254
+ "$ref": "#/definitions/businessStructure"
255
+ },
256
+ "onProbation": {
257
+ "$ref": "#/definitions/onProbation"
258
+ },
259
+ "foreignEmployed": {
260
+ "$ref": "#/definitions/foreignEmployed"
261
+ },
262
+ "startDate": {
263
+ "$ref": "#/definitions/startDate"
264
+ },
265
+ "endDate": {
266
+ "$ref": "#/definitions/endDate"
267
+ },
268
+ "role": {
269
+ "$ref": "#/definitions/role"
270
+ },
271
+ "maternityLeaveReturnDate": {
272
+ "$ref": "#/definitions/maternityLeaveReturnDate"
273
+ },
274
+ "maternityLeaveReturnBasis": {
275
+ "$ref": "#/definitions/maternityLeaveReturnBasis"
276
+ },
277
+ "privateOrPublic": {
278
+ "$ref": "#/definitions/PrivateOrPublic"
279
+ }
280
+ },
281
+ "required": ["id", "applicantId", "applicationId", "type"],
282
+ "description": "create employment payload"
283
+ }
284
+ },
285
+ "type": "object",
286
+ "title": "The employment event schema",
287
+ "description": "Create or update",
288
+ "properties": {
289
+ "version": {
290
+ "type": "string",
291
+ "description": "schema version"
292
+ },
293
+ "payload": {
294
+ "$ref": "#/definitions/payload"
295
+ },
296
+ "type": {
297
+ "type": "string",
298
+ "enum": ["EmploymentCreated", "EmploymentUpdated"]
299
+ }
300
+ },
301
+ "required": ["version", "payload", "type"]
302
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "version": {
5
+ "type": "string"
6
+ },
7
+ "type": {
8
+ "type": "string",
9
+ "enum": ["ExpenseDeleted"]
10
+ },
11
+ "payload": {
12
+ "type": "object",
13
+ "properties": {
14
+ "id": {
15
+ "type": "string"
16
+ },
17
+ "applicationId": {
18
+ "type": "string"
19
+ },
20
+ "applicantId": {
21
+ "type": "string",
22
+ "description": "uuid of applicant"
23
+ },
24
+ "meta": {
25
+ "type": "object",
26
+ "properties": {
27
+ "actionedBy": {
28
+ "type": "string"
29
+ },
30
+ "actionedByRole": {
31
+ "type": "string"
32
+ }
33
+ },
34
+ "required": ["actionedBy", "actionedByRole"]
35
+ }
36
+ },
37
+ "required": ["id", "applicationId", "applicantId"]
38
+ }
39
+ },
40
+ "required": ["version", "type", "payload"]
41
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "definitions": {
3
+ "payload": {
4
+ "type": "object",
5
+ "$ref": "#/definitions/ExpenseDefinition"
6
+ },
7
+ "id": {
8
+ "type": "string",
9
+ "format": "uuid"
10
+ },
11
+ "meta": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "description": "The metadata of the alieo",
15
+ "properties": {
16
+ "actionedBy": {
17
+ "description": "uuid of user who made the action (create/update/delete)",
18
+ "type": "string"
19
+ },
20
+ "actionedByRole": {
21
+ "description": "role of the user that made the action",
22
+ "enum": ["team", "customer"]
23
+ }
24
+ }
25
+ },
26
+ "applicationId": {
27
+ "$ref": "#/definitions/id",
28
+ "description": "uuid of application"
29
+ },
30
+ "Amount": {
31
+ "type": "number",
32
+ "example": 100000
33
+ },
34
+ "Frequency": {
35
+ "type": "string",
36
+ "enum": ["FORTNIGHTLY", "MONTHLY", "QUARTERLY", "WEEKLY", "YEARLY"]
37
+ },
38
+ "Comments": {
39
+ "type": "string"
40
+ },
41
+ "ExpenseDefinition": {
42
+ "type": "object",
43
+ "properties": {
44
+ "id": {
45
+ "$ref": "#/definitions/Uuid",
46
+ "description": "uuid of Expense"
47
+ },
48
+ "meta": {
49
+ "$ref": "#/definitions/meta"
50
+ },
51
+ "applicationId": {
52
+ "$ref": "#/definitions/applicationId"
53
+ },
54
+ "applicantId": {
55
+ "$ref": "#/definitions/Uuid"
56
+ },
57
+ "expenses": {
58
+ "$ref": "#/definitions/Expense"
59
+ }
60
+ },
61
+ "required": ["id", "applicationId", "applicantId", "expenses"]
62
+ },
63
+ "Expense": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "object",
67
+ "properties": {
68
+ "type": {
69
+ "type": "string",
70
+ "enum": [
71
+ "LIVING_EXPENSES_ESTIMATE",
72
+ "GROCERIES",
73
+ "CHILDCARE",
74
+ "CHILD_AND_SPOUSAL_MAINTENANCE",
75
+ "PRIMARY_SECONDARY_EDUCATION",
76
+ "HIGHER_VOCATIONAL_TRAINING_EDUCATION",
77
+ "PRIVATE_SCHOOLING_AND_TUITION",
78
+ "CLOTHING_AND_PERSONAL_CARE",
79
+ "RECREATION_AND_ENTERTAINMENT",
80
+ "TELEPHONE_INTERNET_PAY_TV_AND_MEDIA_STREAMING_SUBSCRIPTIONS",
81
+ "PET_CARE",
82
+ "TRANSPORT",
83
+ "BODY_CORPORATE_FEES_STRATA_FEES_AND_LAND_TAX",
84
+ "PRIMARY_RESIDENCE_RUNNING_COSTS",
85
+ "INVESTMENT_PROPERTY_RUNNING_COSTS",
86
+ "SECONDARY_RESIDENCE_RUNNING_COSTS",
87
+ "INSURANCE",
88
+ "LIFE_INSURANCE",
89
+ "HEALTH_INSURANCE",
90
+ "MEDICAL_AND_HEALTH",
91
+ "RENT",
92
+ "BOARD",
93
+ "OTHER"
94
+ ]
95
+ },
96
+ "amount": {
97
+ "$ref": "#/definitions/Amount"
98
+ },
99
+ "frequency": {
100
+ "$ref": "#/definitions/Frequency"
101
+ },
102
+ "comments": {
103
+ "$ref": "#/definitions/Comments"
104
+ }
105
+ },
106
+ "required": ["frequency", "type"]
107
+ }
108
+ },
109
+ "Uuid": {
110
+ "type": "string",
111
+ "format": "uuid",
112
+ "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
113
+ }
114
+ },
115
+ "type": "object",
116
+ "title": "The Expense event schema",
117
+ "description": "Create, update or delete",
118
+ "properties": {
119
+ "version": {
120
+ "type": "string",
121
+ "description": "schema version"
122
+ },
123
+ "type": {
124
+ "type": "string",
125
+ "enum": ["ExpenseCreated", "ExpenseUpdated"]
126
+ },
127
+ "payload": {
128
+ "$ref": "#/definitions/payload"
129
+ }
130
+ },
131
+ "required": ["version", "payload", "type"]
132
+ }