@planning-inspectorate/data-model 2.52.0 → 2.54.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 (35) hide show
  1. package/.azure/ci.yml +6 -6
  2. package/.azure/release.yml +2 -2
  3. package/docs/README.md +9 -5
  4. package/docs/appeal-document.md +1 -0
  5. package/docs/appeal-has.md +17 -15
  6. package/docs/appeal-s78.md +63 -19
  7. package/docs/applications-crowndev-application-defs-address.md +108 -0
  8. package/docs/applications-crowndev-application-defs-contact.md +99 -0
  9. package/docs/applications-crowndev-application-defs-organisation.md +117 -0
  10. package/docs/applications-crowndev-application-defs.md +3 -0
  11. package/docs/applications-crowndev-application.md +2257 -0
  12. package/docs/applications-notify-email-defs-contact.md +1 -0
  13. package/docs/applications-notify-email.md +1 -0
  14. package/docs/applications-representation-defs-contact.md +1 -0
  15. package/docs/applications-representation.md +5 -0
  16. package/package.json +1 -1
  17. package/pins_data_model/models/model_appeal_document.py +1 -0
  18. package/pins_data_model/models/model_appeal_has.py +2 -0
  19. package/pins_data_model/models/model_appeal_s78.py +118 -4
  20. package/pins_data_model/models/model_applications_crowndev_application.py +525 -0
  21. package/pins_data_model/models/model_applications_notify_email.py +1 -0
  22. package/pins_data_model/models/model_applications_representation.py +5 -0
  23. package/schemas/appeal-document.schema.json +1 -0
  24. package/schemas/appeal-has.schema.json +3 -1
  25. package/schemas/appeal-s78.schema.json +43 -1
  26. package/schemas/{applications-application.schema.json → applications-crowndev-application.schema.json} +11 -9
  27. package/schemas/applications-notify-email.schema.json +2 -2
  28. package/schemas/applications-representation.schema.json +6 -5
  29. package/src/enums.cjs +5 -0
  30. package/src/enums.d.ts +5 -0
  31. package/src/enums.js +5 -0
  32. package/src/index.cjs +5 -0
  33. package/src/schemas.d.ts +66 -47
  34. package/tests/appeals/appeal-has.test.js +41 -0
  35. package/tests/appeals/appeal-s78.test.js +41 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "applications-application.schema.json",
3
+ "$id": "applications-crowndev-application.schema.json",
4
4
  "title": "Crown Development Application",
5
5
  "description": "Main application details for Crown Development Project",
6
6
  "type": "object",
@@ -43,7 +43,7 @@
43
43
  "type": ["string", "null"],
44
44
  "description": "SubType applies to Planning permissions and LBC",
45
45
  "example": "Listed building consent (LBC)",
46
- "enum": ["Planning permission", "Listed building consent (LBC)"]
46
+ "enum": ["Planning permission", "Listed building consent (LBC)", null]
47
47
  },
48
48
  "linkedParentId": {
49
49
  "type": ["string", "null"],
@@ -132,7 +132,8 @@
132
132
  "Written representations",
133
133
  "Inquiry",
134
134
  "Hearing/Inquiry date set",
135
- "Final decision"
135
+ "Final decision",
136
+ null
136
137
  ]
137
138
  },
138
139
  "nationallyImportant": {
@@ -176,7 +177,8 @@
176
177
  "Relevant demolition",
177
178
  "Other",
178
179
  "Listed building consent to alter/extend",
179
- "Listed building consent to demolish"
180
+ "Listed building consent to demolish",
181
+ null
180
182
  ]
181
183
  },
182
184
  "isGreenBelt": {
@@ -273,7 +275,7 @@
273
275
  "decisionOutcome": {
274
276
  "type": ["string", "null"],
275
277
  "description": "As displayed to users",
276
- "enum": ["Approved", "Approved with conditions", "Refused", "Withdrawn"]
278
+ "enum": ["Approved", "Approved with conditions", "Refused", "Withdrawn", null]
277
279
  },
278
280
  "turnedAwayDate": {
279
281
  "type": ["string", "null"],
@@ -326,7 +328,7 @@
326
328
  "eiaScreeningOutcome": {
327
329
  "type": ["string", "null"],
328
330
  "description": "What was the outcome of the Environmental Impact Assessment",
329
- "enum": ["required", "not required"]
331
+ "enum": ["required", "not required", null]
330
332
  },
331
333
  "environmentalStatementReceivedDate": {
332
334
  "type": ["string", "null"],
@@ -340,7 +342,7 @@
340
342
  "procedure": {
341
343
  "type": ["string", "null"],
342
344
  "description": "Name displayed to users",
343
- "enum": ["Written Representations", "Hearing", "Inquiry"]
345
+ "enum": ["Written Representations", "Hearing", "Inquiry", null]
344
346
  },
345
347
  "procedureNotificationDate": {
346
348
  "type": ["string", "null"],
@@ -459,7 +461,7 @@
459
461
  "additionalProperties": true,
460
462
  "required": ["contactRoleType", "organisationId"],
461
463
  "properties": {
462
- "roleType": {
464
+ "contactRoleType": {
463
465
  "type": "string",
464
466
  "description": "Agent or Applicant details",
465
467
  "example": "agent",
@@ -501,7 +503,7 @@
501
503
  "contactPreference": {
502
504
  "type": ["string", "null"],
503
505
  "example": "email",
504
- "enum": ["email", "post"]
506
+ "enum": ["email", "post", null]
505
507
  },
506
508
  "writtenRepOrgName": {
507
509
  "type": ["string", "null"],
@@ -93,7 +93,7 @@
93
93
  "Contact": {
94
94
  "type": "object",
95
95
  "description": "Contact the email was sent to",
96
- "required": ["contactId", "addressId"],
96
+ "required": ["contactId"],
97
97
  "properties": {
98
98
  "contactId": {
99
99
  "type": "string",
@@ -102,7 +102,7 @@
102
102
  },
103
103
  "contactPreference": {
104
104
  "type": ["string", "null"],
105
- "enum": ["email", "post"],
105
+ "enum": ["email", "post", null],
106
106
  "description": "Preferred contact method",
107
107
  "example": "email"
108
108
  },
@@ -68,7 +68,7 @@
68
68
  "submittedReceivedMethod": {
69
69
  "type": ["string", "null"],
70
70
  "description": "How we received the representation",
71
- "enum": ["Online", "Phone", "Email", "Post", "In person"]
71
+ "enum": ["Online", "Phone", "Email", "Post", "In person", null]
72
72
  },
73
73
  "submissionMethodReason": {
74
74
  "type": ["string", "null"]
@@ -86,7 +86,8 @@
86
86
  "enum": [
87
87
  "A person",
88
88
  "An organisation or charity I work or volunteer for",
89
- "An organisation or charity I do not work or volunteer for"
89
+ "An organisation or charity I do not work or volunteer for",
90
+ null
90
91
  ]
91
92
  },
92
93
  "representedContact": {
@@ -98,7 +99,7 @@
98
99
  },
99
100
  "representedCategory": {
100
101
  "type": ["string", "null"],
101
- "enum": ["Consultees", "Interested party"]
102
+ "enum": ["Consultees", "Interested party", null]
102
103
  },
103
104
  "wantsToBeHeard": {
104
105
  "type": ["boolean", "null"],
@@ -124,7 +125,7 @@
124
125
  "withdrawalReason": {
125
126
  "type": ["string", "null"],
126
127
  "description": "Reason for the withdrawal",
127
- "enum": ["Change of opinion", "Mistaken Submission", "Misunderstanding", "Personal Reasons"]
128
+ "enum": ["Change of opinion", "Mistaken Submission", "Misunderstanding", "Personal Reasons", null]
128
129
  },
129
130
  "dateWithdrawn": {
130
131
  "type": ["string", "null"],
@@ -151,7 +152,7 @@
151
152
  "contactPreference": {
152
153
  "type": ["string", "null"],
153
154
  "example": "email",
154
- "enum": ["email", "post"]
155
+ "enum": ["email", "post", null]
155
156
  },
156
157
  "writtenRepOrgName": {
157
158
  "type": ["string", "null"]
package/src/enums.cjs CHANGED
@@ -19,11 +19,13 @@ const APPEAL_HAS_CASE_STATUS = Object.freeze({
19
19
  AWAITING_EVENT: 'awaiting_event',
20
20
  AWAITING_TRANSFER: 'awaiting_transfer',
21
21
  CLOSED: 'closed',
22
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
22
23
  COMPLETE: 'complete',
23
24
  EVENT: 'event',
24
25
  INVALID: 'invalid',
25
26
  ISSUE_DETERMINATION: 'issue_determination',
26
27
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
28
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
27
29
  READY_TO_START: 'ready_to_start',
28
30
  TRANSFERRED: 'transferred',
29
31
  VALIDATION: 'validation',
@@ -122,6 +124,7 @@ const APPEAL_CASE_STATUS = Object.freeze({
122
124
  AWAITING_EVENT: 'awaiting_event',
123
125
  AWAITING_TRANSFER: 'awaiting_transfer',
124
126
  CLOSED: 'closed',
127
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
125
128
  COMPLETE: 'complete',
126
129
  EVENT: 'event',
127
130
  EVIDENCE: 'evidence',
@@ -129,6 +132,7 @@ const APPEAL_CASE_STATUS = Object.freeze({
129
132
  INVALID: 'invalid',
130
133
  ISSUE_DETERMINATION: 'issue_determination',
131
134
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
135
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
132
136
  READY_TO_START: 'ready_to_start',
133
137
  STATEMENTS: 'statements',
134
138
  TRANSFERRED: 'transferred',
@@ -258,6 +262,7 @@ const APPEAL_DOCUMENT_TYPE = Object.freeze({
258
262
  LPA_WITNESSES_EVIDENCE: 'lpaWitnessesEvidence',
259
263
  MAIN_PARTY_CORRESPONDENCE: 'mainPartyCorrespondence',
260
264
  NEW_PLANS_DRAWINGS: 'newPlansDrawings',
265
+ NOTICE_WITHDRAWAL: 'noticeWithdrawal',
261
266
  ORIGINAL_APPLICATION_FORM: 'originalApplicationForm',
262
267
  OTHER_NEW_DOCUMENTS: 'otherNewDocuments',
263
268
  OTHER_PARTY_REPRESENTATIONS: 'otherPartyRepresentations',
package/src/enums.d.ts CHANGED
@@ -17,11 +17,13 @@ export const APPEAL_HAS_CASE_STATUS = {
17
17
  AWAITING_EVENT: 'awaiting_event',
18
18
  AWAITING_TRANSFER: 'awaiting_transfer',
19
19
  CLOSED: 'closed',
20
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
20
21
  COMPLETE: 'complete',
21
22
  EVENT: 'event',
22
23
  INVALID: 'invalid',
23
24
  ISSUE_DETERMINATION: 'issue_determination',
24
25
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
26
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
25
27
  READY_TO_START: 'ready_to_start',
26
28
  TRANSFERRED: 'transferred',
27
29
  VALIDATION: 'validation',
@@ -120,6 +122,7 @@ export const APPEAL_CASE_STATUS = {
120
122
  AWAITING_EVENT: 'awaiting_event',
121
123
  AWAITING_TRANSFER: 'awaiting_transfer',
122
124
  CLOSED: 'closed',
125
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
123
126
  COMPLETE: 'complete',
124
127
  EVENT: 'event',
125
128
  EVIDENCE: 'evidence',
@@ -127,6 +130,7 @@ export const APPEAL_CASE_STATUS = {
127
130
  INVALID: 'invalid',
128
131
  ISSUE_DETERMINATION: 'issue_determination',
129
132
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
133
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
130
134
  READY_TO_START: 'ready_to_start',
131
135
  STATEMENTS: 'statements',
132
136
  TRANSFERRED: 'transferred',
@@ -256,6 +260,7 @@ export const APPEAL_DOCUMENT_TYPE = {
256
260
  LPA_WITNESSES_EVIDENCE: 'lpaWitnessesEvidence',
257
261
  MAIN_PARTY_CORRESPONDENCE: 'mainPartyCorrespondence',
258
262
  NEW_PLANS_DRAWINGS: 'newPlansDrawings',
263
+ NOTICE_WITHDRAWAL: 'noticeWithdrawal',
259
264
  ORIGINAL_APPLICATION_FORM: 'originalApplicationForm',
260
265
  OTHER_NEW_DOCUMENTS: 'otherNewDocuments',
261
266
  OTHER_PARTY_REPRESENTATIONS: 'otherPartyRepresentations',
package/src/enums.js CHANGED
@@ -17,11 +17,13 @@ export const APPEAL_HAS_CASE_STATUS = Object.freeze({
17
17
  AWAITING_EVENT: 'awaiting_event',
18
18
  AWAITING_TRANSFER: 'awaiting_transfer',
19
19
  CLOSED: 'closed',
20
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
20
21
  COMPLETE: 'complete',
21
22
  EVENT: 'event',
22
23
  INVALID: 'invalid',
23
24
  ISSUE_DETERMINATION: 'issue_determination',
24
25
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
26
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
25
27
  READY_TO_START: 'ready_to_start',
26
28
  TRANSFERRED: 'transferred',
27
29
  VALIDATION: 'validation',
@@ -120,6 +122,7 @@ export const APPEAL_CASE_STATUS = Object.freeze({
120
122
  AWAITING_EVENT: 'awaiting_event',
121
123
  AWAITING_TRANSFER: 'awaiting_transfer',
122
124
  CLOSED: 'closed',
125
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
123
126
  COMPLETE: 'complete',
124
127
  EVENT: 'event',
125
128
  EVIDENCE: 'evidence',
@@ -127,6 +130,7 @@ export const APPEAL_CASE_STATUS = Object.freeze({
127
130
  INVALID: 'invalid',
128
131
  ISSUE_DETERMINATION: 'issue_determination',
129
132
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
133
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
130
134
  READY_TO_START: 'ready_to_start',
131
135
  STATEMENTS: 'statements',
132
136
  TRANSFERRED: 'transferred',
@@ -256,6 +260,7 @@ export const APPEAL_DOCUMENT_TYPE = Object.freeze({
256
260
  LPA_WITNESSES_EVIDENCE: 'lpaWitnessesEvidence',
257
261
  MAIN_PARTY_CORRESPONDENCE: 'mainPartyCorrespondence',
258
262
  NEW_PLANS_DRAWINGS: 'newPlansDrawings',
263
+ NOTICE_WITHDRAWAL: 'noticeWithdrawal',
259
264
  ORIGINAL_APPLICATION_FORM: 'originalApplicationForm',
260
265
  OTHER_NEW_DOCUMENTS: 'otherNewDocuments',
261
266
  OTHER_PARTY_REPRESENTATIONS: 'otherPartyRepresentations',
package/src/index.cjs CHANGED
@@ -100,11 +100,13 @@ const APPEAL_HAS_CASE_STATUS = Object.freeze({
100
100
  AWAITING_EVENT: 'awaiting_event',
101
101
  AWAITING_TRANSFER: 'awaiting_transfer',
102
102
  CLOSED: 'closed',
103
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
103
104
  COMPLETE: 'complete',
104
105
  EVENT: 'event',
105
106
  INVALID: 'invalid',
106
107
  ISSUE_DETERMINATION: 'issue_determination',
107
108
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
109
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
108
110
  READY_TO_START: 'ready_to_start',
109
111
  TRANSFERRED: 'transferred',
110
112
  VALIDATION: 'validation',
@@ -203,6 +205,7 @@ const APPEAL_CASE_STATUS = Object.freeze({
203
205
  AWAITING_EVENT: 'awaiting_event',
204
206
  AWAITING_TRANSFER: 'awaiting_transfer',
205
207
  CLOSED: 'closed',
208
+ CLOSED_OPENED_IN_ERROR: 'closed_opened_in_error',
206
209
  COMPLETE: 'complete',
207
210
  EVENT: 'event',
208
211
  EVIDENCE: 'evidence',
@@ -210,6 +213,7 @@ const APPEAL_CASE_STATUS = Object.freeze({
210
213
  INVALID: 'invalid',
211
214
  ISSUE_DETERMINATION: 'issue_determination',
212
215
  LPA_QUESTIONNAIRE: 'lpa_questionnaire',
216
+ NOTICE_WITHDRAWN: 'notice_withdrawn',
213
217
  READY_TO_START: 'ready_to_start',
214
218
  STATEMENTS: 'statements',
215
219
  TRANSFERRED: 'transferred',
@@ -339,6 +343,7 @@ const APPEAL_DOCUMENT_TYPE = Object.freeze({
339
343
  LPA_WITNESSES_EVIDENCE: 'lpaWitnessesEvidence',
340
344
  MAIN_PARTY_CORRESPONDENCE: 'mainPartyCorrespondence',
341
345
  NEW_PLANS_DRAWINGS: 'newPlansDrawings',
346
+ NOTICE_WITHDRAWAL: 'noticeWithdrawal',
342
347
  ORIGINAL_APPLICATION_FORM: 'originalApplicationForm',
343
348
  OTHER_NEW_DOCUMENTS: 'otherNewDocuments',
344
349
  OTHER_PARTY_REPRESENTATIONS: 'otherPartyRepresentations',
package/src/schemas.d.ts CHANGED
@@ -232,6 +232,7 @@ export interface AppealDocument {
232
232
  | 'hearingProcess'
233
233
  | 'inquiryCore'
234
234
  | 'inquiryPostEvent'
235
+ | 'noticeWithdrawal'
235
236
  | null;
236
237
  /**
237
238
  * The system mastering the metadata for the current document
@@ -421,7 +422,9 @@ export type AppealHASCase = (GridReference | SiteAddress) & {
421
422
  | 'awaiting_transfer'
422
423
  | 'transferred'
423
424
  | 'event'
424
- | 'awaiting_event';
425
+ | 'awaiting_event'
426
+ | 'notice_withdrawn'
427
+ | 'closed_opened_in_error';
425
428
  /**
426
429
  * The internal code for an appeal type, e.g. D (Householder)
427
430
  */
@@ -1049,7 +1052,9 @@ export type AppealS78Case = (GridReference | SiteAddress) & {
1049
1052
  | 'awaiting_transfer'
1050
1053
  | 'transferred'
1051
1054
  | 'event'
1052
- | 'awaiting_event';
1055
+ | 'awaiting_event'
1056
+ | 'notice_withdrawn'
1057
+ | 'closed_opened_in_error';
1053
1058
  /**
1054
1059
  * The internal code for an appeal type, e.g. D (Householder)
1055
1060
  */
@@ -1701,6 +1706,26 @@ export type AppealS78Case = (GridReference | SiteAddress) & {
1701
1706
  [k: string]: unknown;
1702
1707
  }[]
1703
1708
  | null;
1709
+ /**
1710
+ * Case Officer list of grounds for the appeal & start dates. Enforcement cases (C) can have grounds (a) to (g)
1711
+ */
1712
+ enforcementCaseGroundsOfAppeal?:
1713
+ | {
1714
+ appealGroundLetter?: 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | null;
1715
+ groundForAppealStartDate?: string | null;
1716
+ [k: string]: unknown;
1717
+ }[]
1718
+ | null;
1719
+ /**
1720
+ * Case Officer list of grounds for the appeal & start dates. Enforcement cases (C) can have grounds (a) to (g)
1721
+ */
1722
+ elbCaseGroundsOfAppeal?:
1723
+ | {
1724
+ appealGroundLetter?: 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | null;
1725
+ groundForAppealStartDate?: string | null;
1726
+ [k: string]: unknown;
1727
+ }[]
1728
+ | null;
1704
1729
  /**
1705
1730
  * Was an application made and paid for
1706
1731
  */
@@ -1888,7 +1913,7 @@ export interface CrownDevelopmentApplication {
1888
1913
  /**
1889
1914
  * SubType applies to Planning permissions and LBC
1890
1915
  */
1891
- subType?: ('Planning permission' | 'Listed building consent (LBC)') | null;
1916
+ subType?: 'Planning permission' | 'Listed building consent (LBC)' | null;
1892
1917
  /**
1893
1918
  * Self-referencial for parent to children relationship
1894
1919
  */
@@ -1955,15 +1980,13 @@ export interface CrownDevelopmentApplication {
1955
1980
  * Current stage of the case (enum)
1956
1981
  */
1957
1982
  applicationStage?:
1958
- | (
1959
- | 'Accepted'
1960
- | 'Consultation'
1961
- | 'Procedure choice'
1962
- | 'Written representations'
1963
- | 'Inquiry'
1964
- | 'Hearing/Inquiry date set'
1965
- | 'Final decision'
1966
- )
1983
+ | 'Accepted'
1984
+ | 'Consultation'
1985
+ | 'Procedure choice'
1986
+ | 'Written representations'
1987
+ | 'Inquiry'
1988
+ | 'Hearing/Inquiry date set'
1989
+ | 'Final decision'
1967
1990
  | null;
1968
1991
  /**
1969
1992
  * Site is nationally important (Yes/No)
@@ -1989,25 +2012,23 @@ export interface CrownDevelopmentApplication {
1989
2012
  * Application category (enum)
1990
2013
  */
1991
2014
  category?:
1992
- | (
1993
- | 'Major Development'
1994
- | 'Buildings over 1000 square metres'
1995
- | 'Development of a site above 1 hectare'
1996
- | 'Dwellings numbering 10 or more'
1997
- | 'Dwellings of 0.5 hectare or more'
1998
- | 'Minerals'
1999
- | 'Waste'
2000
- | 'Non-Major Development'
2001
- | 'Buildings less than 1000 square metres'
2002
- | 'Development of a site less than 1 hectare'
2003
- | 'Dwellings numbering between 1 and 9'
2004
- | 'Dwellings of less than 0.5 hectare'
2005
- | 'Change of use'
2006
- | 'Relevant demolition'
2007
- | 'Other'
2008
- | 'Listed building consent to alter/extend'
2009
- | 'Listed building consent to demolish'
2010
- )
2015
+ | 'Major Development'
2016
+ | 'Buildings over 1000 square metres'
2017
+ | 'Development of a site above 1 hectare'
2018
+ | 'Dwellings numbering 10 or more'
2019
+ | 'Dwellings of 0.5 hectare or more'
2020
+ | 'Minerals'
2021
+ | 'Waste'
2022
+ | 'Non-Major Development'
2023
+ | 'Buildings less than 1000 square metres'
2024
+ | 'Development of a site less than 1 hectare'
2025
+ | 'Dwellings numbering between 1 and 9'
2026
+ | 'Dwellings of less than 0.5 hectare'
2027
+ | 'Change of use'
2028
+ | 'Relevant demolition'
2029
+ | 'Other'
2030
+ | 'Listed building consent to alter/extend'
2031
+ | 'Listed building consent to demolish'
2011
2032
  | null;
2012
2033
  /**
2013
2034
  * Is the site in green belt land
@@ -2088,7 +2109,7 @@ export interface CrownDevelopmentApplication {
2088
2109
  /**
2089
2110
  * As displayed to users
2090
2111
  */
2091
- decisionOutcome?: ('Approved' | 'Approved with conditions' | 'Refused' | 'Withdrawn') | null;
2112
+ decisionOutcome?: 'Approved' | 'Approved with conditions' | 'Refused' | 'Withdrawn' | null;
2092
2113
  /**
2093
2114
  * Date application was turned away
2094
2115
  */
@@ -2136,7 +2157,7 @@ export interface CrownDevelopmentApplication {
2136
2157
  /**
2137
2158
  * What was the outcome of the Environmental Impact Assessment
2138
2159
  */
2139
- eiaScreeningOutcome?: ('required' | 'not required') | null;
2160
+ eiaScreeningOutcome?: 'required' | 'not required' | null;
2140
2161
  /**
2141
2162
  * Date the environmental statement was received
2142
2163
  */
@@ -2148,7 +2169,7 @@ export interface CrownDevelopmentApplication {
2148
2169
  /**
2149
2170
  * Name displayed to users
2150
2171
  */
2151
- procedure?: ('Written Representations' | 'Hearing' | 'Inquiry') | null;
2172
+ procedure?: 'Written Representations' | 'Hearing' | 'Inquiry' | null;
2152
2173
  procedureNotificationDate?: string | null;
2153
2174
  eventDate?: string | null;
2154
2175
  eventPrepDuration?: number | null;
@@ -2227,7 +2248,7 @@ export interface Organisation {
2227
2248
  /**
2228
2249
  * Agent or Applicant details
2229
2250
  */
2230
- roleType?: 'agent' | 'applicant';
2251
+ contactRoleType: 'agent' | 'applicant';
2231
2252
  /**
2232
2253
  * Source PK for Organisation
2233
2254
  */
@@ -2253,7 +2274,7 @@ export interface Contact {
2253
2274
  * Source PK for Contact
2254
2275
  */
2255
2276
  contactId: string;
2256
- contactPreference?: ('email' | 'post') | null;
2277
+ contactPreference?: 'email' | 'post' | null;
2257
2278
  /**
2258
2279
  * Organisation Name used for written-representation on behalf of an organisation
2259
2280
  */
@@ -2350,7 +2371,7 @@ export interface Contact {
2350
2371
  /**
2351
2372
  * Preferred contact method
2352
2373
  */
2353
- contactPreference?: ('email' | 'post') | null;
2374
+ contactPreference?: 'email' | 'post' | null;
2354
2375
  writtenRepOrgName?: string | null;
2355
2376
  writtenRepJobTitleorRole?: string | null;
2356
2377
  }
@@ -2388,7 +2409,7 @@ export interface CaseworkRepresentationSchema {
2388
2409
  /**
2389
2410
  * How we received the representation
2390
2411
  */
2391
- submittedReceivedMethod?: ('Online' | 'Phone' | 'Email' | 'Post' | 'In person') | null;
2412
+ submittedReceivedMethod?: 'Online' | 'Phone' | 'Email' | 'Post' | 'In person' | null;
2392
2413
  submissionMethodReason?: string | null;
2393
2414
  comment: string;
2394
2415
  /**
@@ -2399,17 +2420,15 @@ export interface CaseworkRepresentationSchema {
2399
2420
  * When representation is on behalf of a person/org/group
2400
2421
  */
2401
2422
  representedType?:
2402
- | (
2403
- | 'A person'
2404
- | 'An organisation or charity I work or volunteer for'
2405
- | 'An organisation or charity I do not work or volunteer for'
2406
- )
2423
+ | 'A person'
2424
+ | 'An organisation or charity I work or volunteer for'
2425
+ | 'An organisation or charity I do not work or volunteer for'
2407
2426
  | null;
2408
2427
  /**
2409
2428
  * When representation is on behalf of a person/org/group
2410
2429
  */
2411
2430
  representedContact?: Contact[] | null;
2412
- representedCategory?: ('Consultees' | 'Interested party') | null;
2431
+ representedCategory?: 'Consultees' | 'Interested party' | null;
2413
2432
  /**
2414
2433
  * Internal: wants to be heard at a hearing
2415
2434
  */
@@ -2433,7 +2452,7 @@ export interface CaseworkRepresentationSchema {
2433
2452
  /**
2434
2453
  * Reason for the withdrawal
2435
2454
  */
2436
- withdrawalReason?: ('Change of opinion' | 'Mistaken Submission' | 'Misunderstanding' | 'Personal Reasons') | null;
2455
+ withdrawalReason?: 'Change of opinion' | 'Mistaken Submission' | 'Misunderstanding' | 'Personal Reasons' | null;
2437
2456
  /**
2438
2457
  * Date the representation was withdrawn
2439
2458
  */
@@ -2446,7 +2465,7 @@ export interface Contact {
2446
2465
  * Source PK for Contact
2447
2466
  */
2448
2467
  contactId: string;
2449
- contactPreference?: ('email' | 'post') | null;
2468
+ contactPreference?: 'email' | 'post' | null;
2450
2469
  writtenRepOrgName?: string | null;
2451
2470
  writtenRepJobTitleorRole?: string | null;
2452
2471
  }
@@ -5885,7 +5904,7 @@ export type SchemaMap = {
5885
5904
  'appeal-representation.schema.json': AppealRepresentation;
5886
5905
  'appeal-s78.schema.json': AppealS78Case;
5887
5906
  'applications-application-update.schema.json': ApplicationUpdateSchema;
5888
- 'applications-application.schema.json': CrownDevelopmentApplication;
5907
+ 'applications-crowndev-application.schema.json': CrownDevelopmentApplication;
5889
5908
  'applications-notify-email.schema.json': EmailNotificationRecordSchema;
5890
5909
  'applications-representation.schema.json': CaseworkRepresentationSchema;
5891
5910
  'dart-response.schema.json': DaRTAPIResponse;
@@ -363,4 +363,45 @@ describe(schema, () => {
363
363
  assert.strictEqual(validationResult, false, 'Expected invalid caseProcedure value to fail validation');
364
364
  });
365
365
  });
366
+
367
+ describe('caseStatus schema validation (Group A - HAS)', () => {
368
+ it('should accept caseStatus values', () => {
369
+ for (const status of [
370
+ 'assign_case_officer',
371
+ 'validation',
372
+ 'ready_to_start',
373
+ 'lpa_questionnaire',
374
+ 'issue_determination',
375
+ 'complete',
376
+ 'invalid',
377
+ 'closed',
378
+ 'withdrawn',
379
+ 'awaiting_transfer',
380
+ 'transferred',
381
+ 'event',
382
+ 'awaiting_event',
383
+ 'notice_withdrawn',
384
+ 'closed_opened_in_error'
385
+ ]) {
386
+ const test = structuredClone(appealHas);
387
+ test.caseStatus = status;
388
+ const validationResult = ajv.validate(schema, test);
389
+ assert.strictEqual(validationResult, true, `Expected caseStatus "${status}" to be valid`);
390
+ }
391
+ });
392
+
393
+ it('should not accept null value for caseStatus', () => {
394
+ const test = structuredClone(appealHas);
395
+ test.caseStatus = null;
396
+ const validationResult = ajv.validate(schema, test);
397
+ assert.strictEqual(validationResult, false, 'Expected caseStatus null not to be valid');
398
+ });
399
+
400
+ it('should reject invalid caseStatus values', () => {
401
+ const test = structuredClone(appealHas);
402
+ test.caseStatus = 'invalid_status';
403
+ const validationResult = ajv.validate(schema, test);
404
+ assert.strictEqual(validationResult, false, 'Expected invalid caseStatus value to fail validation');
405
+ });
406
+ });
366
407
  });
@@ -283,4 +283,45 @@ describe(schema, () => {
283
283
  const validationResult = ajv.validate(schema, test);
284
284
  assert.strictEqual(validationResult, true);
285
285
  });
286
+
287
+ describe('caseStatus schema validation (Group B)', () => {
288
+ it('should accept caseStatus values', () => {
289
+ for (const status of [
290
+ 'assign_case_officer',
291
+ 'validation',
292
+ 'ready_to_start',
293
+ 'lpa_questionnaire',
294
+ 'issue_determination',
295
+ 'complete',
296
+ 'invalid',
297
+ 'closed',
298
+ 'withdrawn',
299
+ 'awaiting_transfer',
300
+ 'transferred',
301
+ 'event',
302
+ 'awaiting_event',
303
+ 'notice_withdrawn',
304
+ 'closed_opened_in_error'
305
+ ]) {
306
+ const test = structuredClone(appealS78);
307
+ test.caseStatus = status;
308
+ const validationResult = ajv.validate(schema, test);
309
+ assert.strictEqual(validationResult, true, `Expected caseStatus "${status}" to be valid`);
310
+ }
311
+ });
312
+
313
+ it('should not accept null value for caseStatus', () => {
314
+ const test = structuredClone(appealS78);
315
+ test.caseStatus = null;
316
+ const validationResult = ajv.validate(schema, test);
317
+ assert.strictEqual(validationResult, false, 'Expected caseStatus null not to be valid');
318
+ });
319
+
320
+ it('should reject invalid caseStatus values', () => {
321
+ const test = structuredClone(appealS78);
322
+ test.caseStatus = 'invalid_status';
323
+ const validationResult = ajv.validate(schema, test);
324
+ assert.strictEqual(validationResult, false, 'Expected invalid caseStatus value to fail validation');
325
+ });
326
+ });
286
327
  });