@planning-inspectorate/data-model 2.48.1 → 2.49.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.
@@ -17,7 +17,7 @@ any of
17
17
  | [submissionId](#submissionid) | `string` | Optional | can be null | [Appeal HAS Case](appeal-has-properties-submissionid.md "appeal-has.schema.json#/properties/submissionId") |
18
18
  | [caseStatus](#casestatus) | `string` | Required | cannot be null | [Appeal HAS Case](appeal-has-properties-casestatus.md "appeal-has.schema.json#/properties/caseStatus") |
19
19
  | [caseType](#casetype) | `string` | Required | cannot be null | [Appeal HAS Case](appeal-has-properties-casetype.md "appeal-has.schema.json#/properties/caseType") |
20
- | [caseProcedure](#caseprocedure) | `string` | Required | cannot be null | [Appeal HAS Case](appeal-has-properties-caseprocedure.md "appeal-has.schema.json#/properties/caseProcedure") |
20
+ | [caseProcedure](#caseprocedure) | `string` | Required | can be null | [Appeal HAS Case](appeal-has-properties-caseprocedure.md "appeal-has.schema.json#/properties/caseProcedure") |
21
21
  | [lpaCode](#lpacode) | `string` | Required | cannot be null | [Appeal HAS Case](appeal-has-properties-lpacode.md "appeal-has.schema.json#/properties/lpaCode") |
22
22
  | [caseOfficerId](#caseofficerid) | `string` | Required | can be null | [Appeal HAS Case](appeal-has-properties-caseofficerid.md "appeal-has.schema.json#/properties/caseOfficerId") |
23
23
  | [inspectorId](#inspectorid) | `string` | Required | can be null | [Appeal HAS Case](appeal-has-properties-inspectorid.md "appeal-has.schema.json#/properties/inspectorId") |
@@ -287,7 +287,7 @@ The type of procedure for the appeal
287
287
 
288
288
  * Type: `string`
289
289
 
290
- * cannot be null
290
+ * can be null
291
291
 
292
292
  * defined in: [Appeal HAS Case](appeal-has-properties-caseprocedure.md "appeal-has.schema.json#/properties/caseProcedure")
293
293
 
@@ -299,11 +299,14 @@ The type of procedure for the appeal
299
299
 
300
300
  **enum**: the value of this property must be equal to one of the following values:
301
301
 
302
- | Value | Explanation |
303
- | :---------- | :---------- |
304
- | `"written"` | |
305
- | `"hearing"` | |
306
- | `"inquiry"` | |
302
+ | Value | Explanation |
303
+ | :--------------- | :---------- |
304
+ | `"written"` | |
305
+ | `"hearing"` | |
306
+ | `"inquiry"` | |
307
+ | `"writtenPart1"` | |
308
+ | `"writtenPart2"` | |
309
+ | `null` | |
307
310
 
308
311
  ## lpaCode
309
312
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/data-model",
3
- "version": "2.48.1",
3
+ "version": "2.49.0",
4
4
  "description": "JSON Schemas for the Planning Inspectorate's Data Model",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -59,6 +59,9 @@ class CaseProcedure(Enum):
59
59
  written = "written"
60
60
  hearing = "hearing"
61
61
  inquiry = "inquiry"
62
+ writtenPart1 = "writtenPart1"
63
+ writtenPart2 = "writtenPart2"
64
+ NoneType_None = None
62
65
 
63
66
 
64
67
  class AllocationLevel(Enum):
@@ -135,8 +135,8 @@
135
135
  "description": "The internal code for an appeal type, e.g. D (Householder)"
136
136
  },
137
137
  "caseProcedure": {
138
- "type": "string",
139
- "enum": ["written", "hearing", "inquiry"],
138
+ "type": ["string", "null"],
139
+ "enum": ["written", "hearing", "inquiry", "writtenPart1", "writtenPart2", null],
140
140
  "description": "The type of procedure for the appeal"
141
141
  },
142
142
  "lpaCode": {
package/src/enums.cjs CHANGED
@@ -7,12 +7,6 @@ const APPEAL_HAS_CASE_DECISION_OUTCOME = Object.freeze({
7
7
  SPLIT_DECISION: 'split_decision',
8
8
  });
9
9
 
10
- const APPEAL_HAS_CASE_PROCEDURE = Object.freeze({
11
- HEARING: 'hearing',
12
- INQUIRY: 'inquiry',
13
- WRITTEN: 'written',
14
- });
15
-
16
10
  const APPEAL_HAS_CASE_STATUS = Object.freeze({
17
11
  ASSIGN_CASE_OFFICER: 'assign_case_officer',
18
12
  AWAITING_EVENT: 'awaiting_event',
@@ -854,7 +848,6 @@ exports.APPEAL_EIA_ENVIRONMENTAL_IMPACT_SCHEDULE = APPEAL_EIA_ENVIRONMENTAL_IMPA
854
848
  exports.APPEAL_EVENT_STATUS = APPEAL_EVENT_STATUS;
855
849
  exports.APPEAL_EVENT_TYPE = APPEAL_EVENT_TYPE;
856
850
  exports.APPEAL_HAS_CASE_DECISION_OUTCOME = APPEAL_HAS_CASE_DECISION_OUTCOME;
857
- exports.APPEAL_HAS_CASE_PROCEDURE = APPEAL_HAS_CASE_PROCEDURE;
858
851
  exports.APPEAL_HAS_CASE_STATUS = APPEAL_HAS_CASE_STATUS;
859
852
  exports.APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION = APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION;
860
853
  exports.APPEAL_INVALID_OR_INCOMPLETE_DETAILS = APPEAL_INVALID_OR_INCOMPLETE_DETAILS;
package/src/enums.d.ts CHANGED
@@ -5,12 +5,6 @@ export const APPEAL_HAS_CASE_DECISION_OUTCOME = {
5
5
  SPLIT_DECISION: 'split_decision',
6
6
  } as const;
7
7
 
8
- export const APPEAL_HAS_CASE_PROCEDURE = {
9
- HEARING: 'hearing',
10
- INQUIRY: 'inquiry',
11
- WRITTEN: 'written',
12
- } as const;
13
-
14
8
  export const APPEAL_HAS_CASE_STATUS = {
15
9
  ASSIGN_CASE_OFFICER: 'assign_case_officer',
16
10
  AWAITING_EVENT: 'awaiting_event',
package/src/enums.js CHANGED
@@ -5,12 +5,6 @@ export const APPEAL_HAS_CASE_DECISION_OUTCOME = Object.freeze({
5
5
  SPLIT_DECISION: 'split_decision',
6
6
  });
7
7
 
8
- export const APPEAL_HAS_CASE_PROCEDURE = Object.freeze({
9
- HEARING: 'hearing',
10
- INQUIRY: 'inquiry',
11
- WRITTEN: 'written',
12
- });
13
-
14
8
  export const APPEAL_HAS_CASE_STATUS = Object.freeze({
15
9
  ASSIGN_CASE_OFFICER: 'assign_case_officer',
16
10
  AWAITING_EVENT: 'awaiting_event',
package/src/index.cjs CHANGED
@@ -88,12 +88,6 @@ const APPEAL_HAS_CASE_DECISION_OUTCOME = Object.freeze({
88
88
  SPLIT_DECISION: 'split_decision',
89
89
  });
90
90
 
91
- const APPEAL_HAS_CASE_PROCEDURE = Object.freeze({
92
- HEARING: 'hearing',
93
- INQUIRY: 'inquiry',
94
- WRITTEN: 'written',
95
- });
96
-
97
91
  const APPEAL_HAS_CASE_STATUS = Object.freeze({
98
92
  ASSIGN_CASE_OFFICER: 'assign_case_officer',
99
93
  AWAITING_EVENT: 'awaiting_event',
@@ -967,7 +961,6 @@ exports.APPEAL_EIA_ENVIRONMENTAL_IMPACT_SCHEDULE = APPEAL_EIA_ENVIRONMENTAL_IMPA
967
961
  exports.APPEAL_EVENT_STATUS = APPEAL_EVENT_STATUS;
968
962
  exports.APPEAL_EVENT_TYPE = APPEAL_EVENT_TYPE;
969
963
  exports.APPEAL_HAS_CASE_DECISION_OUTCOME = APPEAL_HAS_CASE_DECISION_OUTCOME;
970
- exports.APPEAL_HAS_CASE_PROCEDURE = APPEAL_HAS_CASE_PROCEDURE;
971
964
  exports.APPEAL_HAS_CASE_STATUS = APPEAL_HAS_CASE_STATUS;
972
965
  exports.APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION = APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION;
973
966
  exports.APPEAL_INVALID_OR_INCOMPLETE_DETAILS = APPEAL_INVALID_OR_INCOMPLETE_DETAILS;
package/src/schemas.d.ts CHANGED
@@ -381,7 +381,7 @@ export type AppealHASCase = (GridReference | SiteAddress) & {
381
381
  /**
382
382
  * The type of procedure for the appeal
383
383
  */
384
- caseProcedure: 'written' | 'hearing' | 'inquiry';
384
+ caseProcedure: 'written' | 'hearing' | 'inquiry' | 'writtenPart1' | 'writtenPart2' | null;
385
385
  /**
386
386
  * A unique identifier for the Local Planning Authority
387
387
  */
@@ -329,4 +329,38 @@ describe(schema, () => {
329
329
  const validationResult = ajv.validate(schema, test);
330
330
  assert.strictEqual(validationResult, true);
331
331
  });
332
+
333
+ describe('caseProcedure schema validation (Group A - HAS)', () => {
334
+ it('should accept existing values: written, hearing, inquiry', () => {
335
+ for (const proc of ['written', 'hearing', 'inquiry']) {
336
+ const test = structuredClone(appealHas);
337
+ test.caseProcedure = proc;
338
+ const validationResult = ajv.validate(schema, test);
339
+ assert.strictEqual(validationResult, true, `Expected caseProcedure "${proc}" to be valid`);
340
+ }
341
+ });
342
+
343
+ it('should accept new expedited appeal values: writtenPart1, writtenPart2', () => {
344
+ for (const proc of ['writtenPart1', 'writtenPart2']) {
345
+ const test = structuredClone(appealHas);
346
+ test.caseProcedure = proc;
347
+ const validationResult = ajv.validate(schema, test);
348
+ assert.strictEqual(validationResult, true, `Expected caseProcedure "${proc}" to be valid`);
349
+ }
350
+ });
351
+
352
+ it('should accept null value for caseProcedure', () => {
353
+ const test = structuredClone(appealHas);
354
+ test.caseProcedure = null;
355
+ const validationResult = ajv.validate(schema, test);
356
+ assert.strictEqual(validationResult, true, 'Expected caseProcedure null to be valid');
357
+ });
358
+
359
+ it('should reject invalid caseProcedure values', () => {
360
+ const test = structuredClone(appealHas);
361
+ test.caseProcedure = 'invalidProcedure';
362
+ const validationResult = ajv.validate(schema, test);
363
+ assert.strictEqual(validationResult, false, 'Expected invalid caseProcedure value to fail validation');
364
+ });
365
+ });
332
366
  });