@planning-inspectorate/data-model 2.50.0 → 2.51.1

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 (67) hide show
  1. package/commitlint.config.js +3 -8
  2. package/docs/address.md +1 -1
  3. package/docs/nsip-exam-timetable-defs-event.md +1 -0
  4. package/docs/nsip-exam-timetable.md +1 -0
  5. package/eslint.config.js +3 -20
  6. package/load-test/appeals/generate-appeals-messages.js +1 -1
  7. package/load-test/appeals/run-load-script.js +2 -2
  8. package/load-test/service-bus-client.js +1 -1
  9. package/package.json +5 -2
  10. package/pins_data_model/gen_models.py +2 -1
  11. package/pins_data_model/models/model_address.py +3 -3
  12. package/pins_data_model/models/model_appeal_document.py +11 -11
  13. package/pins_data_model/models/model_appeal_event.py +4 -4
  14. package/pins_data_model/models/model_appeal_event_estimate.py +3 -3
  15. package/pins_data_model/models/model_appeal_has.py +111 -93
  16. package/pins_data_model/models/model_appeal_representation.py +12 -12
  17. package/pins_data_model/models/model_appeal_s78.py +246 -228
  18. package/pins_data_model/models/model_application_update.py +2 -2
  19. package/pins_data_model/models/model_applications_application.py +4 -4
  20. package/pins_data_model/models/model_applications_application_update.py +2 -2
  21. package/pins_data_model/models/model_applications_notify_email.py +2 -2
  22. package/pins_data_model/models/model_applications_representation.py +4 -4
  23. package/pins_data_model/models/model_dart_response.py +1 -1
  24. package/pins_data_model/models/model_folder.py +3 -3
  25. package/pins_data_model/models/model_nsip_document.py +12 -12
  26. package/pins_data_model/models/model_nsip_exam_timetable.py +3 -2
  27. package/pins_data_model/models/model_nsip_invoice.py +2 -2
  28. package/pins_data_model/models/model_nsip_project.py +19 -19
  29. package/pins_data_model/models/model_nsip_project_update.py +5 -5
  30. package/pins_data_model/models/model_nsip_representation.py +7 -7
  31. package/pins_data_model/models/model_nsip_subscription.py +6 -6
  32. package/pins_data_model/models/model_pins_inspector.py +5 -5
  33. package/pins_data_model/models/model_s51_advice.py +7 -7
  34. package/pins_data_model/models/model_service_user.py +2 -2
  35. package/prettier.config.js +13 -0
  36. package/requirements.txt +1 -1
  37. package/schemas/address.schema.json +1 -1
  38. package/schemas/nsip-exam-timetable.schema.json +2 -1
  39. package/src/index.cjs +1 -1
  40. package/src/lib/gen-docs.js +1 -1
  41. package/src/lib/gen-enum-impl.test.js +1 -1
  42. package/src/lib/gen-enums.js +1 -1
  43. package/src/lib/gen-types.js +2 -2
  44. package/src/lib/load.js +1 -1
  45. package/src/schemas.d.ts +30 -2
  46. package/tests/appeals/appeal-event.test.js +2 -2
  47. package/tests/appeals/appeal-has.test.js +2 -2
  48. package/tests/appeals/appeal-s78.test.js +2 -2
  49. package/tests/appeals/commands/adverts-questionnaire.test.js +2 -2
  50. package/tests/appeals/commands/adverts-submission.test.js +2 -2
  51. package/tests/appeals/commands/appeal-representation-submission.test.js +2 -2
  52. package/tests/appeals/commands/cas-adverts-questionnaire.test.js +2 -2
  53. package/tests/appeals/commands/cas-adverts-submission.test.js +2 -2
  54. package/tests/appeals/commands/enforcement-listed-questionnaire.test.js +2 -2
  55. package/tests/appeals/commands/enforcement-listed-submission.test.js +2 -2
  56. package/tests/appeals/commands/enforcement-notice-submission.test.js +2 -2
  57. package/tests/appeals/commands/enforcement-questionnaire.test.js +2 -2
  58. package/tests/appeals/commands/has-questionnaire.test.js +2 -2
  59. package/tests/appeals/commands/has-submission.test.js +2 -2
  60. package/tests/appeals/commands/ldc-questionnaire.test.js +2 -2
  61. package/tests/appeals/commands/ldc-submission.test.js +2 -2
  62. package/tests/appeals/commands/s20-questionnaire.test.js +2 -2
  63. package/tests/appeals/commands/s78-questionnaire.test.js +2 -2
  64. package/tests/appeals/commands/s78-submission.test.js +2 -2
  65. package/tests/appeals/expedited-appeals.test.js +2 -2
  66. package/tests/schemas.test.js +1 -1
  67. package/.prettierrc +0 -19
@@ -1,8 +1,3 @@
1
- export default {
2
- extends: ['@commitlint/config-conventional'],
3
- // ignore commits from dependabot
4
- ignores: [
5
- (commit) =>
6
- (commit.startsWith('chore(deps)') || commit.startsWith('chore(deps-dev)')) && commit.includes('dependabot')
7
- ]
8
- };
1
+ import { commitlintConfig } from '@planning-inspectorate/coding-standards';
2
+
3
+ export default commitlintConfig;
package/docs/address.md CHANGED
@@ -327,7 +327,7 @@ Some sites may have a postcode, but do not have postal addresses.
327
327
 
328
328
  ## UPRN
329
329
 
330
- The Unique Property Reference Number (UPRN) is a unique number (a geocode) for every addressable location—e.g., a building, a bus stop, a post box, a feature in the landscape, or a defibrillator—in Great Britain.
330
+ The Unique Property Reference Number (UPRN) is a unique number (a geocode) for every addressable location - e.g., a building, a bus stop, a post box, a feature in the landscape, or a defibrillator - in Great Britain.
331
331
 
332
332
  `UPRN`
333
333
 
@@ -71,6 +71,7 @@ Compulsory Acquisition Hearing/Deadline/Issue Specific Hearing etc
71
71
  | `"Procedural Deadline (Pre-Examination)"` | |
72
72
  | `"Procedural Decision"` | |
73
73
  | `"Publication Of"` | |
74
+ | `"Unaccompanied Site Inspection"` | |
74
75
 
75
76
  ## eventTitle
76
77
 
@@ -146,6 +146,7 @@ Compulsory Acquisition Hearing/Deadline/Issue Specific Hearing etc
146
146
  | `"Procedural Deadline (Pre-Examination)"` | |
147
147
  | `"Procedural Decision"` | |
148
148
  | `"Publication Of"` | |
149
+ | `"Unaccompanied Site Inspection"` | |
149
150
 
150
151
  ### eventTitle
151
152
 
package/eslint.config.js CHANGED
@@ -1,21 +1,4 @@
1
- import js from '@eslint/js';
2
- import eslintConfigPrettier from 'eslint-config-prettier';
3
- import globals from 'globals';
1
+ import { eslintConfig } from '@planning-inspectorate/coding-standards';
2
+ import { defineConfig } from 'eslint/config';
4
3
 
5
- export default [
6
- {
7
- ...js.configs.recommended,
8
- ignores: ['**/*.cjs', 'node_modules/**']
9
- },
10
- {
11
- ignores: ['node_modules/**', '**/*.cjs'],
12
- languageOptions: {
13
- ecmaVersion: 2025,
14
- sourceType: 'module',
15
- globals: {
16
- ...globals.node
17
- }
18
- }
19
- },
20
- eslintConfigPrettier
21
- ];
4
+ export default defineConfig(eslintConfig);
@@ -1,6 +1,6 @@
1
- import crypto from 'node:crypto';
2
1
  import Ajv from 'ajv';
3
2
  import addFormats from 'ajv-formats';
3
+ import crypto from 'node:crypto';
4
4
  import { loadAllSchemasSync } from '../../src/index.js';
5
5
 
6
6
  const HAS_SCHEMA = 'appeal-has.schema.json';
@@ -1,6 +1,6 @@
1
- import { generateAppealsLoadTestMessages } from './generate-appeals-messages.js';
2
- import { ServiceBusEventClient } from '../service-bus-client.js';
3
1
  import { MESSAGE_EVENT_TYPE } from '../../src/enums.js';
2
+ import { ServiceBusEventClient } from '../service-bus-client.js';
3
+ import { generateAppealsLoadTestMessages } from './generate-appeals-messages.js';
4
4
 
5
5
  /** @type {'HAS'|'S78'} */ //@ts-ignore
6
6
  const caseType = process.env.APPEALS_LOAD_TEST_CASE_TYPE || 'HAS'; // 'HAS' or 'S78'
@@ -1,5 +1,5 @@
1
- import { ServiceBusClient } from '@azure/service-bus';
2
1
  import { DefaultAzureCredential } from '@azure/identity';
2
+ import { ServiceBusClient } from '@azure/service-bus';
3
3
 
4
4
  /**
5
5
  * @typedef {object} ServiceBusEventClientOptions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/data-model",
3
- "version": "2.50.0",
3
+ "version": "2.51.1",
4
4
  "description": "JSON Schemas for the Planning Inspectorate's Data Model",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -36,6 +36,7 @@
36
36
  "@commitlint/cli": "^21.0.0",
37
37
  "@commitlint/config-conventional": "^21.0.0",
38
38
  "@eslint/js": "^10.0.1",
39
+ "@planning-inspectorate/coding-standards": "^1.1.1",
39
40
  "ajv": "^8.17.1",
40
41
  "ajv-formats": "^3.0.1",
41
42
  "conventional-changelog-conventionalcommits": "^10.2.0",
@@ -43,10 +44,12 @@
43
44
  "eslint-config-prettier": "^10.1.5",
44
45
  "globals": "^17.3.0",
45
46
  "husky": "^9.1.7",
46
- "json-schema-to-typescript": "^15.0.4",
47
+ "json-schema-to-typescript": "^16.0.0",
47
48
  "lint-staged": "^17.0.4",
48
49
  "lodash.snakecase": "^4.1.1",
49
50
  "prettier": "^3.6.2",
51
+ "prettier-plugin-organize-imports": "^4.3.0",
52
+ "prettier-plugin-prisma": "^5.0.0",
50
53
  "rollup": "^4.44.2",
51
54
  "semantic-release": "^25.0.1"
52
55
  },
@@ -6,7 +6,7 @@ import json
6
6
  from os import path
7
7
  from pathlib import Path
8
8
  from datamodel_code_generator import InputFileType, PythonVersion, generate
9
- from datamodel_code_generator import DataModelType
9
+ from datamodel_code_generator import DataModelType, Formatter
10
10
 
11
11
  from load_schemas import load_all_schemas
12
12
 
@@ -46,6 +46,7 @@ def gen_models() -> None:
46
46
  target_python_version=PythonVersion.PY_311,
47
47
  use_schema_description=True,
48
48
  disable_timestamp=True,
49
+ formatters=[Formatter.BLACK, Formatter.ISORT]
49
50
  )
50
51
 
51
52
 
@@ -3,13 +3,13 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
- from enum import Enum
6
+ from enum import StrEnum
7
7
  from typing import Any
8
8
 
9
9
  from pydantic import BaseModel, ConfigDict, Field
10
10
 
11
11
 
12
- class AddressType(Enum):
12
+ class AddressType(StrEnum):
13
13
  """
14
14
  The type of thing this address is for.
15
15
  """
@@ -64,6 +64,6 @@ class PinsAddressSchema(BaseModel):
64
64
  longitudeWGS84: float | None = Field(None, examples=[-2.6019821])
65
65
  UPRN: str | None = Field(None, examples=[100023336956])
66
66
  """
67
- The Unique Property Reference Number (UPRN) is a unique number (a geocode) for every addressable location—e.g., a building, a bus stop, a post box, a feature in the landscape, or a defibrillator—in Great Britain.
67
+ The Unique Property Reference Number (UPRN) is a unique number (a geocode) for every addressable location - e.g., a building, a bus stop, a post box, a feature in the landscape, or a defibrillator - in Great Britain.
68
68
  """
69
69
  dependentRequired: Any | None = None
@@ -261,7 +261,7 @@ class AppealDocument(BaseModel):
261
261
  """
262
262
  The location of the published document, will be null if the datePublished is not set
263
263
  """
264
- virusCheckStatus: VirusCheckStatus
264
+ virusCheckStatus: VirusCheckStatus | None
265
265
  """
266
266
  Indicates the virus check status for the current document
267
267
  """
@@ -291,43 +291,43 @@ class AppealDocument(BaseModel):
291
291
  """
292
292
  The last update date for the document
293
293
  """
294
- caseType: CaseType
294
+ caseType: CaseType | None
295
295
  """
296
296
  The internal code for an appeal type, e.g. Householder (D)
297
297
  """
298
- redactedStatus: RedactedStatus
298
+ redactedStatus: RedactedStatus | None
299
299
  """
300
300
  Indicates the redaction status for the document
301
301
  """
302
- documentType: DocumentType
302
+ documentType: DocumentType | None
303
303
  """
304
304
  The type of document, used for exchange, migrations and consumption from the appeal back-office system
305
305
  """
306
- sourceSystem: SourceSystem
306
+ sourceSystem: SourceSystem | None
307
307
  """
308
308
  The system mastering the metadata for the current document
309
309
  """
310
- origin: Origin
310
+ origin: Origin | None
311
311
  """
312
312
  Indicates where the documents originates from
313
313
  """
314
- owner: str | None = None
314
+ owner: str | None
315
315
  """
316
316
  Owner of the current document
317
317
  """
318
- author: str | None = None
318
+ author: str | None
319
319
  """
320
320
  Name of person who authored document
321
321
  """
322
- description: str | None = None
322
+ description: str | None
323
323
  """
324
324
  A custom description for the document
325
325
  """
326
- caseStage: CaseStage
326
+ caseStage: CaseStage | None
327
327
  """
328
328
  The stage in the appeal process that has created the document
329
329
  """
330
- horizonFolderId: str | None = None
330
+ horizonFolderId: str | None
331
331
  """
332
332
  The folder ID containing the document in Horizon
333
333
  """
@@ -3,12 +3,12 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
- from enum import Enum
6
+ from enum import StrEnum
7
7
 
8
8
  from pydantic import AwareDatetime, BaseModel, ConfigDict, Field
9
9
 
10
10
 
11
- class EventType(Enum):
11
+ class EventType(StrEnum):
12
12
  """
13
13
  The type of event
14
14
  """
@@ -25,7 +25,7 @@ class EventType(Enum):
25
25
  pre_inquiry_virtual = "pre_inquiry_virtual"
26
26
 
27
27
 
28
- class EventStatus(Enum):
28
+ class EventStatus(StrEnum):
29
29
  """
30
30
  Status of the event
31
31
  """
@@ -73,7 +73,7 @@ class AppealEvent(BaseModel):
73
73
  """
74
74
  Indicates if the event is urgent
75
75
  """
76
- eventPublished: bool | None = None
76
+ eventPublished: bool | None
77
77
  """
78
78
  Indicates if the event has been published
79
79
  """
@@ -22,15 +22,15 @@ class AppealEventEstimate(BaseModel):
22
22
  """
23
23
  The case reference the event estimate belongs to.
24
24
  """
25
- preparationTime: float | None = None
25
+ preparationTime: float | None
26
26
  """
27
27
  Estimated inspector time (days) to prepare for event.
28
28
  """
29
- sittingTime: float | None = None
29
+ sittingTime: float | None
30
30
  """
31
31
  Estimated inspector time (days) for event.
32
32
  """
33
- reportingTime: float | None = None
33
+ reportingTime: float | None
34
34
  """
35
35
  Estimated inspector time (days) for event reporting.
36
36
  """