@planning-inspectorate/data-model 2.2.0 → 2.3.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 (33) hide show
  1. package/.azure/ci.yml +12 -0
  2. package/docs/appeal-has.md +19 -0
  3. package/docs/appeal-s78.md +19 -0
  4. package/package.json +2 -2
  5. package/pins_data_model/models/model_appeal_document.py +1 -1
  6. package/pins_data_model/models/model_appeal_event.py +1 -1
  7. package/pins_data_model/models/model_appeal_event_estimate.py +1 -1
  8. package/pins_data_model/models/model_appeal_has.py +9 -1
  9. package/pins_data_model/models/model_appeal_representation.py +1 -1
  10. package/pins_data_model/models/model_appeal_s78.py +9 -1
  11. package/pins_data_model/models/model_dart_response.py +1 -1
  12. package/pins_data_model/models/model_entraid.py +1 -1
  13. package/pins_data_model/models/model_folder.py +1 -1
  14. package/pins_data_model/models/model_gettimesheets_response.py +1 -1
  15. package/pins_data_model/models/model_listed_building.py +1 -1
  16. package/pins_data_model/models/model_listed_buildings.py +1 -1
  17. package/pins_data_model/models/model_nsip_document.py +1 -1
  18. package/pins_data_model/models/model_nsip_exam_timetable.py +1 -1
  19. package/pins_data_model/models/model_nsip_invoice.py +2 -2
  20. package/pins_data_model/models/model_nsip_meeting.py +2 -2
  21. package/pins_data_model/models/model_nsip_project.py +1 -1
  22. package/pins_data_model/models/model_nsip_project_update.py +1 -1
  23. package/pins_data_model/models/model_nsip_representation.py +1 -1
  24. package/pins_data_model/models/model_nsip_subscription.py +1 -1
  25. package/pins_data_model/models/model_pins_inspector.py +1 -1
  26. package/pins_data_model/models/model_pins_lpa.py +1 -1
  27. package/pins_data_model/models/model_s51_advice.py +1 -1
  28. package/pins_data_model/models/model_service_user.py +1 -1
  29. package/schemas/appeal-has.schema.json +6 -1
  30. package/schemas/appeal-s78.schema.json +6 -1
  31. package/src/schemas.d.ts +8 -0
  32. package/tests/appeals/appeal-has.test.js +2 -1
  33. package/tests/appeals/appeal-s78.test.js +2 -1
package/.azure/ci.yml CHANGED
@@ -21,16 +21,28 @@ resources:
21
21
  extends:
22
22
  template: stages/wrapper_ci.yml@templates
23
23
  parameters:
24
+ gitFetchDepth: 0
24
25
  skipAzureAuth: true
25
26
  validationJobs:
26
27
  - name: Run Checks
27
28
  steps:
29
+ - task: Cache@2
30
+ inputs:
31
+ key: 'npm | "$(Agent.OS)" | package-lock.json'
32
+ restoreKeys: |
33
+ npm | "$(Agent.OS)" | package-lock.json
34
+ path: $(pipeline.workspace)/.npm
35
+ displayName: Cache NPM
28
36
  - template: ../steps/node_script.yml
29
37
  parameters:
30
38
  nodeVersion: 22
31
39
  script: npm ci
40
+ environmentVariables:
41
+ npm_config_cache: $(pipeline.workspace)/.npm
32
42
  - template: ../steps/node_script.yml
33
43
  parameters:
44
+ # only run commitlint on branches, not main
45
+ condition: ne(variables['Build.SourceBranchName'], 'main')
34
46
  nodeVersion: 22
35
47
  script: npm run commitlint
36
48
  - template: ../steps/node_script.yml
@@ -115,6 +115,7 @@ any of
115
115
  | [didAppellantSubmitCompletePhotosAndPlans](#didappellantsubmitcompletephotosandplans) | `boolean` | Optional | can be null | [Appeal HAS Case](appeal-has-properties-didappellantsubmitcompletephotosandplans.md "appeal-has.schema.json#/properties/didAppellantSubmitCompletePhotosAndPlans") |
116
116
  | [isSiteInAreaOfSpecialControlAdverts](#issiteinareaofspecialcontroladverts) | `boolean` | Optional | can be null | [Appeal HAS Case](appeal-has-properties-issiteinareaofspecialcontroladverts.md "appeal-has.schema.json#/properties/isSiteInAreaOfSpecialControlAdverts") |
117
117
  | [advertDetails](#advertdetails) | `array` | Optional | can be null | [Appeal HAS Case](appeal-has-properties-advertdetails.md "appeal-has.schema.json#/properties/advertDetails") |
118
+ | [padsSapId](#padssapid) | `string` | Required | can be null | [Appeal HAS Case](appeal-has-properties-padssapid.md "appeal-has.schema.json#/properties/padsSapId") |
118
119
  | Additional Properties | Any | Optional | can be null | |
119
120
 
120
121
  ## caseId
@@ -2623,6 +2624,24 @@ A list of advertisements for the appeal
2623
2624
 
2624
2625
  `object[]` ([Details](appeal-has-properties-advertdetails-items.md))
2625
2626
 
2627
+ ## padsSapId
2628
+
2629
+ padsSapId for PADS inspectors
2630
+
2631
+ `padsSapId`
2632
+
2633
+ * is required
2634
+
2635
+ * Type: `string`
2636
+
2637
+ * can be null
2638
+
2639
+ * defined in: [Appeal HAS Case](appeal-has-properties-padssapid.md "appeal-has.schema.json#/properties/padsSapId")
2640
+
2641
+ ### padsSapId Type
2642
+
2643
+ `string`
2644
+
2626
2645
  ## Additional Properties
2627
2646
 
2628
2647
  Additional properties are allowed and do not have to follow a specific schema
@@ -154,6 +154,7 @@ any of
154
154
  | [didAppellantSubmitCompletePhotosAndPlans](#didappellantsubmitcompletephotosandplans) | `boolean` | Optional | can be null | [Appeal S78 Case](appeal-s78-properties-didappellantsubmitcompletephotosandplans.md "appeal-s78.schema.json#/properties/didAppellantSubmitCompletePhotosAndPlans") |
155
155
  | [isSiteInAreaOfSpecialControlAdverts](#issiteinareaofspecialcontroladverts) | `boolean` | Optional | can be null | [Appeal S78 Case](appeal-s78-properties-issiteinareaofspecialcontroladverts.md "appeal-s78.schema.json#/properties/isSiteInAreaOfSpecialControlAdverts") |
156
156
  | [advertDetails](#advertdetails) | `array` | Optional | can be null | [Appeal S78 Case](appeal-s78-properties-advertdetails.md "appeal-s78.schema.json#/properties/advertDetails") |
157
+ | [padsSapId](#padssapid) | `string` | Required | can be null | [Appeal S78 Case](appeal-s78-properties-padssapid.md "appeal-s78.schema.json#/properties/padsSapId") |
157
158
  | Additional Properties | Any | Optional | can be null | |
158
159
 
159
160
  ## caseId
@@ -3692,6 +3693,24 @@ A list of advertisements for the appeal
3692
3693
 
3693
3694
  `object[]` ([Details](appeal-s78-properties-advertdetails-items.md))
3694
3695
 
3696
+ ## padsSapId
3697
+
3698
+ padsSapId for PADS inspectors
3699
+
3700
+ `padsSapId`
3701
+
3702
+ * is required
3703
+
3704
+ * Type: `string`
3705
+
3706
+ * can be null
3707
+
3708
+ * defined in: [Appeal S78 Case](appeal-s78-properties-padssapid.md "appeal-s78.schema.json#/properties/padsSapId")
3709
+
3710
+ ### padsSapId Type
3711
+
3712
+ `string`
3713
+
3695
3714
  ## Additional Properties
3696
3715
 
3697
3716
  Additional properties are allowed and do not have to follow a specific schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/data-model",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "JSON Schemas for the Planning Inspectorate's Data Model",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -9,7 +9,7 @@
9
9
  "require": "./src/index.cjs"
10
10
  },
11
11
  "scripts": {
12
- "commitlint": "commitlint --from=$(git cherry origin/main | head -n 1 | cut -c 3-)",
12
+ "commitlint": "commitlint --from=$(git rev-parse $(git cherry origin/main | head -n 1 | cut -c 3-)^1)",
13
13
  "gen": "npm run gen-docs && npm run gen-enums && npm run gen-types && npm run gen-cjs",
14
14
  "gen-docs": "node src/lib/gen-docs.js",
15
15
  "gen-enums": "node src/lib/gen-enums.js",
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: appeal-document.schema.json
3
- # timestamp: 2025-11-12T14:58:30+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: appeal-event.schema.json
3
- # timestamp: 2025-11-12T14:58:30+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: appeal-event-estimate.schema.json
3
- # timestamp: 2025-11-12T14:58:30+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: appeal-has.schema.json
3
- # timestamp: 2025-11-12T14:58:30+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -742,6 +742,10 @@ class AppealHasCase1(BaseModel):
742
742
  """
743
743
  A list of advertisements for the appeal
744
744
  """
745
+ padsSapId: str | None = None
746
+ """
747
+ padsSapId for PADS inspectors
748
+ """
745
749
 
746
750
 
747
751
  class AdvertDetail1(BaseModel):
@@ -1237,6 +1241,10 @@ class AppealHasCase2(BaseModel):
1237
1241
  """
1238
1242
  A list of advertisements for the appeal
1239
1243
  """
1244
+ padsSapId: str | None = None
1245
+ """
1246
+ padsSapId for PADS inspectors
1247
+ """
1240
1248
 
1241
1249
 
1242
1250
  class AppealHasCase(RootModel[AppealHasCase1 | AppealHasCase2]):
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: appeal-representation.schema.json
3
- # timestamp: 2025-11-12T14:58:30+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: appeal-s78.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -916,6 +916,10 @@ class AppealS78Case1(BaseModel):
916
916
  """
917
917
  A list of advertisements for the appeal
918
918
  """
919
+ padsSapId: str | None = None
920
+ """
921
+ padsSapId for PADS inspectors
922
+ """
919
923
 
920
924
 
921
925
  class AdvertDetail1(BaseModel):
@@ -1519,6 +1523,10 @@ class AppealS78Case2(BaseModel):
1519
1523
  """
1520
1524
  A list of advertisements for the appeal
1521
1525
  """
1526
+ padsSapId: str | None = None
1527
+ """
1528
+ padsSapId for PADS inspectors
1529
+ """
1522
1530
 
1523
1531
 
1524
1532
  class AppealS78Case(RootModel[AppealS78Case1 | AppealS78Case2]):
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: dart-response.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: entraid.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: folder.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: gettimesheets-response.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: listed-building.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: listed-buildings.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-document.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-exam-timetable.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-invoice.schema.json
3
- # timestamp: 2025-11-12T16:26:57+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -35,7 +35,7 @@ class NsipInvoice(BaseModel):
35
35
  The unique identifier within the Back Office. This is not the same as the case reference
36
36
  """
37
37
  caseReference: str | None = Field(..., examples=["BC0510001"])
38
- invoiceStage: InvoiceStage | None = Field(..., examples=["pre_acceptance"])
38
+ invoiceStage: InvoiceStage = Field(..., examples=["pre_acceptance"])
39
39
  """
40
40
  Invoice stage
41
41
  """
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-meeting.schema.json
3
- # timestamp: 2025-11-12T16:26:57+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -41,7 +41,7 @@ class NsipMeeting(BaseModel):
41
41
  """
42
42
  Meeting agenda
43
43
  """
44
- planningInspectorateRole: PlanningInspectorateRole | None = Field(
44
+ planningInspectorateRole: PlanningInspectorateRole = Field(
45
45
  ..., examples=["facilitator"]
46
46
  )
47
47
  """
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-project.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-project-update.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-representation.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: nsip-subscription.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: pins-inspector.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: pins-lpa.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: s51-advice.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: service-user.schema.json
3
- # timestamp: 2025-11-12T14:58:31+00:00
3
+ # timestamp: 2025-12-02T17:41:26+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -72,7 +72,8 @@
72
72
  "neighbouringSiteAddresses",
73
73
  "affectedListedBuildingNumbers",
74
74
  "appellantCostsAppliedFor",
75
- "lpaCostsAppliedFor"
75
+ "lpaCostsAppliedFor",
76
+ "padsSapId"
76
77
  ],
77
78
  "anyOf": [
78
79
  {
@@ -763,6 +764,10 @@
763
764
  },
764
765
  "description": "A list of advertisements for the appeal",
765
766
  "$comment": "Also available on CAS Adverts (ZA) cases"
767
+ },
768
+ "padsSapId": {
769
+ "type": ["string", "null"],
770
+ "description": "padsSapId for PADS inspectors"
766
771
  }
767
772
  }
768
773
  }
@@ -130,7 +130,8 @@
130
130
  "numberOfResidencesNetChange",
131
131
  "siteViewableFromRoad",
132
132
  "siteWithinSSSI",
133
- "typeOfPlanningApplication"
133
+ "typeOfPlanningApplication",
134
+ "padsSapId"
134
135
  ],
135
136
  "anyOf": [
136
137
  {
@@ -1087,6 +1088,10 @@
1087
1088
  },
1088
1089
  "description": "A list of advertisements for the appeal",
1089
1090
  "$comment": "Also available on CAS Adverts (ZA) cases"
1091
+ },
1092
+ "padsSapId": {
1093
+ "type": ["string", "null"],
1094
+ "description": "padsSapId for PADS inspectors"
1090
1095
  }
1091
1096
  }
1092
1097
  }
package/src/schemas.d.ts CHANGED
@@ -799,6 +799,10 @@ export type AppealHASCase = (
799
799
  [k: string]: unknown;
800
800
  }[]
801
801
  | null;
802
+ /**
803
+ * padsSapId for PADS inspectors
804
+ */
805
+ padsSapId: string | null;
802
806
  [k: string]: unknown;
803
807
  };
804
808
 
@@ -1505,6 +1509,10 @@ export type AppealS78Case = (
1505
1509
  [k: string]: unknown;
1506
1510
  }[]
1507
1511
  | null;
1512
+ /**
1513
+ * padsSapId for PADS inspectors
1514
+ */
1515
+ padsSapId: string | null;
1508
1516
  [k: string]: unknown;
1509
1517
  };
1510
1518
 
@@ -172,7 +172,8 @@ const appealHas = {
172
172
  isSiteOnHighwayLand: false,
173
173
  advertType: 'Other'
174
174
  }
175
- ]
175
+ ],
176
+ padsSapId: null
176
177
  };
177
178
 
178
179
  describe(schema, () => {
@@ -160,7 +160,8 @@ const appealS78 = {
160
160
  isSiteOnHighwayLand: false,
161
161
  advertType: 'Other'
162
162
  }
163
- ]
163
+ ],
164
+ padsSapId: null
164
165
  };
165
166
 
166
167
  describe(schema, () => {