@planning-inspectorate/data-model 1.17.0 → 1.18.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/data-model",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "JSON Schemas for the Planning Inspectorate's Data Model",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "commands/appeal-advert.submission.schema.json",
4
+ "title": "Advert specific properties",
5
+ "description": "Schema defining any properties for advertisement appeals",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": ["isSiteOnHighwayLand", "isAdvertInPosition", "hasLandownersPermission"],
9
+ "properties": {
10
+ "hasLandownersPermission": {
11
+ "type": ["boolean", "null"],
12
+ "description": "Indicates if the appellant has land owners permission"
13
+ },
14
+ "isAdvertInPosition": {
15
+ "type": ["boolean", "null"],
16
+ "description": "Indicates if the advert is already in position"
17
+ },
18
+ "isSiteOnHighwayLand": {
19
+ "type": ["boolean", "null"],
20
+ "description": "Indicates if site is on highway land"
21
+ }
22
+ }
23
+ }
@@ -16,16 +16,28 @@
16
16
  "applicationDecision",
17
17
  "applicationDecisionDate",
18
18
  "caseSubmissionDueDate",
19
- "siteAddressLine1",
20
- "siteAddressLine2",
21
- "siteAddressTown",
22
- "siteAddressCounty",
23
- "siteAddressPostcode",
24
19
  "siteAccessDetails",
25
20
  "siteSafetyDetails",
26
21
  "neighbouringSiteAddresses",
27
22
  "nearbyCaseReferences"
28
23
  ],
24
+ "anyOf": [
25
+ {
26
+ "required": ["siteGridReferenceEasting", "siteGridReferenceNorthing"],
27
+ "properties": {
28
+ "siteGridReferenceEasting": { "not": { "type": "null" } },
29
+ "siteGridReferenceNorthing": { "not": { "type": "null" } }
30
+ }
31
+ },
32
+ {
33
+ "required": ["siteAddressLine1", "siteAddressTown", "siteAddressPostcode"],
34
+ "properties": {
35
+ "siteAddressLine1": { "not": { "type": "null" } },
36
+ "siteAddressTown": { "not": { "type": "null" } },
37
+ "siteAddressPostcode": { "not": { "type": "null" } }
38
+ }
39
+ }
40
+ ],
29
41
  "properties": {
30
42
  "submissionId": {
31
43
  "type": "string",
@@ -84,7 +96,7 @@
84
96
  "$comment": "Calculated from the applicationDecisionDate"
85
97
  },
86
98
  "siteAddressLine1": {
87
- "type": "string",
99
+ "type": ["string", "null"],
88
100
  "examples": ["96 The Avenue"],
89
101
  "description": "First line of address for the appeal site"
90
102
  },
@@ -93,7 +105,7 @@
93
105
  "description": "Second line of address for the appeal site"
94
106
  },
95
107
  "siteAddressTown": {
96
- "type": "string",
108
+ "type": ["string", "null"],
97
109
  "examples": ["Maidstone"],
98
110
  "description": "Town / City of the site address"
99
111
  },
@@ -103,10 +115,20 @@
103
115
  "description": "County of the site address"
104
116
  },
105
117
  "siteAddressPostcode": {
106
- "type": "string",
118
+ "type": ["string", "null"],
107
119
  "examples": ["MD21 5XY"],
108
120
  "description": "Postal code of the site address"
109
121
  },
122
+ "siteGridReferenceEasting": {
123
+ "type": ["string", "null"],
124
+ "pattern": "^\\d{6}$",
125
+ "examples": ["357144"]
126
+ },
127
+ "siteGridReferenceNorthing": {
128
+ "type": ["string", "null"],
129
+ "pattern": "^\\d{6}$",
130
+ "examples": ["400534"]
131
+ },
110
132
  "siteAccessDetails": {
111
133
  "type": ["array", "null"],
112
134
  "items": {
@@ -20,7 +20,6 @@
20
20
  "appellantCostsAppliedFor"
21
21
  ],
22
22
  "allOf": [
23
- { "$ref": "appeal-common-submission.schema.json" },
24
23
  {
25
24
  "properties": {
26
25
  "isGreenBelt": {
@@ -19,7 +19,6 @@
19
19
  "developmentType"
20
20
  ],
21
21
  "allOf": [
22
- { "$ref": "appeal-has-submission.schema.json" },
23
22
  {
24
23
  "properties": {
25
24
  "agriculturalHolding": {
@@ -14,19 +14,30 @@
14
14
  "required": ["caseType"],
15
15
  "oneOf": [
16
16
  {
17
- "allOf": [{ "properties": { "caseType": { "const": "D" } } }, { "$ref": "appeal-has-submission.schema.json" }]
18
- },
19
- {
17
+ "$comment": "Householder + CAS Planning",
20
18
  "allOf": [
21
- { "properties": { "caseType": { "const": "ZP" } } },
19
+ { "properties": { "caseType": { "enum": ["D", "ZP"] } } },
20
+ { "$ref": "appeal-common-submission.schema.json" },
22
21
  { "$ref": "appeal-has-submission.schema.json" }
23
22
  ]
24
23
  },
25
24
  {
26
- "allOf": [{ "properties": { "caseType": { "const": "W" } } }, { "$ref": "appeal-s78-submission.schema.json" }]
25
+ "$comment": "S78 + S20",
26
+ "allOf": [
27
+ { "properties": { "caseType": { "enum": ["W", "Y"] } } },
28
+ { "$ref": "appeal-common-submission.schema.json" },
29
+ { "$ref": "appeal-has-submission.schema.json" },
30
+ { "$ref": "appeal-s78-submission.schema.json" }
31
+ ]
27
32
  },
28
33
  {
29
- "allOf": [{ "properties": { "caseType": { "const": "Y" } } }, { "$ref": "appeal-s78-submission.schema.json" }]
34
+ "$comment": "Adverts + CAS Adverts",
35
+ "allOf": [
36
+ { "properties": { "caseType": { "enum": ["H", "ZA"] } } },
37
+ { "$ref": "appeal-common-submission.schema.json" },
38
+ { "$ref": "appeal-has-submission.schema.json" },
39
+ { "$ref": "appeal-advert.submission.schema.json" }
40
+ ]
30
41
  }
31
42
  ]
32
43
  },
@@ -16,7 +16,6 @@
16
16
  "lpaStatement"
17
17
  ],
18
18
  "allOf": [
19
- { "$ref": "lpa-questionnaire-common.schema.json" },
20
19
  {
21
20
  "properties": {
22
21
  "isCorrectAppealType": {
@@ -35,7 +35,6 @@
35
35
  "lpaProcedurePreferenceDuration"
36
36
  ],
37
37
  "allOf": [
38
- { "$ref": "lpa-questionnaire-has.schema.json" },
39
38
  {
40
39
  "properties": {
41
40
  "changedListedBuildingNumbers": {
@@ -11,27 +11,29 @@
11
11
  "casedata": {
12
12
  "type": "object",
13
13
  "additionalProperties": true,
14
- "anyOf": [
14
+ "oneOf": [
15
15
  {
16
+ "$comment": "Householder + CAS Planning",
16
17
  "allOf": [
17
- { "$comment": "backwards compatibility for no case type, when removed can update allOf to oneOf" },
18
- { "not": { "required": ["caseType"] } },
18
+ { "properties": { "caseType": { "enum": ["D", "ZP"] } } },
19
+ { "$ref": "lpa-questionnaire-common.schema.json" },
19
20
  { "$ref": "lpa-questionnaire-has.schema.json" }
20
21
  ]
21
22
  },
22
23
  {
23
- "allOf": [{ "properties": { "caseType": { "const": "W" } } }, { "$ref": "lpa-questionnaire-s78.schema.json" }]
24
- },
25
- {
26
- "allOf": [{ "properties": { "caseType": { "const": "Y" } } }, { "$ref": "lpa-questionnaire-s78.schema.json" }]
27
- },
28
- {
29
- "allOf": [{ "properties": { "caseType": { "const": "D" } } }, { "$ref": "lpa-questionnaire-has.schema.json" }]
24
+ "$comment": "S78 + S20",
25
+ "allOf": [
26
+ { "properties": { "caseType": { "enum": ["W", "Y"] } } },
27
+ { "$ref": "lpa-questionnaire-common.schema.json" },
28
+ { "$ref": "lpa-questionnaire-has.schema.json" },
29
+ { "$ref": "lpa-questionnaire-s78.schema.json" }
30
+ ]
30
31
  },
31
32
  {
33
+ "$comment": "Adverts + CAS Adverts - TBD - may need separate schemas",
32
34
  "allOf": [
33
- { "properties": { "caseType": { "const": "ZP" } } },
34
- { "$ref": "lpa-questionnaire-has.schema.json" }
35
+ { "properties": { "caseType": { "enum": ["H", "ZA"] } } },
36
+ { "$ref": "lpa-questionnaire-common.schema.json" }
35
37
  ]
36
38
  }
37
39
  ]