@planning-inspectorate/data-model 2.45.0 → 2.46.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.
@@ -13,14 +13,14 @@
13
13
  | [eventStatus](#eventstatus) | `string` | Required | cannot be null | [Appeal Event](appeal-event-properties-eventstatus.md "appeal-event.schema.json#/properties/eventStatus") |
14
14
  | [isUrgent](#isurgent) | `boolean` | Required | cannot be null | [Appeal Event](appeal-event-properties-isurgent.md "appeal-event.schema.json#/properties/isUrgent") |
15
15
  | [eventPublished](#eventpublished) | `boolean` | Required | can be null | [Appeal Event](appeal-event-properties-eventpublished.md "appeal-event.schema.json#/properties/eventPublished") |
16
- | [eventStartDateTime](#eventstartdatetime) | `string` | Required | cannot be null | [Appeal Event](appeal-event-properties-eventstartdatetime.md "appeal-event.schema.json#/properties/eventStartDateTime") |
17
- | [eventEndDateTime](#eventenddatetime) | `string` | Required | can be null | [Appeal Event](appeal-event-properties-eventenddatetime.md "appeal-event.schema.json#/properties/eventEndDateTime") |
18
- | [notificationOfSiteVisit](#notificationofsitevisit) | `string` | Required | can be null | [Appeal Event](appeal-event-properties-notificationofsitevisit.md "appeal-event.schema.json#/properties/notificationOfSiteVisit") |
19
- | [addressLine1](#addressline1) | `string` | Required | can be null | [Appeal Event](appeal-event-properties-addressline1.md "appeal-event.schema.json#/properties/addressLine1") |
20
- | [addressLine2](#addressline2) | `string` | Required | can be null | [Appeal Event](appeal-event-properties-addressline2.md "appeal-event.schema.json#/properties/addressLine2") |
21
- | [addressTown](#addresstown) | `string` | Required | can be null | [Appeal Event](appeal-event-properties-addresstown.md "appeal-event.schema.json#/properties/addressTown") |
22
- | [addressCounty](#addresscounty) | `string` | Required | can be null | [Appeal Event](appeal-event-properties-addresscounty.md "appeal-event.schema.json#/properties/addressCounty") |
23
- | [addressPostcode](#addresspostcode) | `string` | Required | can be null | [Appeal Event](appeal-event-properties-addresspostcode.md "appeal-event.schema.json#/properties/addressPostcode") |
16
+ | [eventStartDateTime](#eventstartdatetime) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-eventstartdatetime.md "appeal-event.schema.json#/properties/eventStartDateTime") |
17
+ | [eventEndDateTime](#eventenddatetime) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-eventenddatetime.md "appeal-event.schema.json#/properties/eventEndDateTime") |
18
+ | [notificationOfSiteVisit](#notificationofsitevisit) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-notificationofsitevisit.md "appeal-event.schema.json#/properties/notificationOfSiteVisit") |
19
+ | [addressLine1](#addressline1) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-addressline1.md "appeal-event.schema.json#/properties/addressLine1") |
20
+ | [addressLine2](#addressline2) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-addressline2.md "appeal-event.schema.json#/properties/addressLine2") |
21
+ | [addressTown](#addresstown) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-addresstown.md "appeal-event.schema.json#/properties/addressTown") |
22
+ | [addressCounty](#addresscounty) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-addresscounty.md "appeal-event.schema.json#/properties/addressCounty") |
23
+ | [addressPostcode](#addresspostcode) | `string` | Optional | can be null | [Appeal Event](appeal-event-properties-addresspostcode.md "appeal-event.schema.json#/properties/addressPostcode") |
24
24
  | Additional Properties | Any | Optional | can be null | |
25
25
 
26
26
  ## eventId
@@ -164,6 +164,7 @@ Status of the event
164
164
  | `"link_to_enforcement"` | |
165
165
  | `"offered"` | |
166
166
  | `"postponed"` | |
167
+ | `"pending"` | |
167
168
 
168
169
  ## isUrgent
169
170
 
@@ -207,11 +208,11 @@ Event start date and time
207
208
 
208
209
  `eventStartDateTime`
209
210
 
210
- * is required
211
+ * is optional
211
212
 
212
213
  * Type: `string`
213
214
 
214
- * cannot be null
215
+ * can be null
215
216
 
216
217
  * defined in: [Appeal Event](appeal-event-properties-eventstartdatetime.md "appeal-event.schema.json#/properties/eventStartDateTime")
217
218
 
@@ -235,7 +236,7 @@ Event end date and time
235
236
 
236
237
  `eventEndDateTime`
237
238
 
238
- * is required
239
+ * is optional
239
240
 
240
241
  * Type: `string`
241
242
 
@@ -263,7 +264,7 @@ The date third-parties were informed of the site visit event
263
264
 
264
265
  `notificationOfSiteVisit`
265
266
 
266
- * is required
267
+ * is optional
267
268
 
268
269
  * Type: `string`
269
270
 
@@ -291,7 +292,7 @@ First line of address for the event site
291
292
 
292
293
  `addressLine1`
293
294
 
294
- * is required
295
+ * is optional
295
296
 
296
297
  * Type: `string`
297
298
 
@@ -315,7 +316,7 @@ Second line of address for the event site
315
316
 
316
317
  `addressLine2`
317
318
 
318
- * is required
319
+ * is optional
319
320
 
320
321
  * Type: `string`
321
322
 
@@ -333,7 +334,7 @@ Town / City of the event address
333
334
 
334
335
  `addressTown`
335
336
 
336
- * is required
337
+ * is optional
337
338
 
338
339
  * Type: `string`
339
340
 
@@ -357,7 +358,7 @@ County of the event address
357
358
 
358
359
  `addressCounty`
359
360
 
360
- * is required
361
+ * is optional
361
362
 
362
363
  * Type: `string`
363
364
 
@@ -381,7 +382,7 @@ Postal code of the event address
381
382
 
382
383
  `addressPostcode`
383
384
 
384
- * is required
385
+ * is optional
385
386
 
386
387
  * Type: `string`
387
388
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/data-model",
3
- "version": "2.45.0",
3
+ "version": "2.46.0",
4
4
  "description": "JSON Schemas for the Planning Inspectorate's Data Model",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -38,6 +38,7 @@ class EventStatus(Enum):
38
38
  link_to_enforcement = "link_to_enforcement"
39
39
  offered = "offered"
40
40
  postponed = "postponed"
41
+ pending = "pending"
41
42
 
42
43
 
43
44
  class AppealEvent(BaseModel):
@@ -76,25 +77,25 @@ class AppealEvent(BaseModel):
76
77
  """
77
78
  Indicates if the event has been published
78
79
  """
79
- eventStartDateTime: AwareDatetime = Field(
80
- ..., examples=["2023-07-27T20:30:00.000Z"]
80
+ eventStartDateTime: AwareDatetime | None = Field(
81
+ None, examples=["2023-07-27T20:30:00.000Z"]
81
82
  )
82
83
  """
83
84
  Event start date and time
84
85
  """
85
86
  eventEndDateTime: AwareDatetime | None = Field(
86
- ..., examples=["2023-07-27T20:30:00.000Z"]
87
+ None, examples=["2023-07-27T20:30:00.000Z"]
87
88
  )
88
89
  """
89
90
  Event end date and time
90
91
  """
91
92
  notificationOfSiteVisit: AwareDatetime | None = Field(
92
- ..., examples=["2023-07-27T20:30:00.000Z"]
93
+ None, examples=["2023-07-27T20:30:00.000Z"]
93
94
  )
94
95
  """
95
96
  The date third-parties were informed of the site visit event
96
97
  """
97
- addressLine1: str | None = Field(..., examples=["96 The Avenue"])
98
+ addressLine1: str | None = Field(None, examples=["96 The Avenue"])
98
99
  """
99
100
  First line of address for the event site
100
101
  """
@@ -102,15 +103,15 @@ class AppealEvent(BaseModel):
102
103
  """
103
104
  Second line of address for the event site
104
105
  """
105
- addressTown: str | None = Field(..., examples=["Maidstone"])
106
+ addressTown: str | None = Field(None, examples=["Maidstone"])
106
107
  """
107
108
  Town / City of the event address
108
109
  """
109
- addressCounty: str | None = Field(..., examples=["Kent"])
110
+ addressCounty: str | None = Field(None, examples=["Kent"])
110
111
  """
111
112
  County of the event address
112
113
  """
113
- addressPostcode: str | None = Field(..., examples=["MD21 5XY"])
114
+ addressPostcode: str | None = Field(None, examples=["MD21 5XY"])
114
115
  """
115
116
  Postal code of the event address
116
117
  """
@@ -5,23 +5,7 @@
5
5
  "description": "Schema defining the metadata for appeal events, such as site visits, inquiries, hearings",
6
6
  "type": "object",
7
7
  "additionalProperties": true,
8
- "required": [
9
- "eventId",
10
- "caseReference",
11
- "eventType",
12
- "eventName",
13
- "eventStatus",
14
- "isUrgent",
15
- "eventPublished",
16
- "eventStartDateTime",
17
- "eventEndDateTime",
18
- "notificationOfSiteVisit",
19
- "addressLine1",
20
- "addressLine2",
21
- "addressTown",
22
- "addressCounty",
23
- "addressPostcode"
24
- ],
8
+ "required": ["eventId", "caseReference", "eventType", "eventName", "eventStatus", "isUrgent", "eventPublished"],
25
9
  "properties": {
26
10
  "eventId": {
27
11
  "type": "string",
@@ -65,7 +49,8 @@
65
49
  "confirmed",
66
50
  "link_to_enforcement",
67
51
  "offered",
68
- "postponed"
52
+ "postponed",
53
+ "pending"
69
54
  ],
70
55
  "description": "Status of the event"
71
56
  },
@@ -78,7 +63,7 @@
78
63
  "description": "Indicates if the event has been published"
79
64
  },
80
65
  "eventStartDateTime": {
81
- "type": "string",
66
+ "type": ["string", "null"],
82
67
  "format": "date-time",
83
68
  "examples": ["2023-07-27T20:30:00.000Z"],
84
69
  "description": "Event start date and time"
package/src/enums.cjs CHANGED
@@ -309,6 +309,7 @@ const APPEAL_EVENT_STATUS = Object.freeze({
309
309
  LINK_TO_ENFORCEMENT: 'link_to_enforcement',
310
310
  NEW_RESCHEDULED: 'new_rescheduled',
311
311
  OFFERED: 'offered',
312
+ PENDING: 'pending',
312
313
  POSTPONED: 'postponed',
313
314
  WITHDRAWN: 'withdrawn',
314
315
  });
package/src/enums.d.ts CHANGED
@@ -307,6 +307,7 @@ export const APPEAL_EVENT_STATUS = {
307
307
  LINK_TO_ENFORCEMENT: 'link_to_enforcement',
308
308
  NEW_RESCHEDULED: 'new_rescheduled',
309
309
  OFFERED: 'offered',
310
+ PENDING: 'pending',
310
311
  POSTPONED: 'postponed',
311
312
  WITHDRAWN: 'withdrawn',
312
313
  } as const;
package/src/enums.js CHANGED
@@ -307,6 +307,7 @@ export const APPEAL_EVENT_STATUS = Object.freeze({
307
307
  LINK_TO_ENFORCEMENT: 'link_to_enforcement',
308
308
  NEW_RESCHEDULED: 'new_rescheduled',
309
309
  OFFERED: 'offered',
310
+ PENDING: 'pending',
310
311
  POSTPONED: 'postponed',
311
312
  WITHDRAWN: 'withdrawn',
312
313
  });
package/src/index.cjs CHANGED
@@ -390,6 +390,7 @@ const APPEAL_EVENT_STATUS = Object.freeze({
390
390
  LINK_TO_ENFORCEMENT: 'link_to_enforcement',
391
391
  NEW_RESCHEDULED: 'new_rescheduled',
392
392
  OFFERED: 'offered',
393
+ PENDING: 'pending',
393
394
  POSTPONED: 'postponed',
394
395
  WITHDRAWN: 'withdrawn',
395
396
  });
package/src/schemas.d.ts CHANGED
@@ -292,7 +292,8 @@ export interface AppealEvent {
292
292
  | 'confirmed'
293
293
  | 'link_to_enforcement'
294
294
  | 'offered'
295
- | 'postponed';
295
+ | 'postponed'
296
+ | 'pending';
296
297
  /**
297
298
  * Indicates if the event is urgent
298
299
  */
@@ -304,35 +305,35 @@ export interface AppealEvent {
304
305
  /**
305
306
  * Event start date and time
306
307
  */
307
- eventStartDateTime: string;
308
+ eventStartDateTime?: string | null;
308
309
  /**
309
310
  * Event end date and time
310
311
  */
311
- eventEndDateTime: string | null;
312
+ eventEndDateTime?: string | null;
312
313
  /**
313
314
  * The date third-parties were informed of the site visit event
314
315
  */
315
- notificationOfSiteVisit: string | null;
316
+ notificationOfSiteVisit?: string | null;
316
317
  /**
317
318
  * First line of address for the event site
318
319
  */
319
- addressLine1: string | null;
320
+ addressLine1?: string | null;
320
321
  /**
321
322
  * Second line of address for the event site
322
323
  */
323
- addressLine2: string | null;
324
+ addressLine2?: string | null;
324
325
  /**
325
326
  * Town / City of the event address
326
327
  */
327
- addressTown: string | null;
328
+ addressTown?: string | null;
328
329
  /**
329
330
  * County of the event address
330
331
  */
331
- addressCounty: string | null;
332
+ addressCounty?: string | null;
332
333
  /**
333
334
  * Postal code of the event address
334
335
  */
335
- addressPostcode: string | null;
336
+ addressPostcode?: string | null;
336
337
  [k: string]: unknown;
337
338
  }
338
339
 
@@ -53,6 +53,22 @@ describe(schema, () => {
53
53
  assert.strictEqual(validationResult, true);
54
54
  });
55
55
 
56
+ it('should allow eventStatus to be pending, eventStartDateTime to be null, and address fields to be omitted', () => {
57
+ const test = {
58
+ eventId: 'ipsum ut proident Ut',
59
+ caseReference: 'irure dolore in exercitation elit',
60
+ eventType: 'site_visit_accompanied',
61
+ eventName: 'minim anim',
62
+ eventStatus: 'pending',
63
+ isUrgent: true,
64
+ eventPublished: false,
65
+ eventStartDateTime: null
66
+ };
67
+
68
+ const validationResult = ajv.validate(schema, test);
69
+ assert.strictEqual(validationResult, true);
70
+ });
71
+
56
72
  it('should allow additional props', () => {
57
73
  const test = structuredClone(event);
58
74
  test.test = 1; // additional unknown prop allowed