@planning-inspectorate/data-model 2.48.0 → 2.48.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/data-model",
3
- "version": "2.48.0",
3
+ "version": "2.48.1",
4
4
  "description": "JSON Schemas for the Planning Inspectorate's Data Model",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/enums.cjs CHANGED
@@ -43,6 +43,12 @@ const APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION = Object.freeze({
43
43
  RESERVED_MATTERS: 'reserved-matters',
44
44
  });
45
45
 
46
+ const APPEAL_UNDER_ACT_SECTION = Object.freeze({
47
+ EXISTING_DEVELOPMENT: 'existing-development',
48
+ PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
49
+ PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
50
+ });
51
+
46
52
  const APPEAL_ALLOCATION_LEVEL = Object.freeze({
47
53
  A: 'A',
48
54
  B: 'B',
@@ -54,12 +60,6 @@ const APPEAL_ALLOCATION_LEVEL = Object.freeze({
54
60
  H: 'H',
55
61
  });
56
62
 
57
- const APPEAL_APPEAL_UNDER_ACT_SECTION = Object.freeze({
58
- EXISTING_DEVELOPMENT: 'existing-development',
59
- PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
60
- PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
61
- });
62
-
63
63
  const APPEAL_APPELLANT_PROCEDURE_PREFERENCE = Object.freeze({
64
64
  HEARING: 'hearing',
65
65
  INQUIRY: 'inquiry',
@@ -831,6 +831,9 @@ const STATUS = Object.freeze({
831
831
  UNCHECKED: 'unchecked',
832
832
  });
833
833
 
834
+ /** @deprecated use APPEAL_UNDER_ACT_SECTION **/
835
+ const APPEAL_APPEAL_UNDER_ACT_SECTION = APPEAL_UNDER_ACT_SECTION;
836
+
834
837
  exports.APPEAL_ALLOCATION_LEVEL = APPEAL_ALLOCATION_LEVEL;
835
838
  exports.APPEAL_APPEAL_UNDER_ACT_SECTION = APPEAL_APPEAL_UNDER_ACT_SECTION;
836
839
  exports.APPEAL_APPELLANT_PROCEDURE_PREFERENCE = APPEAL_APPELLANT_PROCEDURE_PREFERENCE;
@@ -868,6 +871,7 @@ exports.APPEAL_REPRESENTATION_TYPE = APPEAL_REPRESENTATION_TYPE;
868
871
  exports.APPEAL_SOURCE = APPEAL_SOURCE;
869
872
  exports.APPEAL_SOURCE_SYSTEM = APPEAL_SOURCE_SYSTEM;
870
873
  exports.APPEAL_TYPE_OF_PLANNING_APPLICATION = APPEAL_TYPE_OF_PLANNING_APPLICATION;
874
+ exports.APPEAL_UNDER_ACT_SECTION = APPEAL_UNDER_ACT_SECTION;
871
875
  exports.APPEAL_VIRUS_CHECK_STATUS = APPEAL_VIRUS_CHECK_STATUS;
872
876
  exports.APPLICATION_UPDATE_STATUS = APPLICATION_UPDATE_STATUS;
873
877
  exports.CASE_STAGE = CASE_STAGE;
package/src/enums.d.ts CHANGED
@@ -41,6 +41,12 @@ export const APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION = {
41
41
  RESERVED_MATTERS: 'reserved-matters',
42
42
  } as const;
43
43
 
44
+ export const APPEAL_UNDER_ACT_SECTION = {
45
+ EXISTING_DEVELOPMENT: 'existing-development',
46
+ PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
47
+ PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
48
+ } as const;
49
+
44
50
  export const APPEAL_ALLOCATION_LEVEL = {
45
51
  A: 'A',
46
52
  B: 'B',
@@ -52,12 +58,6 @@ export const APPEAL_ALLOCATION_LEVEL = {
52
58
  H: 'H',
53
59
  } as const;
54
60
 
55
- export const APPEAL_APPEAL_UNDER_ACT_SECTION = {
56
- EXISTING_DEVELOPMENT: 'existing-development',
57
- PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
58
- PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
59
- } as const;
60
-
61
61
  export const APPEAL_APPELLANT_PROCEDURE_PREFERENCE = {
62
62
  HEARING: 'hearing',
63
63
  INQUIRY: 'inquiry',
@@ -829,3 +829,5 @@ export const STATUS = {
829
829
  UNCHECKED: 'unchecked',
830
830
  } as const;
831
831
 
832
+ /** @deprecated use APPEAL_UNDER_ACT_SECTION **/
833
+ export const APPEAL_APPEAL_UNDER_ACT_SECTION = APPEAL_UNDER_ACT_SECTION;
package/src/enums.js CHANGED
@@ -41,6 +41,12 @@ export const APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION = Object.freeze({
41
41
  RESERVED_MATTERS: 'reserved-matters',
42
42
  });
43
43
 
44
+ export const APPEAL_UNDER_ACT_SECTION = Object.freeze({
45
+ EXISTING_DEVELOPMENT: 'existing-development',
46
+ PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
47
+ PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
48
+ });
49
+
44
50
  export const APPEAL_ALLOCATION_LEVEL = Object.freeze({
45
51
  A: 'A',
46
52
  B: 'B',
@@ -52,12 +58,6 @@ export const APPEAL_ALLOCATION_LEVEL = Object.freeze({
52
58
  H: 'H',
53
59
  });
54
60
 
55
- export const APPEAL_APPEAL_UNDER_ACT_SECTION = Object.freeze({
56
- EXISTING_DEVELOPMENT: 'existing-development',
57
- PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
58
- PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
59
- });
60
-
61
61
  export const APPEAL_APPELLANT_PROCEDURE_PREFERENCE = Object.freeze({
62
62
  HEARING: 'hearing',
63
63
  INQUIRY: 'inquiry',
@@ -829,3 +829,5 @@ export const STATUS = Object.freeze({
829
829
  UNCHECKED: 'unchecked',
830
830
  });
831
831
 
832
+ /** @deprecated use APPEAL_UNDER_ACT_SECTION **/
833
+ export const APPEAL_APPEAL_UNDER_ACT_SECTION = APPEAL_UNDER_ACT_SECTION;
package/src/index.cjs CHANGED
@@ -124,6 +124,12 @@ const APPEAL_HAS_TYPE_OF_PLANNING_APPLICATION = Object.freeze({
124
124
  RESERVED_MATTERS: 'reserved-matters',
125
125
  });
126
126
 
127
+ const APPEAL_UNDER_ACT_SECTION = Object.freeze({
128
+ EXISTING_DEVELOPMENT: 'existing-development',
129
+ PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
130
+ PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
131
+ });
132
+
127
133
  const APPEAL_ALLOCATION_LEVEL = Object.freeze({
128
134
  A: 'A',
129
135
  B: 'B',
@@ -135,12 +141,6 @@ const APPEAL_ALLOCATION_LEVEL = Object.freeze({
135
141
  H: 'H',
136
142
  });
137
143
 
138
- const APPEAL_APPEAL_UNDER_ACT_SECTION = Object.freeze({
139
- EXISTING_DEVELOPMENT: 'existing-development',
140
- PROPOSED_CHANGES_TO_A_LISTED_BUILDING: 'proposed-changes-to-a-listed-building',
141
- PROPOSED_USE_OF_A_DEVELOPMENT: 'proposed-use-of-a-development',
142
- });
143
-
144
144
  const APPEAL_APPELLANT_PROCEDURE_PREFERENCE = Object.freeze({
145
145
  HEARING: 'hearing',
146
146
  INQUIRY: 'inquiry',
@@ -912,6 +912,9 @@ const STATUS = Object.freeze({
912
912
  UNCHECKED: 'unchecked',
913
913
  });
914
914
 
915
+ /** @deprecated use APPEAL_UNDER_ACT_SECTION **/
916
+ const APPEAL_APPEAL_UNDER_ACT_SECTION = APPEAL_UNDER_ACT_SECTION;
917
+
915
918
  const __dirname$1 = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
916
919
 
917
920
  const schemasPath = path.join(__dirname$1, '..', 'schemas');
@@ -981,6 +984,7 @@ exports.APPEAL_REPRESENTATION_TYPE = APPEAL_REPRESENTATION_TYPE;
981
984
  exports.APPEAL_SOURCE = APPEAL_SOURCE;
982
985
  exports.APPEAL_SOURCE_SYSTEM = APPEAL_SOURCE_SYSTEM;
983
986
  exports.APPEAL_TYPE_OF_PLANNING_APPLICATION = APPEAL_TYPE_OF_PLANNING_APPLICATION;
987
+ exports.APPEAL_UNDER_ACT_SECTION = APPEAL_UNDER_ACT_SECTION;
984
988
  exports.APPEAL_VIRUS_CHECK_STATUS = APPEAL_VIRUS_CHECK_STATUS;
985
989
  exports.APPLICATION_UPDATE_STATUS = APPLICATION_UPDATE_STATUS;
986
990
  exports.CASE_STAGE = CASE_STAGE;
@@ -57,7 +57,10 @@ export function generateEnumMap(enums) {
57
57
 
58
58
  for (const e of enums) {
59
59
  const prefix = schemaPrefix(e.schemaName);
60
- const key = prefix ? prefix + '_' + e.key : e.key;
60
+ let key = e.key;
61
+ if (prefix && !key.startsWith(prefix)) {
62
+ key = prefix + '_' + key;
63
+ }
61
64
 
62
65
  const existingEnum = enumProps[key];
63
66
  const thisEnum = e.values;
@@ -187,6 +190,9 @@ export function schemaPrefix(schemaName) {
187
190
  if (schemaName === 'message') {
188
191
  return 'message';
189
192
  }
193
+ if (schemaName.toLowerCase().includes('applications')) {
194
+ return 'application';
195
+ }
190
196
  if (schemaName.toLowerCase().includes('appeal')) {
191
197
  return 'appeal';
192
198
  }
@@ -37,6 +37,11 @@ async function run() {
37
37
  tsOutput += generateConstants(name, enumProps[name], { ts: true }) + NEW_LINE.repeat(2);
38
38
  }
39
39
 
40
+ // for backwards compatibility, to remove once APPEAL_APPEAL_UNDER_ACT_SECTION isn't referenced
41
+ const forCompatibility = `/** @deprecated use APPEAL_UNDER_ACT_SECTION **/${NEW_LINE}export const APPEAL_APPEAL_UNDER_ACT_SECTION = APPEAL_UNDER_ACT_SECTION;`;
42
+ output += forCompatibility;
43
+ tsOutput += forCompatibility;
44
+
40
45
  await fs.writeFile(constPath, output);
41
46
  await fs.writeFile(constTsPath, tsOutput);
42
47
  }
@@ -72,6 +72,7 @@ describe('schemas', () => {
72
72
  it('should use the singular form for $id', () => {
73
73
  // very crude test to ensure schemas don't end in 's'...
74
74
  const suffixExceptions = [
75
+ 'address',
75
76
  'has', // allow has suffix for appeals
76
77
  'listed-buildings' // allow this temporary schema, to remove when this schema copy is removed
77
78
  ];