@planning-inspectorate/data-model 2.39.0 → 2.41.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.
@@ -265,6 +265,39 @@ class AdvertDetail(BaseModel):
265
265
  """
266
266
 
267
267
 
268
+ class AdvertDetail1(BaseModel):
269
+ model_config = ConfigDict(
270
+ extra="allow",
271
+ )
272
+ advertType: AdvertType
273
+ isAdvertInPosition: bool | None = None
274
+ """
275
+ Is the advertisement in position?
276
+ """
277
+ isSiteOnHighwayLand: bool | None = None
278
+ """
279
+ Is the site on highway land?
280
+ """
281
+
282
+
283
+ class SignificantChangesAffectingApplication(Enum):
284
+ adopted_a_new_local_plan = "adopted-a-new-local-plan"
285
+ national_policy_change = "national-policy-change"
286
+ court_judgement = "court-judgement"
287
+ other = "other"
288
+ NoneType_None = None
289
+
290
+
291
+ class SignificantChangesAffectingApplicationAppellantItem(BaseModel):
292
+ value: SignificantChangesAffectingApplication
293
+ comment: str | None = None
294
+
295
+
296
+ class SignificantChangesAffectingApplicationLpaItem(BaseModel):
297
+ value: SignificantChangesAffectingApplication
298
+ comment: str | None = None
299
+
300
+
268
301
  class AppealHasCase1(BaseModel):
269
302
  """
270
303
  Group A - Schema defining the metadata for an appeal
@@ -753,20 +786,21 @@ class AppealHasCase1(BaseModel):
753
786
  """
754
787
  padsSapId for PADS inspectors
755
788
  """
756
-
757
-
758
- class AdvertDetail1(BaseModel):
759
- model_config = ConfigDict(
760
- extra="allow",
761
- )
762
- advertType: AdvertType
763
- isAdvertInPosition: bool | None = None
789
+ reasonForAppealAppellant: str | None = None
764
790
  """
765
- Is the advertisement in position?
791
+ Reason for appeal as provided by the appellant
766
792
  """
767
- isSiteOnHighwayLand: bool | None = None
793
+ significantChangesAffectingApplicationAppellant: (
794
+ list[SignificantChangesAffectingApplicationAppellantItem] | None
795
+ ) = None
768
796
  """
769
- Is the site on highway land?
797
+ Significant changes affecting the application as reported by the appellant
798
+ """
799
+ significantChangesAffectingApplicationLpa: (
800
+ list[SignificantChangesAffectingApplicationLpaItem] | None
801
+ ) = None
802
+ """
803
+ Significant changes affecting the application as reported by the LPA
770
804
  """
771
805
 
772
806
 
@@ -1258,6 +1292,22 @@ class AppealHasCase2(BaseModel):
1258
1292
  """
1259
1293
  padsSapId for PADS inspectors
1260
1294
  """
1295
+ reasonForAppealAppellant: str | None = None
1296
+ """
1297
+ Reason for appeal as provided by the appellant
1298
+ """
1299
+ significantChangesAffectingApplicationAppellant: (
1300
+ list[SignificantChangesAffectingApplicationAppellantItem] | None
1301
+ ) = None
1302
+ """
1303
+ Significant changes affecting the application as reported by the appellant
1304
+ """
1305
+ significantChangesAffectingApplicationLpa: (
1306
+ list[SignificantChangesAffectingApplicationLpaItem] | None
1307
+ ) = None
1308
+ """
1309
+ Significant changes affecting the application as reported by the LPA
1310
+ """
1261
1311
 
1262
1312
 
1263
1313
  class AppealHasCase(RootModel[AppealHasCase1 | AppealHasCase2]):
@@ -776,6 +776,50 @@
776
776
  "padsSapId": {
777
777
  "type": ["string", "null"],
778
778
  "description": "padsSapId for PADS inspectors"
779
+ },
780
+ "reasonForAppealAppellant": {
781
+ "type": ["string", "null"],
782
+ "description": "Reason for appeal as provided by the appellant"
783
+ },
784
+ "significantChangesAffectingApplicationAppellant": {
785
+ "type": ["array", "null"],
786
+ "items": {
787
+ "type": "object",
788
+ "properties": {
789
+ "value": {
790
+ "$ref": "#/definitions/SignificantChangesAffectingApplication",
791
+ "type": ["string", "null"]
792
+ },
793
+ "comment": {
794
+ "type": ["string", "null"]
795
+ }
796
+ },
797
+ "required": ["value"]
798
+ },
799
+ "description": "Significant changes affecting the application as reported by the appellant"
800
+ },
801
+ "significantChangesAffectingApplicationLpa": {
802
+ "type": ["array", "null"],
803
+ "items": {
804
+ "type": "object",
805
+ "properties": {
806
+ "value": {
807
+ "$ref": "#/definitions/SignificantChangesAffectingApplication",
808
+ "type": ["string", "null"]
809
+ },
810
+ "comment": {
811
+ "type": ["string", "null"]
812
+ }
813
+ },
814
+ "required": ["value"]
815
+ },
816
+ "description": "Significant changes affecting the application as reported by the LPA"
817
+ }
818
+ },
819
+ "definitions": {
820
+ "SignificantChangesAffectingApplication": {
821
+ "type": ["string", "null"],
822
+ "enum": ["adopted-a-new-local-plan", "national-policy-change", "court-judgement", "other", null]
779
823
  }
780
824
  }
781
825
  }
@@ -56,6 +56,23 @@
56
56
  "type": ["string", "null"],
57
57
  "examples": ["We refused the application because of ..."],
58
58
  "description": "A statement provided by the LPA, unused?"
59
+ },
60
+ "significantChangesAffectingApplicationLpa": {
61
+ "type": ["array", "null"],
62
+ "items": {
63
+ "type": "object",
64
+ "properties": {
65
+ "value": {
66
+ "type": ["string", "null"],
67
+ "enum": ["adopted-a-new-local-plan", "national-policy-change", "court-judgement", "other", null]
68
+ },
69
+ "comment": {
70
+ "type": ["string", "null"]
71
+ }
72
+ },
73
+ "required": ["value"]
74
+ },
75
+ "description": "Significant changes affecting the application as reported by the LPA"
59
76
  }
60
77
  }
61
78
  }
package/src/schemas.d.ts CHANGED
@@ -834,6 +834,28 @@ export type AppealHASCase = (GridReference | SiteAddress) & {
834
834
  * padsSapId for PADS inspectors
835
835
  */
836
836
  padsSapId?: string | null;
837
+ /**
838
+ * Reason for appeal as provided by the appellant
839
+ */
840
+ reasonForAppealAppellant?: string | null;
841
+ /**
842
+ * Significant changes affecting the application as reported by the appellant
843
+ */
844
+ significantChangesAffectingApplicationAppellant?:
845
+ | {
846
+ value: 'adopted-a-new-local-plan' | 'national-policy-change' | 'court-judgement' | 'other' | null;
847
+ comment?: string | null;
848
+ }[]
849
+ | null;
850
+ /**
851
+ * Significant changes affecting the application as reported by the LPA
852
+ */
853
+ significantChangesAffectingApplicationLpa?:
854
+ | {
855
+ value: 'adopted-a-new-local-plan' | 'national-policy-change' | 'court-judgement' | 'other' | null;
856
+ comment?: string | null;
857
+ }[]
858
+ | null;
837
859
  [k: string]: unknown;
838
860
  };
839
861
 
@@ -4481,6 +4503,15 @@ export type LPAQHASSubmissionProperties = {
4481
4503
  * A statement provided by the LPA, unused?
4482
4504
  */
4483
4505
  lpaStatement?: string | null;
4506
+ /**
4507
+ * Significant changes affecting the application as reported by the LPA
4508
+ */
4509
+ significantChangesAffectingApplicationLpa?:
4510
+ | {
4511
+ value: 'adopted-a-new-local-plan' | 'national-policy-change' | 'court-judgement' | 'other' | null;
4512
+ comment?: string | null;
4513
+ }[]
4514
+ | null;
4484
4515
  };
4485
4516
  /**
4486
4517
  * Schema defining any S78 specific properties for LPAQ submissions
@@ -174,7 +174,13 @@ const appealHas = {
174
174
  advertType: 'Other'
175
175
  }
176
176
  ],
177
- padsSapId: null
177
+ padsSapId: null,
178
+ reasonForAppealAppellant: 'This is my reason for appeal',
179
+ significantChangesAffectingApplicationAppellant: [
180
+ { value: 'adopted-a-new-local-plan', comment: 'Plan adopted last month' },
181
+ { value: 'other', comment: 'General policy shift' }
182
+ ],
183
+ significantChangesAffectingApplicationLpa: null
178
184
  };
179
185
 
180
186
  describe(schema, () => {
@@ -267,4 +273,37 @@ describe(schema, () => {
267
273
  const validationResult = ajv.validate(schema, test);
268
274
  assert.strictEqual(validationResult, false);
269
275
  });
276
+
277
+ it('should allow null for new attributes', () => {
278
+ const test = structuredClone(appealHas);
279
+ test.reasonForAppealAppellant = null;
280
+ test.significantChangesAffectingApplicationAppellant = null;
281
+ test.significantChangesAffectingApplicationLpa = null;
282
+ const validationResult = ajv.validate(schema, test);
283
+ if (!validationResult) {
284
+ console.error(ajv.errors);
285
+ }
286
+ assert.strictEqual(validationResult, true);
287
+ });
288
+
289
+ it('should enforce enum for significantChangesAffectingApplication', () => {
290
+ const test = structuredClone(appealHas);
291
+ test.significantChangesAffectingApplicationAppellant = [{ value: 'invalid-enum-value', comment: 'some comment' }];
292
+ const validationResult = ajv.validate(schema, test);
293
+ assert.strictEqual(validationResult, false);
294
+ });
295
+
296
+ it('should enforce required value for significantChangesAffectingApplication entries', () => {
297
+ const test = structuredClone(appealHas);
298
+ test.significantChangesAffectingApplicationAppellant = [{ comment: 'some comment' }];
299
+ const validationResult = ajv.validate(schema, test);
300
+ assert.strictEqual(validationResult, false);
301
+ });
302
+
303
+ it('should allow missing/null comment for significantChangesAffectingApplication entries', () => {
304
+ const test = structuredClone(appealHas);
305
+ test.significantChangesAffectingApplicationAppellant = [{ value: 'adopted-a-new-local-plan' }];
306
+ const validationResult = ajv.validate(schema, test);
307
+ assert.strictEqual(validationResult, true);
308
+ });
270
309
  });