@dynamatix/gb-schemas 2.3.237 → 2.3.238

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 (252) hide show
  1. package/README.md +309 -0
  2. package/dist/applicants/applicant-additional-income.model.d.ts +13 -12
  3. package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
  4. package/dist/applicants/applicant-additional-income.model.js +3 -0
  5. package/dist/applicants/applicant-commitment-creditCard.model.d.ts +19 -18
  6. package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
  7. package/dist/applicants/applicant-commitment-creditCard.model.js +3 -0
  8. package/dist/applicants/applicant-commitment-loan.model.d.ts +19 -18
  9. package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
  10. package/dist/applicants/applicant-commitment-loan.model.js +3 -0
  11. package/dist/applicants/applicant-commitment-mortgage.model.d.ts +19 -18
  12. package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
  13. package/dist/applicants/applicant-commitment-mortgage.model.js +3 -0
  14. package/dist/applicants/applicant-commitment-residence.model.d.ts +31 -30
  15. package/dist/applicants/applicant-commitment-residence.model.d.ts.map +1 -1
  16. package/dist/applicants/applicant-commitment-residence.model.js +3 -0
  17. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts +19 -18
  18. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -1
  19. package/dist/applicants/applicant-commitment-secureLoan.model.js +3 -0
  20. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +19 -18
  21. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -1
  22. package/dist/applicants/applicant-commitment-unsecuredLoan.model.js +3 -0
  23. package/dist/applicants/applicant-credit-data.model.d.ts +3 -3
  24. package/dist/applicants/applicant-credit-report.model.d.ts +3754 -0
  25. package/dist/applicants/{applicant-income.model.d.ts.map → applicant-credit-report.model.d.ts.map} +1 -1
  26. package/dist/applicants/applicant-credit-report.model.js +116 -0
  27. package/dist/applicants/applicant-credit-report.type.d.ts +140 -0
  28. package/dist/applicants/applicant-credit-report.type.d.ts.map +1 -0
  29. package/dist/applicants/applicant-credit-report.type.js +1 -0
  30. package/dist/applicants/applicant-employment-income.model.d.ts +7 -6
  31. package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -1
  32. package/dist/applicants/applicant-employment-income.model.js +3 -0
  33. package/dist/applicants/applicant-employment.model.d.ts +88 -87
  34. package/dist/applicants/applicant-employment.model.d.ts.map +1 -1
  35. package/dist/applicants/applicant-employment.model.js +19 -19
  36. package/dist/applicants/applicant-expenditure.model.d.ts +7 -0
  37. package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
  38. package/dist/applicants/applicant-expenditure.model.js +77 -0
  39. package/dist/applicants/applicant-expenditure.type.d.ts +42 -0
  40. package/dist/applicants/applicant-expenditure.type.d.ts.map +1 -0
  41. package/dist/applicants/applicant-expenditure.type.js +1 -0
  42. package/dist/applicants/applicant-income-settings.model.d.ts.map +1 -1
  43. package/dist/applicants/applicant-income-settings.model.js +3 -0
  44. package/dist/applicants/applicant-income-settings.type.d.ts +40 -0
  45. package/dist/applicants/applicant-income-settings.type.d.ts.map +1 -0
  46. package/dist/applicants/applicant-income-settings.type.js +1 -0
  47. package/dist/applicants/applicant-income-summary.model.d.ts +73 -72
  48. package/dist/applicants/applicant-income-summary.model.d.ts.map +1 -1
  49. package/dist/applicants/applicant-income-summary.model.js +3 -0
  50. package/dist/applicants/applicant-income-summary.type.d.ts +60 -0
  51. package/dist/applicants/applicant-income-summary.type.d.ts.map +1 -0
  52. package/dist/applicants/applicant-income-summary.type.js +1 -0
  53. package/dist/applicants/applicant-pension-income.model.d.ts +19 -18
  54. package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
  55. package/dist/applicants/applicant-pension-income.model.js +3 -0
  56. package/dist/applicants/applicant-pension-income.type.d.ts +40 -0
  57. package/dist/applicants/applicant-pension-income.type.d.ts.map +1 -0
  58. package/dist/applicants/applicant-pension-income.type.js +1 -0
  59. package/dist/applicants/applicant-property-income.model.d.ts +37 -36
  60. package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
  61. package/dist/applicants/applicant-property-income.model.js +3 -0
  62. package/dist/applicants/applicant-self-employed-income.model.d.ts +7 -6
  63. package/dist/applicants/applicant-self-employed-income.model.d.ts.map +1 -1
  64. package/dist/applicants/applicant-self-employed-income.model.js +3 -0
  65. package/dist/applicants/applicant-self-employed-income.type.d.ts +37 -0
  66. package/dist/applicants/applicant-self-employed-income.type.d.ts.map +1 -0
  67. package/dist/applicants/applicant-self-employed-income.type.js +1 -0
  68. package/dist/applicants/applicant-self-employment.model.d.ts +6 -6
  69. package/dist/applicants/applicant-self-employment.model.d.ts.map +1 -1
  70. package/dist/applicants/applicant-self-employment.model.js +4 -1
  71. package/dist/applicants/applicant-sole-trader-income.model.d.ts +7 -6
  72. package/dist/applicants/applicant-sole-trader-income.model.d.ts.map +1 -1
  73. package/dist/applicants/applicant-sole-trader-income.model.js +3 -0
  74. package/dist/applicants/applicant-sole-trader-income.type.d.ts +37 -0
  75. package/dist/applicants/applicant-sole-trader-income.type.d.ts.map +1 -0
  76. package/dist/applicants/applicant-sole-trader-income.type.js +1 -0
  77. package/dist/applicants/applicant-uk-tax-credits.model.d.ts +19 -18
  78. package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
  79. package/dist/applicants/applicant-uk-tax-credits.model.js +3 -0
  80. package/dist/applicants/applicant-uk-tax-credits.type.d.ts +39 -0
  81. package/dist/applicants/applicant-uk-tax-credits.type.d.ts.map +1 -0
  82. package/dist/applicants/applicant-uk-tax-credits.type.js +1 -0
  83. package/dist/applicants/applicant-welcome-call.model.d.ts +288 -0
  84. package/dist/applicants/applicant-welcome-call.model.d.ts.map +1 -0
  85. package/dist/applicants/applicant-welcome-call.model.js +263 -0
  86. package/dist/applicants/applicant-welcome-call.type.d.ts +66 -0
  87. package/dist/applicants/applicant-welcome-call.type.d.ts.map +1 -0
  88. package/dist/applicants/applicant-welcome-call.type.js +1 -0
  89. package/dist/applicants/applicant.model.d.ts +49 -42
  90. package/dist/applicants/applicant.model.d.ts.map +1 -1
  91. package/dist/applicants/applicant.model.js +5 -1
  92. package/dist/applicants/applicant.type.d.ts +158 -0
  93. package/dist/applicants/applicant.type.d.ts.map +1 -0
  94. package/dist/applicants/applicant.type.js +1 -0
  95. package/dist/applicants/index.d.ts +14 -0
  96. package/dist/applicants/index.d.ts.map +1 -1
  97. package/dist/applicants/index.js +2 -0
  98. package/dist/applications/application-audit.model.d.ts +6 -6
  99. package/dist/applications/application-audit.model.d.ts.map +1 -1
  100. package/dist/applications/application-audit.model.js +3 -0
  101. package/dist/applications/application-checklist-Item.model.d.ts +6 -0
  102. package/dist/applications/application-checklist-Item.model.d.ts.map +1 -1
  103. package/dist/applications/application-checklist-Item.model.js +4 -0
  104. package/dist/applications/application-company-model.d.ts +64 -57
  105. package/dist/applications/application-company-model.d.ts.map +1 -1
  106. package/dist/applications/application-company-model.js +1 -0
  107. package/dist/applications/application-direct-debit.model.d.ts +29 -27
  108. package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
  109. package/dist/applications/application-direct-debit.model.js +3 -0
  110. package/dist/applications/application-euc.model.d.ts.map +1 -1
  111. package/dist/applications/application-euc.model.js +3 -0
  112. package/dist/applications/application-fieldconfig.model.d.ts.map +1 -1
  113. package/dist/applications/application-fieldconfig.model.js +3 -0
  114. package/dist/applications/application-legal.model.d.ts.map +1 -1
  115. package/dist/applications/application-legal.model.js +3 -0
  116. package/dist/applications/application-mortgage.model.d.ts +1 -0
  117. package/dist/applications/application-mortgage.model.d.ts.map +1 -1
  118. package/dist/applications/application-mortgage.model.js +3 -0
  119. package/dist/applications/application-mortgage.type.d.ts +76 -0
  120. package/dist/applications/application-mortgage.type.d.ts.map +1 -0
  121. package/dist/applications/application-mortgage.type.js +1 -0
  122. package/dist/applications/application-note.model.d.ts +36 -24
  123. package/dist/applications/application-note.model.d.ts.map +1 -1
  124. package/dist/applications/application-note.model.js +12 -3
  125. package/dist/applications/application-note.type.d.ts +55 -0
  126. package/dist/applications/application-note.type.d.ts.map +1 -0
  127. package/dist/applications/application-note.type.js +1 -0
  128. package/dist/applications/application-offer.model.d.ts.map +1 -1
  129. package/dist/applications/application-offer.model.js +3 -0
  130. package/dist/applications/application-onboarding.model.d.ts.map +1 -1
  131. package/dist/applications/application-onboarding.model.js +3 -0
  132. package/dist/applications/application-product.model.d.ts +77 -13
  133. package/dist/applications/application-product.model.d.ts.map +1 -1
  134. package/dist/applications/application-product.model.js +16 -3
  135. package/dist/applications/application-product.type.d.ts +58 -0
  136. package/dist/applications/application-product.type.d.ts.map +1 -0
  137. package/dist/applications/application-product.type.js +1 -0
  138. package/dist/applications/application-productfeatures.model.d.ts +12 -6
  139. package/dist/applications/application-productfeatures.model.d.ts.map +1 -1
  140. package/dist/applications/application-productfeatures.model.js +5 -1
  141. package/dist/applications/application-productfeatures.type.d.ts +125 -0
  142. package/dist/applications/application-productfeatures.type.d.ts.map +1 -0
  143. package/dist/applications/application-productfeatures.type.js +1 -0
  144. package/dist/applications/application-rationale.model.d.ts +6 -12
  145. package/dist/applications/application-rationale.model.d.ts.map +1 -1
  146. package/dist/applications/application-rationale.model.js +11 -20
  147. package/dist/applications/application-rationale.type.d.ts +7 -7
  148. package/dist/applications/application-rationale.type.d.ts.map +1 -1
  149. package/dist/applications/application-risk-narrative.model.d.ts.map +1 -1
  150. package/dist/applications/application-risk-narrative.model.js +3 -0
  151. package/dist/applications/application-valuation-report.model.d.ts +1246 -0
  152. package/dist/applications/application-valuation-report.model.d.ts.map +1 -0
  153. package/dist/applications/application-valuation-report.model.js +269 -0
  154. package/dist/applications/application-valuation-report.type.d.ts +108 -0
  155. package/dist/applications/application-valuation-report.type.d.ts.map +1 -0
  156. package/dist/applications/application-valuation-report.type.js +1 -0
  157. package/dist/applications/application-valuation.model.d.ts +695 -18
  158. package/dist/applications/application-valuation.model.d.ts.map +1 -1
  159. package/dist/applications/application-valuation.model.js +33 -7
  160. package/dist/applications/application-valuation.type.d.ts +54 -0
  161. package/dist/applications/application-valuation.type.d.ts.map +1 -0
  162. package/dist/applications/application-valuation.type.js +1 -0
  163. package/dist/applications/application.model.d.ts +36 -30
  164. package/dist/applications/application.model.d.ts.map +1 -1
  165. package/dist/applications/application.model.js +17 -4
  166. package/dist/applications/applications-task.model.d.ts +171 -67
  167. package/dist/applications/applications-task.model.d.ts.map +1 -1
  168. package/dist/applications/applications-task.model.js +36 -45
  169. package/dist/applications/applications-task.type.d.ts +57 -0
  170. package/dist/applications/applications-task.type.d.ts.map +1 -0
  171. package/dist/applications/applications-task.type.js +1 -0
  172. package/dist/applications/broker.model.d.ts.map +1 -1
  173. package/dist/applications/broker.model.js +3 -0
  174. package/dist/applications/index.d.ts +10 -3
  175. package/dist/applications/index.d.ts.map +1 -1
  176. package/dist/applications/index.js +2 -3
  177. package/dist/applications/solicitor.model.d.ts +2 -0
  178. package/dist/applications/solicitor.model.d.ts.map +1 -1
  179. package/dist/applications/solicitor.model.js +3 -0
  180. package/dist/index.d.ts +1 -0
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.js +2 -0
  183. package/dist/product-catalogues/index.d.ts +3 -0
  184. package/dist/product-catalogues/index.d.ts.map +1 -1
  185. package/dist/product-catalogues/product-catalogue.type.d.ts +15 -0
  186. package/dist/product-catalogues/product-catalogue.type.d.ts.map +1 -0
  187. package/dist/product-catalogues/product-catalogue.type.js +1 -0
  188. package/dist/product-catalogues/product-definitions.type.d.ts +53 -0
  189. package/dist/product-catalogues/product-definitions.type.d.ts.map +1 -0
  190. package/dist/product-catalogues/product-definitions.type.js +1 -0
  191. package/dist/product-catalogues/product-variant.type.d.ts +38 -0
  192. package/dist/product-catalogues/product-variant.type.d.ts.map +1 -0
  193. package/dist/product-catalogues/product-variant.type.js +1 -0
  194. package/dist/properties/property.model.d.ts +52 -51
  195. package/dist/properties/property.model.d.ts.map +1 -1
  196. package/dist/properties/property.model.js +1 -2
  197. package/dist/properties/security.model.d.ts +6 -0
  198. package/dist/properties/security.model.d.ts.map +1 -1
  199. package/dist/properties/security.model.js +1 -0
  200. package/dist/shared/alert.model.d.ts +12 -12
  201. package/dist/shared/api-log.model.d.ts +118 -0
  202. package/dist/shared/api-log.model.d.ts.map +1 -0
  203. package/dist/shared/api-log.model.js +21 -0
  204. package/dist/shared/apprivo-sync-journey.model.d.ts +6 -6
  205. package/dist/shared/checklist.model.d.ts +6 -6
  206. package/dist/shared/index.d.ts +5 -1
  207. package/dist/shared/index.d.ts.map +1 -1
  208. package/dist/shared/index.js +4 -1
  209. package/dist/shared/job-setting.model.d.ts +6 -6
  210. package/dist/shared/lookup-group.model.d.ts +25 -25
  211. package/dist/shared/lookup-group.model.d.ts.map +1 -1
  212. package/dist/shared/lookup-group.model.js +3 -0
  213. package/dist/shared/schema-doc.model.d.ts +6 -6
  214. package/dist/shared/system-parameter.model.d.ts +6 -6
  215. package/dist/shared/task-document.model.d.ts +6 -6
  216. package/dist/shared/task.model.d.ts +6 -6
  217. package/dist/shared/{document-type-model.d.ts → webhook-event.model.d.ts} +6 -45
  218. package/dist/shared/webhook-event.model.d.ts.map +1 -0
  219. package/dist/shared/webhook-event.model.js +53 -0
  220. package/dist/shared/webhook-event.type.d.ts +15 -0
  221. package/dist/shared/webhook-event.type.d.ts.map +1 -0
  222. package/dist/shared/webhook-event.type.js +1 -0
  223. package/dist/shared/workflow-trigger.model.d.ts +32 -0
  224. package/dist/shared/workflow-trigger.model.d.ts.map +1 -0
  225. package/dist/shared/workflow-trigger.model.js +45 -0
  226. package/dist/shared/workflow-trigger.type.d.ts +59 -0
  227. package/dist/shared/workflow-trigger.type.d.ts.map +1 -0
  228. package/dist/shared/workflow-trigger.type.js +1 -0
  229. package/dist/shared/workflow.init.d.ts +21 -0
  230. package/dist/shared/workflow.init.d.ts.map +1 -0
  231. package/dist/shared/workflow.init.js +41 -0
  232. package/dist/shared/workflow.middleware.d.ts +107 -0
  233. package/dist/shared/workflow.middleware.d.ts.map +1 -0
  234. package/dist/shared/workflow.middleware.js +230 -0
  235. package/dist/shared/workflow.plugin.d.ts +46 -0
  236. package/dist/shared/workflow.plugin.d.ts.map +1 -0
  237. package/dist/shared/workflow.plugin.js +102 -0
  238. package/dist/shared/workflow.service.d.ts +39 -0
  239. package/dist/shared/workflow.service.d.ts.map +1 -0
  240. package/dist/shared/workflow.service.js +115 -0
  241. package/dist/value-objects/pound.d.ts.map +1 -1
  242. package/package.json +14 -3
  243. package/dist/applicants/applicant-income.model.d.ts +0 -2558
  244. package/dist/applicants/applicant-income.model.js +0 -82
  245. package/dist/applications/application-document.model.d.ts +0 -186
  246. package/dist/applications/application-document.model.d.ts.map +0 -1
  247. package/dist/applications/application-document.model.js +0 -35
  248. package/dist/applications/document.model.d.ts +0 -186
  249. package/dist/applications/document.model.d.ts.map +0 -1
  250. package/dist/applications/document.model.js +0 -35
  251. package/dist/shared/document-type-model.d.ts.map +0 -1
  252. package/dist/shared/document-type-model.js +0 -10
@@ -1,3 +1,4 @@
1
+ /// <reference path="../value-objects/pound.d.ts" />
1
2
  /// <reference path="../value-objects/account-number.d.ts" />
2
3
  /// <reference path="../value-objects/sort-code.d.ts" />
3
4
  /// <reference types="mongoose/types/aggregate" />
@@ -36,7 +37,7 @@ declare const ApplicantEmployment: mongoose.Model<{
36
37
  addressLine2?: unknown;
37
38
  addressLine3?: unknown;
38
39
  addressCity?: unknown;
39
- addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
40
+ addressCountryLid?: unknown;
40
41
  contractRemaining?: unknown;
41
42
  dateJoined?: unknown;
42
43
  disabilityLiving?: {
@@ -62,14 +63,14 @@ declare const ApplicantEmployment: mongoose.Model<{
62
63
  } | null | undefined;
63
64
  set?: {} | null | undefined;
64
65
  validate?: {} | null | undefined;
66
+ index?: {} | null | undefined;
65
67
  default?: {} | null | undefined;
66
68
  text?: {} | null | undefined;
67
69
  unique?: {} | null | undefined;
68
- index?: {} | null | undefined;
69
70
  sparse?: {} | null | undefined;
71
+ cast?: {} | null | undefined;
70
72
  required?: {} | null | undefined;
71
73
  ref?: {} | null | undefined;
72
- cast?: {} | null | undefined;
73
74
  select?: {} | null | undefined;
74
75
  immutable?: {} | null | undefined;
75
76
  transform?: {} | null | undefined;
@@ -112,14 +113,14 @@ declare const ApplicantEmployment: mongoose.Model<{
112
113
  } | null | undefined;
113
114
  set?: {} | null | undefined;
114
115
  validate?: {} | null | undefined;
116
+ index?: {} | null | undefined;
115
117
  default?: {} | null | undefined;
116
118
  text?: {} | null | undefined;
117
119
  unique?: {} | null | undefined;
118
- index?: {} | null | undefined;
119
120
  sparse?: {} | null | undefined;
121
+ cast?: {} | null | undefined;
120
122
  required?: {} | null | undefined;
121
123
  ref?: {} | null | undefined;
122
- cast?: {} | null | undefined;
123
124
  select?: {} | null | undefined;
124
125
  immutable?: {} | null | undefined;
125
126
  transform?: {} | null | undefined;
@@ -137,9 +138,9 @@ declare const ApplicantEmployment: mongoose.Model<{
137
138
  validateAll?: {} | null | undefined;
138
139
  defaultOptions?: unknown;
139
140
  } | null | undefined;
140
- industryLid?: mongoose.Types.ObjectId | null | undefined;
141
+ industryLid?: unknown;
141
142
  isUnderTerminationNotice?: unknown;
142
- jobTitleLid?: mongoose.Types.ObjectId | null | undefined;
143
+ jobTitleLid?: unknown;
143
144
  pensionIncome?: {
144
145
  validators: mongoose.Types.DocumentArray<{
145
146
  type?: unknown;
@@ -163,14 +164,14 @@ declare const ApplicantEmployment: mongoose.Model<{
163
164
  } | null | undefined;
164
165
  set?: {} | null | undefined;
165
166
  validate?: {} | null | undefined;
167
+ index?: {} | null | undefined;
166
168
  default?: {} | null | undefined;
167
169
  text?: {} | null | undefined;
168
170
  unique?: {} | null | undefined;
169
- index?: {} | null | undefined;
170
171
  sparse?: {} | null | undefined;
172
+ cast?: {} | null | undefined;
171
173
  required?: {} | null | undefined;
172
174
  ref?: {} | null | undefined;
173
- cast?: {} | null | undefined;
174
175
  select?: {} | null | undefined;
175
176
  immutable?: {} | null | undefined;
176
177
  transform?: {} | null | undefined;
@@ -189,7 +190,7 @@ declare const ApplicantEmployment: mongoose.Model<{
189
190
  defaultOptions?: unknown;
190
191
  } | null | undefined;
191
192
  previousAddressCity?: unknown;
192
- previousAddressCountryLid?: mongoose.Types.ObjectId | null | undefined;
193
+ previousAddressCountryLid?: unknown;
193
194
  previousAddressLine1?: unknown;
194
195
  previousAddressLine2?: unknown;
195
196
  previousAddressLine3?: unknown;
@@ -217,14 +218,14 @@ declare const ApplicantEmployment: mongoose.Model<{
217
218
  } | null | undefined;
218
219
  set?: {} | null | undefined;
219
220
  validate?: {} | null | undefined;
221
+ index?: {} | null | undefined;
220
222
  default?: {} | null | undefined;
221
223
  text?: {} | null | undefined;
222
224
  unique?: {} | null | undefined;
223
- index?: {} | null | undefined;
224
225
  sparse?: {} | null | undefined;
226
+ cast?: {} | null | undefined;
225
227
  required?: {} | null | undefined;
226
228
  ref?: {} | null | undefined;
227
- cast?: {} | null | undefined;
228
229
  select?: {} | null | undefined;
229
230
  immutable?: {} | null | undefined;
230
231
  transform?: {} | null | undefined;
@@ -260,7 +261,7 @@ declare const ApplicantEmployment: mongoose.Model<{
260
261
  addressLine2?: unknown;
261
262
  addressLine3?: unknown;
262
263
  addressCity?: unknown;
263
- addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
264
+ addressCountryLid?: unknown;
264
265
  contractRemaining?: unknown;
265
266
  dateJoined?: unknown;
266
267
  disabilityLiving?: {
@@ -286,14 +287,14 @@ declare const ApplicantEmployment: mongoose.Model<{
286
287
  } | null | undefined;
287
288
  set?: {} | null | undefined;
288
289
  validate?: {} | null | undefined;
290
+ index?: {} | null | undefined;
289
291
  default?: {} | null | undefined;
290
292
  text?: {} | null | undefined;
291
293
  unique?: {} | null | undefined;
292
- index?: {} | null | undefined;
293
294
  sparse?: {} | null | undefined;
295
+ cast?: {} | null | undefined;
294
296
  required?: {} | null | undefined;
295
297
  ref?: {} | null | undefined;
296
- cast?: {} | null | undefined;
297
298
  select?: {} | null | undefined;
298
299
  immutable?: {} | null | undefined;
299
300
  transform?: {} | null | undefined;
@@ -336,14 +337,14 @@ declare const ApplicantEmployment: mongoose.Model<{
336
337
  } | null | undefined;
337
338
  set?: {} | null | undefined;
338
339
  validate?: {} | null | undefined;
340
+ index?: {} | null | undefined;
339
341
  default?: {} | null | undefined;
340
342
  text?: {} | null | undefined;
341
343
  unique?: {} | null | undefined;
342
- index?: {} | null | undefined;
343
344
  sparse?: {} | null | undefined;
345
+ cast?: {} | null | undefined;
344
346
  required?: {} | null | undefined;
345
347
  ref?: {} | null | undefined;
346
- cast?: {} | null | undefined;
347
348
  select?: {} | null | undefined;
348
349
  immutable?: {} | null | undefined;
349
350
  transform?: {} | null | undefined;
@@ -361,9 +362,9 @@ declare const ApplicantEmployment: mongoose.Model<{
361
362
  validateAll?: {} | null | undefined;
362
363
  defaultOptions?: unknown;
363
364
  } | null | undefined;
364
- industryLid?: mongoose.Types.ObjectId | null | undefined;
365
+ industryLid?: unknown;
365
366
  isUnderTerminationNotice?: unknown;
366
- jobTitleLid?: mongoose.Types.ObjectId | null | undefined;
367
+ jobTitleLid?: unknown;
367
368
  pensionIncome?: {
368
369
  validators: mongoose.Types.DocumentArray<{
369
370
  type?: unknown;
@@ -387,14 +388,14 @@ declare const ApplicantEmployment: mongoose.Model<{
387
388
  } | null | undefined;
388
389
  set?: {} | null | undefined;
389
390
  validate?: {} | null | undefined;
391
+ index?: {} | null | undefined;
390
392
  default?: {} | null | undefined;
391
393
  text?: {} | null | undefined;
392
394
  unique?: {} | null | undefined;
393
- index?: {} | null | undefined;
394
395
  sparse?: {} | null | undefined;
396
+ cast?: {} | null | undefined;
395
397
  required?: {} | null | undefined;
396
398
  ref?: {} | null | undefined;
397
- cast?: {} | null | undefined;
398
399
  select?: {} | null | undefined;
399
400
  immutable?: {} | null | undefined;
400
401
  transform?: {} | null | undefined;
@@ -413,7 +414,7 @@ declare const ApplicantEmployment: mongoose.Model<{
413
414
  defaultOptions?: unknown;
414
415
  } | null | undefined;
415
416
  previousAddressCity?: unknown;
416
- previousAddressCountryLid?: mongoose.Types.ObjectId | null | undefined;
417
+ previousAddressCountryLid?: unknown;
417
418
  previousAddressLine1?: unknown;
418
419
  previousAddressLine2?: unknown;
419
420
  previousAddressLine3?: unknown;
@@ -441,14 +442,14 @@ declare const ApplicantEmployment: mongoose.Model<{
441
442
  } | null | undefined;
442
443
  set?: {} | null | undefined;
443
444
  validate?: {} | null | undefined;
445
+ index?: {} | null | undefined;
444
446
  default?: {} | null | undefined;
445
447
  text?: {} | null | undefined;
446
448
  unique?: {} | null | undefined;
447
- index?: {} | null | undefined;
448
449
  sparse?: {} | null | undefined;
450
+ cast?: {} | null | undefined;
449
451
  required?: {} | null | undefined;
450
452
  ref?: {} | null | undefined;
451
- cast?: {} | null | undefined;
452
453
  select?: {} | null | undefined;
453
454
  immutable?: {} | null | undefined;
454
455
  transform?: {} | null | undefined;
@@ -484,7 +485,7 @@ declare const ApplicantEmployment: mongoose.Model<{
484
485
  addressLine2?: unknown;
485
486
  addressLine3?: unknown;
486
487
  addressCity?: unknown;
487
- addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
488
+ addressCountryLid?: unknown;
488
489
  contractRemaining?: unknown;
489
490
  dateJoined?: unknown;
490
491
  disabilityLiving?: {
@@ -510,14 +511,14 @@ declare const ApplicantEmployment: mongoose.Model<{
510
511
  } | null | undefined;
511
512
  set?: {} | null | undefined;
512
513
  validate?: {} | null | undefined;
514
+ index?: {} | null | undefined;
513
515
  default?: {} | null | undefined;
514
516
  text?: {} | null | undefined;
515
517
  unique?: {} | null | undefined;
516
- index?: {} | null | undefined;
517
518
  sparse?: {} | null | undefined;
519
+ cast?: {} | null | undefined;
518
520
  required?: {} | null | undefined;
519
521
  ref?: {} | null | undefined;
520
- cast?: {} | null | undefined;
521
522
  select?: {} | null | undefined;
522
523
  immutable?: {} | null | undefined;
523
524
  transform?: {} | null | undefined;
@@ -560,14 +561,14 @@ declare const ApplicantEmployment: mongoose.Model<{
560
561
  } | null | undefined;
561
562
  set?: {} | null | undefined;
562
563
  validate?: {} | null | undefined;
564
+ index?: {} | null | undefined;
563
565
  default?: {} | null | undefined;
564
566
  text?: {} | null | undefined;
565
567
  unique?: {} | null | undefined;
566
- index?: {} | null | undefined;
567
568
  sparse?: {} | null | undefined;
569
+ cast?: {} | null | undefined;
568
570
  required?: {} | null | undefined;
569
571
  ref?: {} | null | undefined;
570
- cast?: {} | null | undefined;
571
572
  select?: {} | null | undefined;
572
573
  immutable?: {} | null | undefined;
573
574
  transform?: {} | null | undefined;
@@ -585,9 +586,9 @@ declare const ApplicantEmployment: mongoose.Model<{
585
586
  validateAll?: {} | null | undefined;
586
587
  defaultOptions?: unknown;
587
588
  } | null | undefined;
588
- industryLid?: mongoose.Types.ObjectId | null | undefined;
589
+ industryLid?: unknown;
589
590
  isUnderTerminationNotice?: unknown;
590
- jobTitleLid?: mongoose.Types.ObjectId | null | undefined;
591
+ jobTitleLid?: unknown;
591
592
  pensionIncome?: {
592
593
  validators: mongoose.Types.DocumentArray<{
593
594
  type?: unknown;
@@ -611,14 +612,14 @@ declare const ApplicantEmployment: mongoose.Model<{
611
612
  } | null | undefined;
612
613
  set?: {} | null | undefined;
613
614
  validate?: {} | null | undefined;
615
+ index?: {} | null | undefined;
614
616
  default?: {} | null | undefined;
615
617
  text?: {} | null | undefined;
616
618
  unique?: {} | null | undefined;
617
- index?: {} | null | undefined;
618
619
  sparse?: {} | null | undefined;
620
+ cast?: {} | null | undefined;
619
621
  required?: {} | null | undefined;
620
622
  ref?: {} | null | undefined;
621
- cast?: {} | null | undefined;
622
623
  select?: {} | null | undefined;
623
624
  immutable?: {} | null | undefined;
624
625
  transform?: {} | null | undefined;
@@ -637,7 +638,7 @@ declare const ApplicantEmployment: mongoose.Model<{
637
638
  defaultOptions?: unknown;
638
639
  } | null | undefined;
639
640
  previousAddressCity?: unknown;
640
- previousAddressCountryLid?: mongoose.Types.ObjectId | null | undefined;
641
+ previousAddressCountryLid?: unknown;
641
642
  previousAddressLine1?: unknown;
642
643
  previousAddressLine2?: unknown;
643
644
  previousAddressLine3?: unknown;
@@ -665,14 +666,14 @@ declare const ApplicantEmployment: mongoose.Model<{
665
666
  } | null | undefined;
666
667
  set?: {} | null | undefined;
667
668
  validate?: {} | null | undefined;
669
+ index?: {} | null | undefined;
668
670
  default?: {} | null | undefined;
669
671
  text?: {} | null | undefined;
670
672
  unique?: {} | null | undefined;
671
- index?: {} | null | undefined;
672
673
  sparse?: {} | null | undefined;
674
+ cast?: {} | null | undefined;
673
675
  required?: {} | null | undefined;
674
676
  ref?: {} | null | undefined;
675
- cast?: {} | null | undefined;
676
677
  select?: {} | null | undefined;
677
678
  immutable?: {} | null | undefined;
678
679
  transform?: {} | null | undefined;
@@ -712,112 +713,112 @@ declare const ApplicantEmployment: mongoose.Model<{
712
713
  };
713
714
  }, {
714
715
  applicantId: mongoose.Types.ObjectId;
715
- natureOfBusiness: string;
716
- addressPostCode: string;
717
- addressLine1: string;
718
716
  addressLine2: string;
719
717
  addressLine3: string;
720
718
  addressCity: string;
721
- addressCountryLid: mongoose.Types.ObjectId;
722
719
  acceptableIncomeLids: mongoose.Types.ObjectId[];
723
- dateJoined: string;
724
720
  disabilityLiving: Pound;
725
- employerName: string;
726
721
  employerTelephone: string;
727
722
  housingAllowance: Pound;
728
- industryLid: mongoose.Types.ObjectId;
729
723
  isUnderTerminationNotice: boolean;
730
- jobTitleLid: mongoose.Types.ObjectId;
731
724
  pensionIncome: Pound;
732
725
  previousAddressCity: string;
733
- previousAddressCountryLid: mongoose.Types.ObjectId;
734
- previousAddressLine1: string;
735
726
  previousAddressLine2: string;
736
727
  previousAddressLine3: string;
737
- previousAddressPostCode: string;
738
728
  previousBasicGrossIncome: Pound;
739
- previousDateJoined: string;
740
- previousDateLeft: string;
741
- previousEmployerName: string;
742
729
  previousEmployerTelephone: string;
743
- previousJobTitle: string;
744
- previousNatureOfBusiness: string;
745
730
  referenceContact: string;
746
- referenceContactEmail: string;
747
731
  underTerminationNoticeNote: string;
732
+ natureOfBusiness?: string | null | undefined;
733
+ addressPostCode?: string | null | undefined;
734
+ addressLine1?: string | null | undefined;
735
+ addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
748
736
  contractRemaining?: string | null | undefined;
737
+ dateJoined?: string | null | undefined;
738
+ employerName?: string | null | undefined;
739
+ industryLid?: mongoose.Types.ObjectId | null | undefined;
740
+ jobTitleLid?: mongoose.Types.ObjectId | null | undefined;
741
+ previousAddressCountryLid?: mongoose.Types.ObjectId | null | undefined;
742
+ previousAddressLine1?: string | null | undefined;
743
+ previousAddressPostCode?: string | null | undefined;
744
+ previousDateJoined?: string | null | undefined;
745
+ previousDateLeft?: string | null | undefined;
746
+ previousEmployerName?: string | null | undefined;
747
+ previousJobTitle?: string | null | undefined;
748
+ previousNatureOfBusiness?: string | null | undefined;
749
+ referenceContactEmail?: string | null | undefined;
749
750
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
750
751
  applicantId: mongoose.Types.ObjectId;
751
- natureOfBusiness: string;
752
- addressPostCode: string;
753
- addressLine1: string;
754
752
  addressLine2: string;
755
753
  addressLine3: string;
756
754
  addressCity: string;
757
- addressCountryLid: mongoose.Types.ObjectId;
758
755
  acceptableIncomeLids: mongoose.Types.ObjectId[];
759
- dateJoined: string;
760
756
  disabilityLiving: Pound;
761
- employerName: string;
762
757
  employerTelephone: string;
763
758
  housingAllowance: Pound;
764
- industryLid: mongoose.Types.ObjectId;
765
759
  isUnderTerminationNotice: boolean;
766
- jobTitleLid: mongoose.Types.ObjectId;
767
760
  pensionIncome: Pound;
768
761
  previousAddressCity: string;
769
- previousAddressCountryLid: mongoose.Types.ObjectId;
770
- previousAddressLine1: string;
771
762
  previousAddressLine2: string;
772
763
  previousAddressLine3: string;
773
- previousAddressPostCode: string;
774
764
  previousBasicGrossIncome: Pound;
775
- previousDateJoined: string;
776
- previousDateLeft: string;
777
- previousEmployerName: string;
778
765
  previousEmployerTelephone: string;
779
- previousJobTitle: string;
780
- previousNatureOfBusiness: string;
781
766
  referenceContact: string;
782
- referenceContactEmail: string;
783
767
  underTerminationNoticeNote: string;
768
+ natureOfBusiness?: string | null | undefined;
769
+ addressPostCode?: string | null | undefined;
770
+ addressLine1?: string | null | undefined;
771
+ addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
784
772
  contractRemaining?: string | null | undefined;
773
+ dateJoined?: string | null | undefined;
774
+ employerName?: string | null | undefined;
775
+ industryLid?: mongoose.Types.ObjectId | null | undefined;
776
+ jobTitleLid?: mongoose.Types.ObjectId | null | undefined;
777
+ previousAddressCountryLid?: mongoose.Types.ObjectId | null | undefined;
778
+ previousAddressLine1?: string | null | undefined;
779
+ previousAddressPostCode?: string | null | undefined;
780
+ previousDateJoined?: string | null | undefined;
781
+ previousDateLeft?: string | null | undefined;
782
+ previousEmployerName?: string | null | undefined;
783
+ previousJobTitle?: string | null | undefined;
784
+ previousNatureOfBusiness?: string | null | undefined;
785
+ referenceContactEmail?: string | null | undefined;
785
786
  }>, {}> & mongoose.FlatRecord<{
786
787
  applicantId: mongoose.Types.ObjectId;
787
- natureOfBusiness: string;
788
- addressPostCode: string;
789
- addressLine1: string;
790
788
  addressLine2: string;
791
789
  addressLine3: string;
792
790
  addressCity: string;
793
- addressCountryLid: mongoose.Types.ObjectId;
794
791
  acceptableIncomeLids: mongoose.Types.ObjectId[];
795
- dateJoined: string;
796
792
  disabilityLiving: Pound;
797
- employerName: string;
798
793
  employerTelephone: string;
799
794
  housingAllowance: Pound;
800
- industryLid: mongoose.Types.ObjectId;
801
795
  isUnderTerminationNotice: boolean;
802
- jobTitleLid: mongoose.Types.ObjectId;
803
796
  pensionIncome: Pound;
804
797
  previousAddressCity: string;
805
- previousAddressCountryLid: mongoose.Types.ObjectId;
806
- previousAddressLine1: string;
807
798
  previousAddressLine2: string;
808
799
  previousAddressLine3: string;
809
- previousAddressPostCode: string;
810
800
  previousBasicGrossIncome: Pound;
811
- previousDateJoined: string;
812
- previousDateLeft: string;
813
- previousEmployerName: string;
814
801
  previousEmployerTelephone: string;
815
- previousJobTitle: string;
816
- previousNatureOfBusiness: string;
817
802
  referenceContact: string;
818
- referenceContactEmail: string;
819
803
  underTerminationNoticeNote: string;
804
+ natureOfBusiness?: string | null | undefined;
805
+ addressPostCode?: string | null | undefined;
806
+ addressLine1?: string | null | undefined;
807
+ addressCountryLid?: mongoose.Types.ObjectId | null | undefined;
820
808
  contractRemaining?: string | null | undefined;
809
+ dateJoined?: string | null | undefined;
810
+ employerName?: string | null | undefined;
811
+ industryLid?: mongoose.Types.ObjectId | null | undefined;
812
+ jobTitleLid?: mongoose.Types.ObjectId | null | undefined;
813
+ previousAddressCountryLid?: mongoose.Types.ObjectId | null | undefined;
814
+ previousAddressLine1?: string | null | undefined;
815
+ previousAddressPostCode?: string | null | undefined;
816
+ previousDateJoined?: string | null | undefined;
817
+ previousDateLeft?: string | null | undefined;
818
+ previousEmployerName?: string | null | undefined;
819
+ previousJobTitle?: string | null | undefined;
820
+ previousNatureOfBusiness?: string | null | undefined;
821
+ referenceContactEmail?: string | null | undefined;
821
822
  }> & {
822
823
  _id: mongoose.Types.ObjectId;
823
824
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"applicant-employment.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-employment.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA2C5D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAgF,CAAC;AAE1G,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"applicant-employment.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-employment.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA2C5D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAgF,CAAC;AAE1G,eAAe,mBAAmB,CAAC"}
@@ -2,39 +2,39 @@ import mongoose from "mongoose";
2
2
  import { Pound, formatPound } from "../value-objects/pound";
3
3
  const applicantEmploymentSchema = new mongoose.Schema({
4
4
  applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
5
- acceptableIncomeLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }],
5
+ acceptableIncomeLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", }],
6
6
  addressCity: { type: String, default: null },
7
- addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
8
- addressLine1: { type: String, required: true },
7
+ addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
8
+ addressLine1: { type: String, },
9
9
  addressLine2: { type: String, default: null },
10
10
  addressLine3: { type: String, default: null },
11
- addressPostCode: { type: String, required: true },
11
+ addressPostCode: { type: String, },
12
12
  contractRemaining: { type: String },
13
- dateJoined: { type: String, required: true },
13
+ dateJoined: { type: String, },
14
14
  disabilityLiving: { type: Pound, default: 0.00, get: formatPound },
15
- employerName: { type: String, required: true },
15
+ employerName: { type: String, },
16
16
  employerTelephone: { type: String, default: null },
17
17
  housingAllowance: { type: Pound, default: 0.00, get: formatPound },
18
- industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
18
+ industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
19
19
  isUnderTerminationNotice: { type: Boolean, default: false },
20
- jobTitleLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
21
- natureOfBusiness: { type: String, required: true },
20
+ jobTitleLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
21
+ natureOfBusiness: { type: String, },
22
22
  pensionIncome: { type: Pound, default: 0.00, get: formatPound },
23
23
  previousAddressCity: { type: String, default: null },
24
- previousAddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
25
- previousAddressLine1: { type: String, required: true },
24
+ previousAddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
25
+ previousAddressLine1: { type: String, },
26
26
  previousAddressLine2: { type: String, default: null },
27
27
  previousAddressLine3: { type: String, default: null },
28
- previousAddressPostCode: { type: String, required: true },
29
- previousBasicGrossIncome: { type: Pound, default: 0.00, required: true, get: formatPound },
30
- previousDateJoined: { type: String, required: true },
31
- previousDateLeft: { type: String, required: true },
32
- previousEmployerName: { type: String, required: true },
28
+ previousAddressPostCode: { type: String, },
29
+ previousBasicGrossIncome: { type: Pound, default: 0.00, get: formatPound },
30
+ previousDateJoined: { type: String, },
31
+ previousDateLeft: { type: String, },
32
+ previousEmployerName: { type: String, },
33
33
  previousEmployerTelephone: { type: String, default: null },
34
- previousJobTitle: { type: String, required: true },
35
- previousNatureOfBusiness: { type: String, required: true },
34
+ previousJobTitle: { type: String, },
35
+ previousNatureOfBusiness: { type: String, },
36
36
  referenceContact: { type: String, default: null },
37
- referenceContactEmail: { type: String, required: true },
37
+ referenceContactEmail: { type: String, },
38
38
  underTerminationNoticeNote: { type: String, default: null }
39
39
  }, {
40
40
  toJSON: { getters: true },
@@ -1,3 +1,4 @@
1
+ /// <reference path="../value-objects/pound.d.ts" />
1
2
  /// <reference path="../value-objects/account-number.d.ts" />
2
3
  /// <reference path="../value-objects/sort-code.d.ts" />
3
4
  /// <reference types="mongoose/types/aggregate" />
@@ -34,6 +35,7 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
34
35
  applicantId: mongoose.Types.ObjectId;
35
36
  isFixed: boolean;
36
37
  expenditureTypeLid: mongoose.Types.ObjectId;
38
+ isActualUpdated: boolean;
37
39
  sectionName?: "essentialExpenditure" | "basicCostOfLivingExpenditure" | null | undefined;
38
40
  declared?: Pound | null | undefined;
39
41
  expected?: string | null | undefined;
@@ -46,6 +48,7 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
46
48
  applicantId: mongoose.Types.ObjectId;
47
49
  isFixed: boolean;
48
50
  expenditureTypeLid: mongoose.Types.ObjectId;
51
+ isActualUpdated: boolean;
49
52
  sectionName?: "essentialExpenditure" | "basicCostOfLivingExpenditure" | null | undefined;
50
53
  declared?: Pound | null | undefined;
51
54
  expected?: string | null | undefined;
@@ -58,6 +61,7 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
58
61
  applicantId: mongoose.Types.ObjectId;
59
62
  isFixed: boolean;
60
63
  expenditureTypeLid: mongoose.Types.ObjectId;
64
+ isActualUpdated: boolean;
61
65
  sectionName?: "essentialExpenditure" | "basicCostOfLivingExpenditure" | null | undefined;
62
66
  declared?: Pound | null | undefined;
63
67
  expected?: string | null | undefined;
@@ -82,6 +86,7 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
82
86
  applicantId: mongoose.Types.ObjectId;
83
87
  isFixed: boolean;
84
88
  expenditureTypeLid: mongoose.Types.ObjectId;
89
+ isActualUpdated: boolean;
85
90
  sectionName?: "essentialExpenditure" | "basicCostOfLivingExpenditure" | null | undefined;
86
91
  declared?: Pound | null | undefined;
87
92
  expected?: string | null | undefined;
@@ -94,6 +99,7 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
94
99
  applicantId: mongoose.Types.ObjectId;
95
100
  isFixed: boolean;
96
101
  expenditureTypeLid: mongoose.Types.ObjectId;
102
+ isActualUpdated: boolean;
97
103
  sectionName?: "essentialExpenditure" | "basicCostOfLivingExpenditure" | null | undefined;
98
104
  declared?: Pound | null | undefined;
99
105
  expected?: string | null | undefined;
@@ -106,6 +112,7 @@ declare const ApplicantExpenditureModel: mongoose.Model<{
106
112
  applicantId: mongoose.Types.ObjectId;
107
113
  isFixed: boolean;
108
114
  expenditureTypeLid: mongoose.Types.ObjectId;
115
+ isActualUpdated: boolean;
109
116
  sectionName?: "essentialExpenditure" | "basicCostOfLivingExpenditure" | null | undefined;
110
117
  declared?: Pound | null | undefined;
111
118
  expected?: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA8E5D,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsE,CAAC;AACtG,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AA0K5D,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsE,CAAC;AACtG,eAAe,yBAAyB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import mongoose from "mongoose";
2
+ import { applyWorkflowPlugin } from "../shared/workflow.plugin";
2
3
  import { Pound, formatPound } from "../value-objects/pound";
3
4
  import { applyAuditMiddleware } from "@dynamatix/cat-shared/middlewares";
4
5
  const applicantExpenditureSchema = new mongoose.Schema({
@@ -41,6 +42,11 @@ const applicantExpenditureSchema = new mongoose.Schema({
41
42
  description: "Actual monthly expenditure verified based on applicant's evidence.",
42
43
  get: formatPound
43
44
  },
45
+ isActualUpdated: {
46
+ type: Boolean,
47
+ default: false,
48
+ description: "Flag indicating if the actual field has been updated.",
49
+ },
44
50
  rationale: {
45
51
  type: String,
46
52
  description: "Rationalized monthly expenditure used for affordability assessment.",
@@ -50,6 +56,75 @@ const applicantExpenditureSchema = new mongoose.Schema({
50
56
  toJSON: { virtuals: true },
51
57
  toObject: { virtuals: true },
52
58
  });
59
+ // Helper function to extract actual value from update object
60
+ function extractActualValue(update) {
61
+ return update.actual !== undefined ? update.actual : (update.$set && update.$set.actual !== undefined ? update.$set.actual : undefined);
62
+ }
63
+ // Middleware to track actual field updates
64
+ applicantExpenditureSchema.pre('save', function (next) {
65
+ if (this.isModified('actual')) {
66
+ this.isActualUpdated = true;
67
+ }
68
+ next();
69
+ });
70
+ // Middleware for update operations
71
+ applicantExpenditureSchema.pre('findOneAndUpdate', function (next) {
72
+ const update = this.getUpdate();
73
+ const newActualValue = extractActualValue(update);
74
+ if (newActualValue !== undefined) {
75
+ // Check if the application wants to skip isActualUpdated field update
76
+ const queryContext = this.getOptions();
77
+ const skipIsActualUpdateField = queryContext?.skipIsActualUpdateField;
78
+ if (skipIsActualUpdateField === true) {
79
+ // Application wants to skip updating isActualUpdated field
80
+ next();
81
+ }
82
+ else {
83
+ // We need to get the existing document to compare the new value with the current value
84
+ const query = this.getQuery();
85
+ // Find the current document to get the existing actual value
86
+ ApplicantExpenditureModel.findOne(query).then(existingDoc => {
87
+ if (existingDoc && existingDoc.actual !== newActualValue) {
88
+ // Values are different, so we'll set isActualUpdated in the post-hook
89
+ this._shouldSetActualUpdated = true;
90
+ }
91
+ next();
92
+ }).catch(err => {
93
+ next(err);
94
+ });
95
+ return; // Don't call next() here, we'll call it in the promise
96
+ }
97
+ }
98
+ else {
99
+ next();
100
+ }
101
+ });
102
+ applicantExpenditureSchema.pre('updateOne', function (next) {
103
+ const update = this.getUpdate();
104
+ const newActualValue = extractActualValue(update);
105
+ if (newActualValue !== undefined) {
106
+ this.set({ isActualUpdated: true });
107
+ }
108
+ next();
109
+ });
110
+ applicantExpenditureSchema.pre('updateMany', function (next) {
111
+ const update = this.getUpdate();
112
+ const newActualValue = extractActualValue(update);
113
+ if (newActualValue !== undefined) {
114
+ this.set({ isActualUpdated: true });
115
+ }
116
+ next();
117
+ });
118
+ // Post middleware for findOneAndUpdate to check if actual value actually changed
119
+ applicantExpenditureSchema.post('findOneAndUpdate', function (doc) {
120
+ if (doc && this._shouldSetActualUpdated === true) {
121
+ // The pre-hook determined that the actual value actually changed
122
+ doc.isActualUpdated = true;
123
+ doc.save(); // Save the updated flag
124
+ // Clean up the flag
125
+ delete this._shouldSetActualUpdated;
126
+ }
127
+ });
53
128
  // Virtual property for essentialExpenditure
54
129
  const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("ExpenditureType", {
55
130
  ref: "Lookup",
@@ -62,5 +137,7 @@ const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("Expendit
62
137
  });
63
138
  virtualEssentialExpenditure.description = "Populated lookup value for essential expenditure.";
64
139
  applyAuditMiddleware(applicantExpenditureSchema, "Applicant_Expenditure");
140
+ // Apply workflow plugin to the schema
141
+ applyWorkflowPlugin(applicantExpenditureSchema, 'applicant_expenditure');
65
142
  const ApplicantExpenditureModel = mongoose.model("Applicant_Expenditure", applicantExpenditureSchema);
66
143
  export default ApplicantExpenditureModel;