@planning-inspectorate/data-model 1.13.0 → 1.15.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/.husky/pre-commit +1 -1
- package/README.md +1 -0
- package/docs/appeal-s78.md +62 -0
- package/package.json +7 -4
- package/pins_data_model/models/model_appeal_document.py +1 -1
- package/pins_data_model/models/model_appeal_event.py +1 -1
- package/pins_data_model/models/model_appeal_event_estimate.py +1 -1
- package/pins_data_model/models/model_appeal_has.py +1 -1
- package/pins_data_model/models/model_appeal_representation.py +1 -1
- package/pins_data_model/models/model_appeal_s78.py +7 -1
- package/pins_data_model/models/model_dart_response.py +1 -1
- package/pins_data_model/models/model_entraid.py +1 -1
- package/pins_data_model/models/model_folder.py +1 -1
- package/pins_data_model/models/model_gettimesheets_response.py +1 -1
- package/pins_data_model/models/model_listed_building.py +1 -1
- package/pins_data_model/models/model_listed_buildings.py +1 -1
- package/pins_data_model/models/model_nsip_document.py +1 -1
- package/pins_data_model/models/model_nsip_exam_timetable.py +1 -1
- package/pins_data_model/models/model_nsip_project.py +1 -1
- package/pins_data_model/models/model_nsip_project_update.py +1 -1
- package/pins_data_model/models/model_nsip_representation.py +1 -1
- package/pins_data_model/models/model_nsip_subscription.py +1 -1
- package/pins_data_model/models/model_pins_inspector.py +1 -1
- package/pins_data_model/models/model_pins_lpa.py +1 -1
- package/pins_data_model/models/model_s51_advice.py +1 -1
- package/pins_data_model/models/model_service_user.py +1 -1
- package/schemas/appeal-s78.schema.json +12 -0
- package/src/enums.cjs +9 -0
- package/src/enums.d.ts +8 -0
- package/src/enums.js +8 -0
- package/src/index.cjs +9 -0
- package/src/lib/enums-static.schema.json +14 -0
- package/src/{gen-docs.js → lib/gen-docs.js} +1 -1
- package/src/{gen-enums.js → lib/gen-enums.js} +7 -3
- package/src/{gen-types.js → lib/gen-types.js} +3 -3
- package/src/lib/load.js +1 -1
- package/src/schemas.d.ts +2 -0
package/.husky/pre-commit
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
npx lint-staged
|
|
1
|
+
npx lint-staged
|
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ All messages over the enterprise service bus are in Data Model compliant formats
|
|
|
9
9
|
* Messages broadcast over the service bus must be pre-validated against the schema.
|
|
10
10
|
* Each service bus topic corresponds to one schema.
|
|
11
11
|
* Each message encompasses the complete state of an entity (as defined by [ECST](https://blogs.mulesoft.com/api-integration/strategy/event-carried-state-messages/)) and does not delineate specific changes (the delta).
|
|
12
|
+
* Each message will include a message event type, which is sent as `applicationProperties.type` (see [applicationProperties](https://learn.microsoft.com/en-us/javascript/api/%40azure/service-bus/servicebusmessage?view=azure-node-latest#@azure-service-bus-servicebusmessage-applicationproperties)), and is one of the values defined by the `eventType` enum in [enums-static.schema.json](./src/lib/enums-static.schema.json)
|
|
12
13
|
* Consumers must support processing related messages received through different topics regardless of the order in which they are sent.
|
|
13
14
|
* Values required by the Data Model cannot be null, while optional values must be null if they have no value.
|
|
14
15
|
|
package/docs/appeal-s78.md
CHANGED
|
@@ -141,6 +141,8 @@
|
|
|
141
141
|
| [siteWithinSSSI](#sitewithinsssi) | `boolean` | Required | can be null | [Appeal S78 Case](appeal-s78-properties-sitewithinsssi.md "appeal-s78.schema.json#/properties/siteWithinSSSI") |
|
|
142
142
|
| [typeOfPlanningApplication](#typeofplanningapplication) | `string` | Required | can be null | [Appeal S78 Case](appeal-s78-properties-typeofplanningapplication.md "appeal-s78.schema.json#/properties/typeOfPlanningApplication") |
|
|
143
143
|
| [developmentType](#developmenttype) | `string` | Required | can be null | [Appeal S78 Case](appeal-s78-properties-developmenttype.md "appeal-s78.schema.json#/properties/developmentType") |
|
|
144
|
+
| [statementOfCommonGroundDueDate](#statementofcommongroundduedate) | `string` | Optional | can be null | [Appeal S78 Case](appeal-s78-properties-statementofcommongroundduedate.md "appeal-s78.schema.json#/properties/statementOfCommonGroundDueDate") |
|
|
145
|
+
| [planningObligationDueDate](#planningobligationduedate) | `string` | Optional | can be null | [Appeal S78 Case](appeal-s78-properties-planningobligationduedate.md "appeal-s78.schema.json#/properties/planningObligationDueDate") |
|
|
144
146
|
| Additional Properties | Any | Optional | can be null | |
|
|
145
147
|
|
|
146
148
|
## caseId
|
|
@@ -3602,6 +3604,66 @@ The net gain in residences of the proposed development
|
|
|
3602
3604
|
| `"other-minor"` | |
|
|
3603
3605
|
| `null` | |
|
|
3604
3606
|
|
|
3607
|
+
## statementOfCommonGroundDueDate
|
|
3608
|
+
|
|
3609
|
+
|
|
3610
|
+
|
|
3611
|
+
> Only available in S78 cases
|
|
3612
|
+
|
|
3613
|
+
`statementOfCommonGroundDueDate`
|
|
3614
|
+
|
|
3615
|
+
* is optional
|
|
3616
|
+
|
|
3617
|
+
* Type: `string`
|
|
3618
|
+
|
|
3619
|
+
* can be null
|
|
3620
|
+
|
|
3621
|
+
* defined in: [Appeal S78 Case](appeal-s78-properties-statementofcommongroundduedate.md "appeal-s78.schema.json#/properties/statementOfCommonGroundDueDate")
|
|
3622
|
+
|
|
3623
|
+
### statementOfCommonGroundDueDate Type
|
|
3624
|
+
|
|
3625
|
+
`string`
|
|
3626
|
+
|
|
3627
|
+
### statementOfCommonGroundDueDate Constraints
|
|
3628
|
+
|
|
3629
|
+
**date time**: the string must be a date time string, according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339 "check the specification")
|
|
3630
|
+
|
|
3631
|
+
### statementOfCommonGroundDueDate Examples
|
|
3632
|
+
|
|
3633
|
+
```json
|
|
3634
|
+
"2023-07-27T20:30:00.000Z"
|
|
3635
|
+
```
|
|
3636
|
+
|
|
3637
|
+
## planningObligationDueDate
|
|
3638
|
+
|
|
3639
|
+
|
|
3640
|
+
|
|
3641
|
+
> Only available in S78 cases
|
|
3642
|
+
|
|
3643
|
+
`planningObligationDueDate`
|
|
3644
|
+
|
|
3645
|
+
* is optional
|
|
3646
|
+
|
|
3647
|
+
* Type: `string`
|
|
3648
|
+
|
|
3649
|
+
* can be null
|
|
3650
|
+
|
|
3651
|
+
* defined in: [Appeal S78 Case](appeal-s78-properties-planningobligationduedate.md "appeal-s78.schema.json#/properties/planningObligationDueDate")
|
|
3652
|
+
|
|
3653
|
+
### planningObligationDueDate Type
|
|
3654
|
+
|
|
3655
|
+
`string`
|
|
3656
|
+
|
|
3657
|
+
### planningObligationDueDate Constraints
|
|
3658
|
+
|
|
3659
|
+
**date time**: the string must be a date time string, according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339 "check the specification")
|
|
3660
|
+
|
|
3661
|
+
### planningObligationDueDate Examples
|
|
3662
|
+
|
|
3663
|
+
```json
|
|
3664
|
+
"2023-07-27T20:30:00.000Z"
|
|
3665
|
+
```
|
|
3666
|
+
|
|
3605
3667
|
## Additional Properties
|
|
3606
3668
|
|
|
3607
3669
|
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": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "JSON Schemas for the Planning Inspectorate's Data Model",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"commitlint": "commitlint --from=$(git cherry origin/main | head -n 1 | cut -c 3-)",
|
|
13
13
|
"gen": "npm run gen-docs && npm run gen-enums && npm run gen-types && npm run gen-cjs",
|
|
14
|
-
"gen-docs": "node src/gen-docs.js",
|
|
15
|
-
"gen-enums": "node src/gen-enums.js",
|
|
16
|
-
"gen-types": "node src/gen-types.js",
|
|
14
|
+
"gen-docs": "node src/lib/gen-docs.js",
|
|
15
|
+
"gen-enums": "node src/lib/gen-enums.js",
|
|
16
|
+
"gen-types": "node src/lib/gen-types.js",
|
|
17
17
|
"gen-cjs": "npx rollup ./src/index.js --file ./src/index.cjs --format cjs && npx rollup ./src/enums.js --file ./src/enums.cjs --format cjs",
|
|
18
18
|
"lint": "npx eslint .",
|
|
19
19
|
"format": "prettier --write .",
|
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
"lint-staged": {
|
|
51
51
|
"*.js": [
|
|
52
52
|
"eslint --fix"
|
|
53
|
+
],
|
|
54
|
+
"*.{js,ts,json,md,prisma,yml,yaml,scss}": [
|
|
55
|
+
"prettier --write"
|
|
53
56
|
]
|
|
54
57
|
}
|
|
55
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: appeal-s78.schema.json
|
|
3
|
-
# timestamp: 2025-
|
|
3
|
+
# timestamp: 2025-08-27T11:15:00+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -862,3 +862,9 @@ class AppealS78Case(BaseModel):
|
|
|
862
862
|
siteWithinSSSI: bool | None = None
|
|
863
863
|
typeOfPlanningApplication: TypeOfPlanningApplication
|
|
864
864
|
developmentType: DevelopmentType
|
|
865
|
+
statementOfCommonGroundDueDate: AwareDatetime | None = Field(
|
|
866
|
+
None, examples=["2023-07-27T20:30:00.000Z"]
|
|
867
|
+
)
|
|
868
|
+
planningObligationDueDate: AwareDatetime | None = Field(
|
|
869
|
+
None, examples=["2023-07-27T20:30:00.000Z"]
|
|
870
|
+
)
|
|
@@ -1055,6 +1055,18 @@
|
|
|
1055
1055
|
"other-minor",
|
|
1056
1056
|
null
|
|
1057
1057
|
]
|
|
1058
|
+
},
|
|
1059
|
+
"statementOfCommonGroundDueDate": {
|
|
1060
|
+
"type": ["string", "null"],
|
|
1061
|
+
"format": "date-time",
|
|
1062
|
+
"examples": ["2023-07-27T20:30:00.000Z"],
|
|
1063
|
+
"$comment": "Only available in S78 cases"
|
|
1064
|
+
},
|
|
1065
|
+
"planningObligationDueDate": {
|
|
1066
|
+
"type": ["string", "null"],
|
|
1067
|
+
"format": "date-time",
|
|
1068
|
+
"examples": ["2023-07-27T20:30:00.000Z"],
|
|
1069
|
+
"$comment": "Only available in S78 cases"
|
|
1058
1070
|
}
|
|
1059
1071
|
}
|
|
1060
1072
|
}
|
package/src/enums.cjs
CHANGED
|
@@ -340,6 +340,14 @@ const CASE_STAGE = Object.freeze({
|
|
|
340
340
|
WITHDRAWN: 'withdrawn',
|
|
341
341
|
});
|
|
342
342
|
|
|
343
|
+
const MESSAGE_EVENT_TYPE = Object.freeze({
|
|
344
|
+
CREATE: 'Create',
|
|
345
|
+
DELETE: 'Delete',
|
|
346
|
+
PUBLISH: 'Publish',
|
|
347
|
+
UNPUBLISH: 'Unpublish',
|
|
348
|
+
UPDATE: 'Update',
|
|
349
|
+
});
|
|
350
|
+
|
|
343
351
|
const METHOD = Object.freeze({
|
|
344
352
|
EMAIL: 'email',
|
|
345
353
|
FAX: 'fax',
|
|
@@ -605,6 +613,7 @@ exports.APPEAL_SOURCE_SYSTEM = APPEAL_SOURCE_SYSTEM;
|
|
|
605
613
|
exports.APPEAL_TYPE_OF_PLANNING_APPLICATION = APPEAL_TYPE_OF_PLANNING_APPLICATION;
|
|
606
614
|
exports.APPEAL_VIRUS_CHECK_STATUS = APPEAL_VIRUS_CHECK_STATUS;
|
|
607
615
|
exports.CASE_STAGE = CASE_STAGE;
|
|
616
|
+
exports.MESSAGE_EVENT_TYPE = MESSAGE_EVENT_TYPE;
|
|
608
617
|
exports.METHOD = METHOD;
|
|
609
618
|
exports.NSIP_CASE_TYPE = NSIP_CASE_TYPE;
|
|
610
619
|
exports.NSIP_DECISION = NSIP_DECISION;
|
package/src/enums.d.ts
CHANGED
|
@@ -338,6 +338,14 @@ export const CASE_STAGE = {
|
|
|
338
338
|
WITHDRAWN: 'withdrawn',
|
|
339
339
|
};
|
|
340
340
|
|
|
341
|
+
export const MESSAGE_EVENT_TYPE = {
|
|
342
|
+
CREATE: 'Create',
|
|
343
|
+
DELETE: 'Delete',
|
|
344
|
+
PUBLISH: 'Publish',
|
|
345
|
+
UNPUBLISH: 'Unpublish',
|
|
346
|
+
UPDATE: 'Update',
|
|
347
|
+
};
|
|
348
|
+
|
|
341
349
|
export const METHOD = {
|
|
342
350
|
EMAIL: 'email',
|
|
343
351
|
FAX: 'fax',
|
package/src/enums.js
CHANGED
|
@@ -338,6 +338,14 @@ export const CASE_STAGE = Object.freeze({
|
|
|
338
338
|
WITHDRAWN: 'withdrawn',
|
|
339
339
|
});
|
|
340
340
|
|
|
341
|
+
export const MESSAGE_EVENT_TYPE = Object.freeze({
|
|
342
|
+
CREATE: 'Create',
|
|
343
|
+
DELETE: 'Delete',
|
|
344
|
+
PUBLISH: 'Publish',
|
|
345
|
+
UNPUBLISH: 'Unpublish',
|
|
346
|
+
UPDATE: 'Update',
|
|
347
|
+
});
|
|
348
|
+
|
|
341
349
|
export const METHOD = Object.freeze({
|
|
342
350
|
EMAIL: 'email',
|
|
343
351
|
FAX: 'fax',
|
package/src/index.cjs
CHANGED
|
@@ -421,6 +421,14 @@ const CASE_STAGE = Object.freeze({
|
|
|
421
421
|
WITHDRAWN: 'withdrawn',
|
|
422
422
|
});
|
|
423
423
|
|
|
424
|
+
const MESSAGE_EVENT_TYPE = Object.freeze({
|
|
425
|
+
CREATE: 'Create',
|
|
426
|
+
DELETE: 'Delete',
|
|
427
|
+
PUBLISH: 'Publish',
|
|
428
|
+
UNPUBLISH: 'Unpublish',
|
|
429
|
+
UPDATE: 'Update',
|
|
430
|
+
});
|
|
431
|
+
|
|
424
432
|
const METHOD = Object.freeze({
|
|
425
433
|
EMAIL: 'email',
|
|
426
434
|
FAX: 'fax',
|
|
@@ -715,6 +723,7 @@ exports.APPEAL_SOURCE_SYSTEM = APPEAL_SOURCE_SYSTEM;
|
|
|
715
723
|
exports.APPEAL_TYPE_OF_PLANNING_APPLICATION = APPEAL_TYPE_OF_PLANNING_APPLICATION;
|
|
716
724
|
exports.APPEAL_VIRUS_CHECK_STATUS = APPEAL_VIRUS_CHECK_STATUS;
|
|
717
725
|
exports.CASE_STAGE = CASE_STAGE;
|
|
726
|
+
exports.MESSAGE_EVENT_TYPE = MESSAGE_EVENT_TYPE;
|
|
718
727
|
exports.METHOD = METHOD;
|
|
719
728
|
exports.NSIP_CASE_TYPE = NSIP_CASE_TYPE;
|
|
720
729
|
exports.NSIP_DECISION = NSIP_DECISION;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "enums-static.schema.json",
|
|
4
|
+
"title": "Static Enums",
|
|
5
|
+
"description": "Static enums to add to generated types that are not directly references in schemas",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"eventType": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["Create", "Update", "Delete", "Publish", "Unpublish"],
|
|
11
|
+
"description": "The type of Service Bus event"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import url from 'url';
|
|
4
|
-
import { loadAllSchemas } from '
|
|
4
|
+
import { loadAllSchemas } from '../index.js';
|
|
5
5
|
import snakeCase from 'lodash.snakecase';
|
|
6
|
+
import { loadSchema } from './load.js';
|
|
6
7
|
|
|
7
8
|
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
8
9
|
|
|
9
|
-
export const constPath = path.join(__dirname, 'enums.js');
|
|
10
|
-
export const constTsPath = path.join(__dirname, 'enums.d.ts');
|
|
10
|
+
export const constPath = path.join(__dirname, '..', 'enums.js');
|
|
11
|
+
export const constTsPath = path.join(__dirname, '..', 'enums.d.ts');
|
|
11
12
|
|
|
12
13
|
const SPACING = ' ';
|
|
13
14
|
const NEW_LINE = '\r\n';
|
|
@@ -26,6 +27,9 @@ async function run() {
|
|
|
26
27
|
collectEnumProps(enumProps, schema.properties, schemaPrefix(schemaName));
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
const staticEnums = await loadSchema(path.join(__dirname, 'enums-static.schema.json'));
|
|
31
|
+
collectEnumProps(enumProps, staticEnums.properties, 'message');
|
|
32
|
+
|
|
29
33
|
let output = '';
|
|
30
34
|
let tsOutput = '';
|
|
31
35
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import url from 'url';
|
|
4
|
-
import { loadAllSchemas } from '
|
|
4
|
+
import { loadAllSchemas } from '../index.js';
|
|
5
5
|
import { compile } from 'json-schema-to-typescript';
|
|
6
|
-
import { schemasPath, commandsPath } from '
|
|
6
|
+
import { schemasPath, commandsPath } from '../index.js';
|
|
7
7
|
|
|
8
8
|
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
9
9
|
|
|
10
|
-
export const typesPath = path.join(__dirname, 'schemas.d.ts');
|
|
10
|
+
export const typesPath = path.join(__dirname, '..', 'schemas.d.ts');
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Load all schemas and generate TypeScript definitions
|
package/src/lib/load.js
CHANGED
|
@@ -29,7 +29,7 @@ export async function loadSchemas(dirPath) {
|
|
|
29
29
|
* @param {string} filePath
|
|
30
30
|
* @returns {Promise<any>}
|
|
31
31
|
*/
|
|
32
|
-
async function loadSchema(filePath) {
|
|
32
|
+
export async function loadSchema(filePath) {
|
|
33
33
|
const content = await readFile(filePath);
|
|
34
34
|
return parse(content.toString());
|
|
35
35
|
}
|
package/src/schemas.d.ts
CHANGED