@planning-inspectorate/data-model 2.57.0 → 2.58.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.
@@ -465,24 +465,29 @@ The internal code for an appeal type, e.g. Householder (D)
465
465
 
466
466
  **enum**: the value of this property must be equal to one of the following values:
467
467
 
468
- | Value | Explanation |
469
- | :----- | :---------- |
470
- | `"C"` | |
471
- | `"D"` | |
472
- | `"F"` | |
473
- | `"G"` | |
474
- | `"H"` | |
475
- | `"L"` | |
476
- | `"Q"` | |
477
- | `"S"` | |
478
- | `"V"` | |
479
- | `"W"` | |
480
- | `"X"` | |
481
- | `"Y"` | |
482
- | `"Z"` | |
483
- | `"ZA"` | |
484
- | `"ZP"` | |
485
- | `null` | |
468
+ | Value | Explanation |
469
+ | :------ | :---------- |
470
+ | `"C"` | |
471
+ | `"D"` | |
472
+ | `"F"` | |
473
+ | `"G"` | |
474
+ | `"H"` | |
475
+ | `"L"` | |
476
+ | `"Q"` | |
477
+ | `"S"` | |
478
+ | `"V"` | |
479
+ | `"W"` | |
480
+ | `"X"` | |
481
+ | `"Y"` | |
482
+ | `"Z"` | |
483
+ | `"ZA"` | |
484
+ | `"ZP"` | |
485
+ | `"TPO"` | |
486
+ | `"TRN"` | |
487
+ | `"HH"` | |
488
+ | `"HR"` | |
489
+ | `"ENV"` | |
490
+ | `null` | |
486
491
 
487
492
  ## redactedStatus
488
493
 
@@ -116,7 +116,7 @@ External case identifier for Group C appeals (7 digit number starting in 6)
116
116
 
117
117
  ## caseType
118
118
 
119
- The internal letter code for an appeal type, e.g. W (Environmental)
119
+ Internal letter code for appeal types
120
120
 
121
121
  `caseType`
122
122
 
@@ -136,23 +136,28 @@ The internal letter code for an appeal type, e.g. W (Environmental)
136
136
 
137
137
  **enum**: the value of this property must be equal to one of the following values:
138
138
 
139
- | Value | Explanation |
140
- | :----- | :---------- |
141
- | `"C"` | |
142
- | `"D"` | |
143
- | `"F"` | |
144
- | `"G"` | |
145
- | `"H"` | |
146
- | `"L"` | |
147
- | `"Q"` | |
148
- | `"S"` | |
149
- | `"V"` | |
150
- | `"W"` | |
151
- | `"X"` | |
152
- | `"Y"` | |
153
- | `"Z"` | |
154
- | `"ZA"` | |
155
- | `"ZP"` | |
139
+ | Value | Explanation |
140
+ | :------ | :---------- |
141
+ | `"C"` | |
142
+ | `"D"` | |
143
+ | `"F"` | |
144
+ | `"G"` | |
145
+ | `"H"` | |
146
+ | `"L"` | |
147
+ | `"Q"` | |
148
+ | `"S"` | |
149
+ | `"V"` | |
150
+ | `"W"` | |
151
+ | `"X"` | |
152
+ | `"Y"` | |
153
+ | `"Z"` | |
154
+ | `"ZA"` | |
155
+ | `"ZP"` | |
156
+ | `"TPO"` | |
157
+ | `"TRN"` | |
158
+ | `"HH"` | |
159
+ | `"HR"` | |
160
+ | `"ENV"` | |
156
161
 
157
162
  ## caseStatus
158
163
 
@@ -261,23 +261,28 @@ The internal code for an appeal type, e.g. D (Householder)
261
261
 
262
262
  **enum**: the value of this property must be equal to one of the following values:
263
263
 
264
- | Value | Explanation |
265
- | :----- | :---------- |
266
- | `"C"` | |
267
- | `"D"` | |
268
- | `"F"` | |
269
- | `"G"` | |
270
- | `"H"` | |
271
- | `"L"` | |
272
- | `"Q"` | |
273
- | `"S"` | |
274
- | `"V"` | |
275
- | `"W"` | |
276
- | `"X"` | |
277
- | `"Y"` | |
278
- | `"Z"` | |
279
- | `"ZA"` | |
280
- | `"ZP"` | |
264
+ | Value | Explanation |
265
+ | :------ | :---------- |
266
+ | `"C"` | |
267
+ | `"D"` | |
268
+ | `"F"` | |
269
+ | `"G"` | |
270
+ | `"H"` | |
271
+ | `"L"` | |
272
+ | `"Q"` | |
273
+ | `"S"` | |
274
+ | `"V"` | |
275
+ | `"W"` | |
276
+ | `"X"` | |
277
+ | `"Y"` | |
278
+ | `"Z"` | |
279
+ | `"ZA"` | |
280
+ | `"ZP"` | |
281
+ | `"TPO"` | |
282
+ | `"TRN"` | |
283
+ | `"HH"` | |
284
+ | `"HR"` | |
285
+ | `"ENV"` | |
281
286
 
282
287
  ## caseProcedure
283
288
 
@@ -364,23 +364,28 @@ The internal code for an appeal type, e.g. D (Householder)
364
364
 
365
365
  **enum**: the value of this property must be equal to one of the following values:
366
366
 
367
- | Value | Explanation |
368
- | :----- | :---------- |
369
- | `"C"` | |
370
- | `"D"` | |
371
- | `"F"` | |
372
- | `"G"` | |
373
- | `"H"` | |
374
- | `"L"` | |
375
- | `"Q"` | |
376
- | `"S"` | |
377
- | `"V"` | |
378
- | `"W"` | |
379
- | `"X"` | |
380
- | `"Y"` | |
381
- | `"Z"` | |
382
- | `"ZA"` | |
383
- | `"ZP"` | |
367
+ | Value | Explanation |
368
+ | :------ | :---------- |
369
+ | `"C"` | |
370
+ | `"D"` | |
371
+ | `"F"` | |
372
+ | `"G"` | |
373
+ | `"H"` | |
374
+ | `"L"` | |
375
+ | `"Q"` | |
376
+ | `"S"` | |
377
+ | `"V"` | |
378
+ | `"W"` | |
379
+ | `"X"` | |
380
+ | `"Y"` | |
381
+ | `"Z"` | |
382
+ | `"ZA"` | |
383
+ | `"ZP"` | |
384
+ | `"TPO"` | |
385
+ | `"TRN"` | |
386
+ | `"HH"` | |
387
+ | `"HR"` | |
388
+ | `"ENV"` | |
384
389
 
385
390
  ## caseProcedure
386
391
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/data-model",
3
- "version": "2.57.0",
3
+ "version": "2.58.0",
4
4
  "description": "JSON Schemas for the Planning Inspectorate's Data Model",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -39,6 +39,11 @@ class CaseType(Enum):
39
39
  Z = "Z"
40
40
  ZA = "ZA"
41
41
  ZP = "ZP"
42
+ TPO = "TPO"
43
+ TRN = "TRN"
44
+ HH = "HH"
45
+ HR = "HR"
46
+ ENV = "ENV"
42
47
  NoneType_None = None
43
48
 
44
49
 
@@ -10,7 +10,7 @@ from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, constr
10
10
 
11
11
  class CaseType(StrEnum):
12
12
  """
13
- The internal letter code for an appeal type, e.g. W (Environmental)
13
+ Internal letter code for appeal types
14
14
  """
15
15
 
16
16
  C = "C"
@@ -28,6 +28,11 @@ class CaseType(StrEnum):
28
28
  Z = "Z"
29
29
  ZA = "ZA"
30
30
  ZP = "ZP"
31
+ TPO = "TPO"
32
+ TRN = "TRN"
33
+ HH = "HH"
34
+ HR = "HR"
35
+ ENV = "ENV"
31
36
 
32
37
 
33
38
  class CaseStatus(StrEnum):
@@ -229,7 +234,7 @@ class AppealGroupCCase(BaseModel):
229
234
  """
230
235
  caseType: CaseType
231
236
  """
232
- The internal letter code for an appeal type, e.g. W (Environmental)
237
+ Internal letter code for appeal types
233
238
  """
234
239
  caseStatus: CaseStatus
235
240
  """
@@ -51,6 +51,11 @@ class CaseType(StrEnum):
51
51
  Z = "Z"
52
52
  ZA = "ZA"
53
53
  ZP = "ZP"
54
+ TPO = "TPO"
55
+ TRN = "TRN"
56
+ HH = "HH"
57
+ HR = "HR"
58
+ ENV = "ENV"
54
59
 
55
60
 
56
61
  class CaseProcedure(Enum):
@@ -55,6 +55,11 @@ class CaseType(StrEnum):
55
55
  Z = "Z"
56
56
  ZA = "ZA"
57
57
  ZP = "ZP"
58
+ TPO = "TPO"
59
+ TRN = "TRN"
60
+ HH = "HH"
61
+ HR = "HR"
62
+ ENV = "ENV"
58
63
 
59
64
 
60
65
  class CaseProcedure(Enum):
@@ -126,7 +126,29 @@
126
126
  },
127
127
  "caseType": {
128
128
  "type": ["string", "null"],
129
- "enum": ["C", "D", "F", "G", "H", "L", "Q", "S", "V", "W", "X", "Y", "Z", "ZA", "ZP", null],
129
+ "enum": [
130
+ "C",
131
+ "D",
132
+ "F",
133
+ "G",
134
+ "H",
135
+ "L",
136
+ "Q",
137
+ "S",
138
+ "V",
139
+ "W",
140
+ "X",
141
+ "Y",
142
+ "Z",
143
+ "ZA",
144
+ "ZP",
145
+ "TPO",
146
+ "TRN",
147
+ "HH",
148
+ "HR",
149
+ "ENV",
150
+ null
151
+ ],
130
152
  "description": "The internal code for an appeal type, e.g. Householder (D)"
131
153
  },
132
154
  "redactedStatus": {
@@ -55,8 +55,29 @@
55
55
  },
56
56
  "caseType": {
57
57
  "type": "string",
58
- "enum": ["C", "D", "F", "G", "H", "L", "Q", "S", "V", "W", "X", "Y", "Z", "ZA", "ZP"],
59
- "description": "The internal letter code for an appeal type, e.g. W (Environmental)"
58
+ "enum": [
59
+ "C",
60
+ "D",
61
+ "F",
62
+ "G",
63
+ "H",
64
+ "L",
65
+ "Q",
66
+ "S",
67
+ "V",
68
+ "W",
69
+ "X",
70
+ "Y",
71
+ "Z",
72
+ "ZA",
73
+ "ZP",
74
+ "TPO",
75
+ "TRN",
76
+ "HH",
77
+ "HR",
78
+ "ENV"
79
+ ],
80
+ "description": "Internal letter code for appeal types"
60
81
  },
61
82
  "caseStatus": {
62
83
  "type": "string",
@@ -133,7 +133,28 @@
133
133
  },
134
134
  "caseType": {
135
135
  "type": "string",
136
- "enum": ["C", "D", "F", "G", "H", "L", "Q", "S", "V", "W", "X", "Y", "Z", "ZA", "ZP"],
136
+ "enum": [
137
+ "C",
138
+ "D",
139
+ "F",
140
+ "G",
141
+ "H",
142
+ "L",
143
+ "Q",
144
+ "S",
145
+ "V",
146
+ "W",
147
+ "X",
148
+ "Y",
149
+ "Z",
150
+ "ZA",
151
+ "ZP",
152
+ "TPO",
153
+ "TRN",
154
+ "HH",
155
+ "HR",
156
+ "ENV"
157
+ ],
137
158
  "description": "The internal code for an appeal type, e.g. D (Householder)"
138
159
  },
139
160
  "caseProcedure": {
@@ -205,7 +205,28 @@
205
205
  },
206
206
  "caseType": {
207
207
  "type": "string",
208
- "enum": ["C", "D", "F", "G", "H", "L", "Q", "S", "V", "W", "X", "Y", "Z", "ZA", "ZP"],
208
+ "enum": [
209
+ "C",
210
+ "D",
211
+ "F",
212
+ "G",
213
+ "H",
214
+ "L",
215
+ "Q",
216
+ "S",
217
+ "V",
218
+ "W",
219
+ "X",
220
+ "Y",
221
+ "Z",
222
+ "ZA",
223
+ "ZP",
224
+ "TPO",
225
+ "TRN",
226
+ "HH",
227
+ "HR",
228
+ "ENV"
229
+ ],
209
230
  "description": "The internal code for an appeal type, e.g. D (Householder)",
210
231
  "$comment": "Also available on HAS cases"
211
232
  },
package/src/enums.cjs CHANGED
@@ -159,12 +159,17 @@ const APPEAL_CASE_SUB_TYPE = Object.freeze({
159
159
  const APPEAL_CASE_TYPE = Object.freeze({
160
160
  C: 'C',
161
161
  D: 'D',
162
+ ENV: 'ENV',
162
163
  F: 'F',
163
164
  G: 'G',
164
165
  H: 'H',
166
+ HH: 'HH',
167
+ HR: 'HR',
165
168
  L: 'L',
166
169
  Q: 'Q',
167
170
  S: 'S',
171
+ TPO: 'TPO',
172
+ TRN: 'TRN',
168
173
  V: 'V',
169
174
  W: 'W',
170
175
  X: 'X',
package/src/enums.d.ts CHANGED
@@ -157,12 +157,17 @@ export const APPEAL_CASE_SUB_TYPE = {
157
157
  export const APPEAL_CASE_TYPE = {
158
158
  C: 'C',
159
159
  D: 'D',
160
+ ENV: 'ENV',
160
161
  F: 'F',
161
162
  G: 'G',
162
163
  H: 'H',
164
+ HH: 'HH',
165
+ HR: 'HR',
163
166
  L: 'L',
164
167
  Q: 'Q',
165
168
  S: 'S',
169
+ TPO: 'TPO',
170
+ TRN: 'TRN',
166
171
  V: 'V',
167
172
  W: 'W',
168
173
  X: 'X',
package/src/enums.js CHANGED
@@ -157,12 +157,17 @@ export const APPEAL_CASE_SUB_TYPE = Object.freeze({
157
157
  export const APPEAL_CASE_TYPE = Object.freeze({
158
158
  C: 'C',
159
159
  D: 'D',
160
+ ENV: 'ENV',
160
161
  F: 'F',
161
162
  G: 'G',
162
163
  H: 'H',
164
+ HH: 'HH',
165
+ HR: 'HR',
163
166
  L: 'L',
164
167
  Q: 'Q',
165
168
  S: 'S',
169
+ TPO: 'TPO',
170
+ TRN: 'TRN',
166
171
  V: 'V',
167
172
  W: 'W',
168
173
  X: 'X',
package/src/index.cjs CHANGED
@@ -240,12 +240,17 @@ const APPEAL_CASE_SUB_TYPE = Object.freeze({
240
240
  const APPEAL_CASE_TYPE = Object.freeze({
241
241
  C: 'C',
242
242
  D: 'D',
243
+ ENV: 'ENV',
243
244
  F: 'F',
244
245
  G: 'G',
245
246
  H: 'H',
247
+ HH: 'HH',
248
+ HR: 'HR',
246
249
  L: 'L',
247
250
  Q: 'Q',
248
251
  S: 'S',
252
+ TPO: 'TPO',
253
+ TRN: 'TRN',
249
254
  V: 'V',
250
255
  W: 'W',
251
256
  X: 'X',
package/src/schemas.d.ts CHANGED
@@ -128,7 +128,28 @@ export interface AppealDocument {
128
128
  /**
129
129
  * The internal code for an appeal type, e.g. Householder (D)
130
130
  */
131
- caseType: 'C' | 'D' | 'F' | 'G' | 'H' | 'L' | 'Q' | 'S' | 'V' | 'W' | 'X' | 'Y' | 'Z' | 'ZA' | 'ZP' | null;
131
+ caseType:
132
+ | 'C'
133
+ | 'D'
134
+ | 'F'
135
+ | 'G'
136
+ | 'H'
137
+ | 'L'
138
+ | 'Q'
139
+ | 'S'
140
+ | 'V'
141
+ | 'W'
142
+ | 'X'
143
+ | 'Y'
144
+ | 'Z'
145
+ | 'ZA'
146
+ | 'ZP'
147
+ | 'TPO'
148
+ | 'TRN'
149
+ | 'HH'
150
+ | 'HR'
151
+ | 'ENV'
152
+ | null;
132
153
  /**
133
154
  * Indicates the redaction status for the document
134
155
  */
@@ -409,9 +430,29 @@ export interface AppealGroupCCase {
409
430
  */
410
431
  caseReference: string;
411
432
  /**
412
- * The internal letter code for an appeal type, e.g. W (Environmental)
413
- */
414
- caseType: 'C' | 'D' | 'F' | 'G' | 'H' | 'L' | 'Q' | 'S' | 'V' | 'W' | 'X' | 'Y' | 'Z' | 'ZA' | 'ZP';
433
+ * Internal letter code for appeal types
434
+ */
435
+ caseType:
436
+ | 'C'
437
+ | 'D'
438
+ | 'F'
439
+ | 'G'
440
+ | 'H'
441
+ | 'L'
442
+ | 'Q'
443
+ | 'S'
444
+ | 'V'
445
+ | 'W'
446
+ | 'X'
447
+ | 'Y'
448
+ | 'Z'
449
+ | 'ZA'
450
+ | 'ZP'
451
+ | 'TPO'
452
+ | 'TRN'
453
+ | 'HH'
454
+ | 'HR'
455
+ | 'ENV';
415
456
  /**
416
457
  * The processing status for the appeal
417
458
  */
@@ -706,7 +747,27 @@ export type AppealHASCase = (GridReference | SiteAddress) & {
706
747
  /**
707
748
  * The internal code for an appeal type, e.g. D (Householder)
708
749
  */
709
- caseType: 'C' | 'D' | 'F' | 'G' | 'H' | 'L' | 'Q' | 'S' | 'V' | 'W' | 'X' | 'Y' | 'Z' | 'ZA' | 'ZP';
750
+ caseType:
751
+ | 'C'
752
+ | 'D'
753
+ | 'F'
754
+ | 'G'
755
+ | 'H'
756
+ | 'L'
757
+ | 'Q'
758
+ | 'S'
759
+ | 'V'
760
+ | 'W'
761
+ | 'X'
762
+ | 'Y'
763
+ | 'Z'
764
+ | 'ZA'
765
+ | 'ZP'
766
+ | 'TPO'
767
+ | 'TRN'
768
+ | 'HH'
769
+ | 'HR'
770
+ | 'ENV';
710
771
  /**
711
772
  * The type of procedure for the appeal
712
773
  */
@@ -1336,7 +1397,27 @@ export type AppealS78Case = (GridReference | SiteAddress) & {
1336
1397
  /**
1337
1398
  * The internal code for an appeal type, e.g. D (Householder)
1338
1399
  */
1339
- caseType: 'C' | 'D' | 'F' | 'G' | 'H' | 'L' | 'Q' | 'S' | 'V' | 'W' | 'X' | 'Y' | 'Z' | 'ZA' | 'ZP';
1400
+ caseType:
1401
+ | 'C'
1402
+ | 'D'
1403
+ | 'F'
1404
+ | 'G'
1405
+ | 'H'
1406
+ | 'L'
1407
+ | 'Q'
1408
+ | 'S'
1409
+ | 'V'
1410
+ | 'W'
1411
+ | 'X'
1412
+ | 'Y'
1413
+ | 'Z'
1414
+ | 'ZA'
1415
+ | 'ZP'
1416
+ | 'TPO'
1417
+ | 'TRN'
1418
+ | 'HH'
1419
+ | 'HR'
1420
+ | 'ENV';
1340
1421
  /**
1341
1422
  * The type of procedure for the appeal
1342
1423
  */
@@ -339,4 +339,40 @@ describe('appeal-group-c.schema.json', () => {
339
339
  baseDoc.documentType = 'lpaQuestionnaire';
340
340
  assert.strictEqual(ajv.validate(docSchema, baseDoc), true, JSON.stringify(ajv.errors));
341
341
  });
342
+
343
+ it('should validate caseType enums including new letter codes', () => {
344
+ const ajv = setupAjv();
345
+ const testCase = structuredClone(baseAppealGroupC);
346
+
347
+ const validCaseTypes = [
348
+ 'C',
349
+ 'D',
350
+ 'F',
351
+ 'G',
352
+ 'H',
353
+ 'L',
354
+ 'Q',
355
+ 'S',
356
+ 'V',
357
+ 'W',
358
+ 'X',
359
+ 'Y',
360
+ 'Z',
361
+ 'ZA',
362
+ 'ZP',
363
+ 'TPO',
364
+ 'TRN',
365
+ 'HH',
366
+ 'HR',
367
+ 'ENV'
368
+ ];
369
+
370
+ for (const caseType of validCaseTypes) {
371
+ testCase.caseType = caseType;
372
+ assert.strictEqual(ajv.validate(schema, testCase), true, `caseType ${caseType} should be valid`);
373
+ }
374
+
375
+ testCase.caseType = 'INVALID_CODE';
376
+ assert.strictEqual(ajv.validate(schema, testCase), false);
377
+ });
342
378
  });