@lendi/act-credit-decisions-transform 2.0.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 +9 -0
  43. package/lib/transform-events/transform-employment.js +107 -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 +79 -0
@@ -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,278 @@
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 employment",
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
+ "otherState": {
61
+ "type": "string",
62
+ "example": "Ohio"
63
+ },
64
+ "employerAddress": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "properties": {
68
+ "postcode": {
69
+ "type": "string"
70
+ },
71
+ "state": {
72
+ "example": "NSW",
73
+ "$ref": "#/definitions/australianStates"
74
+ },
75
+ "city": {
76
+ "type": "string",
77
+ "example": "Miranda"
78
+ },
79
+ "country": {
80
+ "type": "string",
81
+ "example": "Australia"
82
+ },
83
+ "formatted": {
84
+ "type": "string",
85
+ "example": "8 Clarence st, Miranda, NSW, Australia"
86
+ },
87
+ "standard": {
88
+ "$ref": "#/definitions/addressStandard"
89
+ }
90
+ }
91
+ },
92
+ "businessStructure": {
93
+ "type": "string",
94
+ "enum": ["SOLE_TRADER", "PARTNERSHIP", "COMPANY", "TRUST"]
95
+ },
96
+ "onProbation": {
97
+ "type": "boolean",
98
+ "example": false
99
+ },
100
+ "startDate": {
101
+ "type": "string",
102
+ "format": "date",
103
+ "example": "2018-07-17"
104
+ },
105
+ "endDate": {
106
+ "type": ["string", "null"],
107
+ "format": "date",
108
+ "example": "2018-07-17"
109
+ },
110
+ "maternityLeaveReturnDate": {
111
+ "type": "string",
112
+ "format": "date",
113
+ "description": "Date returning from maternity leave",
114
+ "example": "2020-07-17"
115
+ },
116
+ "role": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "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.",
120
+ "properties": {
121
+ "anzsco": {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "properties": {
125
+ "code": {
126
+ "type": "number",
127
+ "example": 111312
128
+ },
129
+ "category": {
130
+ "type": "string",
131
+ "example": "MANAGERS"
132
+ },
133
+ "occupation": {
134
+ "type": "string",
135
+ "example": "Member of Parliament"
136
+ }
137
+ }
138
+ },
139
+ "asco": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "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.",
143
+ "properties": {
144
+ "code": {
145
+ "type": "string",
146
+ "example": "1111-11"
147
+ },
148
+ "category": {
149
+ "type": "string",
150
+ "example": "MANAGERS AND ADMINISTRATORS"
151
+ },
152
+ "occupation": {
153
+ "type": "string",
154
+ "example": "Parliamentarian or Councillor"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ },
160
+ "maternityLeaveReturnBasis": {
161
+ "type": "string",
162
+ "description": "Employment basis after returning from maternity leave.",
163
+ "enum": ["FULL_TIME", "PART_TIME", "CASUAL", "CONTRACTOR"]
164
+ },
165
+ "type": {
166
+ "type": "string",
167
+ "enum": ["PRIMARY", "SECONDARY", "PREVIOUS"]
168
+ },
169
+ "employmentType": {
170
+ "type": "string",
171
+ "enum": ["EMPLOYEE", "SELF_EMPLOYED", "NOT_WORKING"]
172
+ },
173
+ "addressStandard": {
174
+ "type": "object",
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
+ "companyId": {
219
+ "$ref": "#/definitions/id",
220
+ "description": "uuid of the related company"
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
+ "onProbation": {
239
+ "$ref": "#/definitions/onProbation"
240
+ },
241
+ "startDate": {
242
+ "$ref": "#/definitions/startDate"
243
+ },
244
+ "endDate": {
245
+ "$ref": "#/definitions/endDate"
246
+ },
247
+ "role": {
248
+ "$ref": "#/definitions/role"
249
+ },
250
+ "maternityLeaveReturnDate": {
251
+ "$ref": "#/definitions/maternityLeaveReturnDate"
252
+ },
253
+ "maternityLeaveReturnBasis": {
254
+ "$ref": "#/definitions/maternityLeaveReturnBasis"
255
+ }
256
+ },
257
+ "required": ["id", "applicantId", "applicationId", "type"],
258
+ "description": "create or update employment payload"
259
+ }
260
+ },
261
+ "type": "object",
262
+ "title": "The employment event schema",
263
+ "description": "Create or update",
264
+ "properties": {
265
+ "version": {
266
+ "type": "string",
267
+ "description": "schema version"
268
+ },
269
+ "payload": {
270
+ "$ref": "#/definitions/payload"
271
+ },
272
+ "type": {
273
+ "type": "string",
274
+ "enum": ["EmploymentV2Created", "EmploymentV2Updated"]
275
+ }
276
+ },
277
+ "required": ["version", "payload", "type"]
278
+ }
@@ -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,133 @@
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
+ "RENT_UTILITIES",
72
+ "LIVING_EXPENSES_ESTIMATE",
73
+ "GROCERIES",
74
+ "CHILDCARE",
75
+ "CHILD_AND_SPOUSAL_MAINTENANCE",
76
+ "PRIMARY_SECONDARY_EDUCATION",
77
+ "HIGHER_VOCATIONAL_TRAINING_EDUCATION",
78
+ "PRIVATE_SCHOOLING_AND_TUITION",
79
+ "CLOTHING_AND_PERSONAL_CARE",
80
+ "RECREATION_AND_ENTERTAINMENT",
81
+ "TELEPHONE_INTERNET_PAY_TV_AND_MEDIA_STREAMING_SUBSCRIPTIONS",
82
+ "PET_CARE",
83
+ "TRANSPORT",
84
+ "BODY_CORPORATE_FEES_STRATA_FEES_AND_LAND_TAX",
85
+ "PRIMARY_RESIDENCE_RUNNING_COSTS",
86
+ "INVESTMENT_PROPERTY_RUNNING_COSTS",
87
+ "SECONDARY_RESIDENCE_RUNNING_COSTS",
88
+ "INSURANCE",
89
+ "LIFE_INSURANCE",
90
+ "HEALTH_INSURANCE",
91
+ "MEDICAL_AND_HEALTH",
92
+ "RENT",
93
+ "BOARD",
94
+ "OTHER"
95
+ ]
96
+ },
97
+ "amount": {
98
+ "$ref": "#/definitions/Amount"
99
+ },
100
+ "frequency": {
101
+ "$ref": "#/definitions/Frequency"
102
+ },
103
+ "comments": {
104
+ "$ref": "#/definitions/Comments"
105
+ }
106
+ },
107
+ "required": ["frequency", "type"]
108
+ }
109
+ },
110
+ "Uuid": {
111
+ "type": "string",
112
+ "format": "uuid",
113
+ "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
114
+ }
115
+ },
116
+ "type": "object",
117
+ "title": "The Expense event schema",
118
+ "description": "Create, update or delete",
119
+ "properties": {
120
+ "version": {
121
+ "type": "string",
122
+ "description": "schema version"
123
+ },
124
+ "type": {
125
+ "type": "string",
126
+ "enum": ["ExpenseCreated", "ExpenseUpdated"]
127
+ },
128
+ "payload": {
129
+ "$ref": "#/definitions/payload"
130
+ }
131
+ },
132
+ "required": ["version", "payload", "type"]
133
+ }