From 927c9a3e2edf85bc17746ac37e1940ea515ccf79 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 10 Nov 2023 16:57:39 +0100 Subject: [PATCH 1/3] update mapping --- src/export/digitalPlanning/model.test.ts | 11 +- src/export/digitalPlanning/model.ts | 128 +- src/export/digitalPlanning/schema/schema.json | 3470 ++++++++--------- src/export/digitalPlanning/schema/types.d.ts | 1141 +++--- 4 files changed, 2184 insertions(+), 2566 deletions(-) diff --git a/src/export/digitalPlanning/model.test.ts b/src/export/digitalPlanning/model.test.ts index a3897b5f..ed403901 100644 --- a/src/export/digitalPlanning/model.test.ts +++ b/src/export/digitalPlanning/model.test.ts @@ -13,7 +13,7 @@ import { DigitalPlanning } from "./model"; // `getPlanningConstraints` relies on an accurate teamSlug to be available, other vars can be be mocked const mockMetadataForSession = (teamSlug: string): SessionMetadata => ({ - id: "session123", + id: "c06eebb7-6201-4bc0-9fe7-ec5d7a1c0797", createdAt: "2023-01-01 00:00:00", submittedAt: "2023-01-02 00:00:00", flow: { @@ -64,7 +64,7 @@ const mockSessions = [ // We don't need to iterate over application types when testing invalid payloads const mockParams = { - sessionId: "session123", + sessionId: "c06eebb7-6201-4bc0-9fe7-ec5d7a1c0797", passport: new Passport({ data: { ...mockLDCPSession.passport } }), breadcrumbs: mockLDCPSession.breadcrumbs, flow: mockPublishedLDCFlow, @@ -76,7 +76,7 @@ describe("DigitalPlanning", () => { mockSessions.forEach((mock) => { it(`should return valid payload (${mock.name})`, () => { const instance = new DigitalPlanning({ - sessionId: "session123", + sessionId: "c06eebb7-6201-4bc0-9fe7-ec5d7a1c0797", passport: mock.passport, breadcrumbs: mock.breadcrumbs, flow: mock.flow, @@ -84,6 +84,7 @@ describe("DigitalPlanning", () => { }); const payload = instance.getPayload(); + console.log(JSON.stringify(payload.responses)); expect(payload).toEqual(instance.payload); }); @@ -126,7 +127,7 @@ describe("DigitalPlanning", () => { test("incorrect string format", () => { const instance = new DigitalPlanning(mockParams); - instance.payload.metadata.service.url = + instance.payload.metadata.schema = "not a valid URL, but still a string"; expect(() => instance.getPayload()).toThrowError( @@ -137,7 +138,7 @@ describe("DigitalPlanning", () => { test("incorrect datetime format", () => { const instance = new DigitalPlanning(mockParams); - instance.payload.metadata.session.submittedAt = + instance.payload.metadata.submittedAt = "not a valid datetime, but still a string"; expect(() => instance.getPayload()).toThrowError( diff --git a/src/export/digitalPlanning/model.ts b/src/export/digitalPlanning/model.ts index da4f8251..11f2b60d 100644 --- a/src/export/digitalPlanning/model.ts +++ b/src/export/digitalPlanning/model.ts @@ -1,6 +1,5 @@ import Ajv from "ajv"; import addFormats from "ajv-formats"; -import capitalize from "lodash.capitalize"; import set from "lodash.set"; import { Passport } from "../../models"; @@ -25,7 +24,9 @@ import { FileType, GeoJSON, LondonProperty, - PlanningConstraint, + PlanningDesignation, + PlanningOrder, + PlanXMetadata, ProjectType, Proposal, SiteContact, @@ -92,7 +93,7 @@ export class DigitalPlanning { }, proposal: this.getProposal(), }, - result: this.getResult(), + preAssessment: this.getResult(), responses: this.getResponses(), files: this.getFiles(), metadata: this.getMetadata(), @@ -126,6 +127,15 @@ export class DigitalPlanning { )[0]?.properties["description"].const; } + /** + * Get the possible enum values for a JSON schema Definition + */ + private findPossibleValues(definition: string): string[] { + return jsonSchema["definitions"][definition]["anyOf"][0]["anyOf"].map( + (types: Record) => types.properties["value"].const, + ); + } + /** * Cast a string to a boolean */ @@ -340,7 +350,7 @@ export class DigitalPlanning { this.passport.data?.["property.type"]?.[0], ), }, - constraints: this.getPlanningConstraints(), + planning: this.getPlanningConstraints(), // Only include the 'boundary' key in cases where we have digital data, not an uploaded location plan ...(this.passport.data?.["property.boundary.site"] && { boundary: this.getBoundary(), @@ -371,11 +381,16 @@ export class DigitalPlanning { } } - private getPlanningConstraints(): Payload["data"]["property"]["constraints"] { - const data: PlanningConstraint[] = []; + private getPlanningConstraints(): Payload["data"]["property"]["planning"] { const teamSlug: string = this.metadata.flow.team.slug; - const constraints = - this.passport.generic("_constraints"); + const constraints = this.passport.data + ?._constraints as unknown as EnhancedGISResponse[]; + + const designationKeys = this.findPossibleValues("PlanningDesignation"); + const designations: PlanningDesignation[] = []; + + const orderKeys = this.findPossibleValues("PlanningOrder"); + const orders: PlanningOrder[] = []; constraints?.forEach((response: EnhancedGISResponse) => { response.constraints && @@ -383,16 +398,16 @@ export class DigitalPlanning { .filter(([key, _constraint]) => !key.split(".").includes(teamSlug)) .map(([key, constraint]) => { if (constraint.value) { - data.push({ - value: key, - description: this.findDescriptionFromValue( - "PlanningConstraint", - key, - ), - category: constraint.category, - overlaps: constraint.value, - entities: - constraint.data?.map( + // Intersecting constraints + if (designationKeys.includes(key)) { + designations.push({ + value: key, + description: this.findDescriptionFromValue( + "PlanningDesignation", + key, + ), + intersects: constraint.value, + entities: constraint.data?.map( (entity) => Boolean(entity) && { name: entity.name, @@ -402,24 +417,55 @@ export class DigitalPlanning { ? "https://www.ordnancesurvey.co.uk/products/os-mastermap-highways-network-roads" : `https://planinng.data.gov.uk/entity/${entity.id}`, }, - ) || [], - } as PlanningConstraint); + ), + } as PlanningDesignation); + } else if (orderKeys.includes(key)) { + orders.push({ + value: key, + description: this.findDescriptionFromValue( + "PlanningOrder", + key, + ), + intersects: constraint.value, + entities: constraint.data?.map( + (entity) => + Boolean(entity) && { + name: entity.name, + description: entity.description, + source: `https://planinng.data.gov.uk/entity/${entity.id}`, + }, + ), + } as PlanningOrder); + } } else { - data.push({ - value: key, - description: this.findDescriptionFromValue( - "PlanningConstraint", - key, - ), - category: constraint.category, - overlaps: constraint.value, - } as PlanningConstraint); + // Non-intersecting constraints + if (designationKeys.includes(key)) { + designations.push({ + value: key, + description: this.findDescriptionFromValue( + "PlanningDesignation", + key, + ), + intersects: constraint.value, + } as PlanningDesignation); + } else if (orderKeys.includes(key)) { + orders.push({ + value: key, + description: this.findDescriptionFromValue( + "PlanningOrder", + key, + ), + intersects: constraint.value, + } as PlanningOrder); + } } }); }); return { - planning: data, + source: "https://www.planning.data.gov.uk", + designations: designations, + orders: orders, }; } @@ -496,7 +542,7 @@ export class DigitalPlanning { } // @todo getResult() should support flagsets beyond Planning Permission - private getResult(): Payload["result"] { + private getResult(): Payload["preAssessment"] { // Planning Permission application types won't have a Planning Permission result right now if (this.passport.data?.["application.type"]?.[0].startsWith("pp")) { return []; @@ -513,7 +559,7 @@ export class DigitalPlanning { value: title, description: this.findDescriptionFromValue("ResultFlag", title), // flag.description may be custom text }, - ] as Payload["result"]; + ] as Payload["preAssessment"]; } } @@ -745,21 +791,15 @@ export class DigitalPlanning { private getMetadata(): Payload["metadata"] { return { + id: this.sessionId, + organisation: this.metadata.flow.team.slug, + submittedAt: this.metadata.submittedAt, + source: "PlanX", service: { flowId: this.metadata.flow.id, - name: capitalize(this.metadata.flow.slug.replaceAll?.("-", " ")), - owner: this.metadata.flow.team.slug, url: `https://www.editor.planx.uk/${this.metadata.flow.team.slug}/${this.metadata.flow.slug}/preview`, }, - session: { - source: "PlanX", - id: this.sessionId, - createdAt: this.metadata.createdAt, - submittedAt: this.metadata.submittedAt, - }, - schema: { - url: `https://theopensystemslab.github.io/digital-planning-data-schemas/${jsonSchema["$id"]}/schema.json`, - }, - }; + schema: `https://theopensystemslab.github.io/digital-planning-data-schemas/${jsonSchema["$id"]}/schema.json`, + } as PlanXMetadata; } } diff --git a/src/export/digitalPlanning/schema/schema.json b/src/export/digitalPlanning/schema/schema.json index aff36b8f..7a8c5566 100644 --- a/src/export/digitalPlanning/schema/schema.json +++ b/src/export/digitalPlanning/schema/schema.json @@ -1,5 +1,5 @@ { - "$id": "v0.1.2", + "$id": "@next", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { @@ -671,6 +671,21 @@ "required": ["value", "description"], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Prior Approval - Specific Acts of Parliament or Local Orders", + "type": "string" + }, + "value": { + "const": "pa.part18.classA", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -956,6 +971,29 @@ }, "type": "object" }, + "BaseMetadata": { + "$id": "#BaseMetadata", + "additionalProperties": false, + "description": "Minimum metadata expected for any application", + "properties": { + "id": { + "$ref": "#/definitions/UUID", + "description": "Unique identifier for this application" + }, + "organisation": { + "description": "UK Local Authority that this application is being submitted to", + "type": "string" + }, + "schema": { + "$ref": "#/definitions/URL" + }, + "submittedAt": { + "$ref": "#/definitions/DateTime" + } + }, + "required": ["organisation", "id", "submittedAt", "schema"], + "type": "object" + }, "Date": { "format": "date", "type": "string" @@ -2307,26 +2345,68 @@ "required": ["site", "area"], "type": "object" }, - "constraints": { + "localAuthorityDistrict": { + "description": "Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district", + "items": { + "type": "string" + }, + "type": "array" + }, + "planning": { "additionalProperties": false, + "description": "Planning constraints and policies that intersect with this site and may impact or restrict development", "properties": { - "planning": { + "conditions": { + "items": { + "$ref": "#/definitions/PlanningConstraint" + }, + "type": "array" + }, + "designations": { + "items": { + "$ref": "#/definitions/PlanningDesignation" + }, + "type": "array" + }, + "guidance": { "items": { "$ref": "#/definitions/PlanningConstraint" }, "type": "array" + }, + "orders": { + "items": { + "$ref": "#/definitions/PlanningOrder" + }, + "type": "array" + }, + "plans": { + "additionalProperties": false, + "properties": { + "local": { + "items": { + "$ref": "#/definitions/PlanningConstraint" + }, + "type": "array" + }, + "neighbourhood": { + "items": { + "$ref": "#/definitions/PlanningConstraint" + }, + "type": "array" + } + }, + "required": ["local", "neighbourhood"], + "type": "object" + }, + "source": { + "$ref": "#/definitions/URL", + "description": "An open API request or website that explains how these constraints were sourced" } }, - "required": ["planning"], + "required": ["source"], "type": "object" }, - "localAuthorityDistrict": { - "description": "Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district", - "items": { - "type": "string" - }, - "type": "array" - }, "region": { "const": "London", "type": "string" @@ -2352,7 +2432,6 @@ "required": [ "EPC", "address", - "constraints", "localAuthorityDistrict", "region", "titleNumber", @@ -2361,77 +2440,16 @@ "type": "object" }, "Metadata": { - "additionalProperties": false, - "properties": { - "schema": { - "additionalProperties": false, - "properties": { - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": ["url"], - "type": "object" - }, - "service": { - "$id": "#DigitalPlanningMetadata", - "additionalProperties": false, - "description": "Details of the digital planning service which sent the application", - "properties": { - "flowId": { - "anyOf": [ - { - "$ref": "#/definitions/UUID" - }, - { - "type": "string" - } - ] - }, - "name": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": ["flowId", "name", "owner", "url"], - "type": "object" + "$id": "#DigitalPlanningMetadata", + "anyOf": [ + { + "$ref": "#/definitions/BaseMetadata" }, - "session": { - "additionalProperties": false, - "properties": { - "createdAt": { - "$ref": "#/definitions/DateTime" - }, - "id": { - "anyOf": [ - { - "$ref": "#/definitions/UUID" - }, - { - "type": "string" - } - ] - }, - "source": { - "const": "PlanX", - "default": "PlanX", - "type": "string" - }, - "submittedAt": { - "$ref": "#/definitions/DateTime" - } - }, - "required": ["source", "id", "createdAt"], - "type": "object" + { + "$ref": "#/definitions/PlanXMetadata" } - }, - "required": ["service", "session", "schema"], - "type": "object" + ], + "description": "Details of the digital planning service which sent this application" }, "MultiLineString": { "additionalProperties": false, @@ -2627,1903 +2645,1606 @@ "required": ["certificate"], "type": "object" }, - "PlanningConstraint": { - "$id": "#PlanningConstraint", - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Article 4 Direction area", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "article4", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" + "PlanXMetadata": { + "$id": "#PlanXMetadata", + "additionalProperties": false, + "description": "Additional metadata associated with applications submitted via PlanX", + "properties": { + "id": { + "$ref": "#/definitions/UUID", + "description": "Unique identifier for this application" }, - { + "organisation": { + "description": "UK Local Authority that this application is being submitted to", + "type": "string" + }, + "schema": { + "$ref": "#/definitions/URL" + }, + "service": { "additionalProperties": false, "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Central Activities Zone (CAZ)", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" + "flowId": { + "$ref": "#/definitions/UUID" }, - "value": { - "const": "article4.caz", - "type": "string" + "url": { + "$ref": "#/definitions/URL" } }, - "required": ["description", "overlaps", "value"], + "required": ["flowId", "url"], "type": "object" }, + "source": { + "const": "PlanX", + "type": "string" + }, + "submittedAt": { + "$ref": "#/definitions/DateTime" + } + }, + "required": [ + "id", + "organisation", + "schema", + "service", + "source", + "submittedAt" + ], + "type": "object" + }, + "PlanningConstraint": { + "$id": "#PlanningConstraint", + "anyOf": [ { "additionalProperties": false, + "description": "A planning constraint that does not intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects", "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, "description": { - "const": "Designated land", "type": "string" }, - "overlaps": { + "intersects": { "const": false, "type": "boolean" }, "value": { - "const": "designated", "type": "string" } }, - "required": ["description", "overlaps", "value"], + "required": ["description", "intersects", "value"], "type": "object" }, { "additionalProperties": false, + "description": "A planning constraint that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects", "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, "description": { - "const": "Area of Outstanding Natural Beauty (AONB)", "type": "string" }, - "overlaps": { - "const": false, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" + }, + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, "type": "boolean" }, "value": { - "const": "designated.AONB", "type": "string" } }, - "required": ["description", "overlaps", "value"], + "required": ["description", "entities", "intersects", "value"], "type": "object" - }, + } + ], + "description": "Planning constraints that intersect with the proposed site" + }, + "PlanningDesignation": { + "$id": "#PlanningDesignation", + "anyOf": [ { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Conservation Area", - "type": "string" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Designated land", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "designated", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "overlaps": { - "const": false, - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Area of Outstanding Natural Beauty (AONB)", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "designated.AONB", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "value": { - "const": "designated.conservationArea", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "National Park", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "designated.nationalPark", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "National Park - Broads", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "designated.nationalPark.broads", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Special Protection Area (SPA)", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "designated.SPA", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "UNESCO World Heritage Site or buffer zone", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "designated.WHS", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Flood Risk Zone", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "flood", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Flood Risk Zone 1 - Low risk", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "flood.zone.1", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Flood Risk Zone 2 - Medium risk", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "flood.zone.2", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Flood Risk Zone 3 - High risk", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "flood.zone.3", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Listed Building", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "listed", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Locally Listed Building", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "locallyListed", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Site of a Scheduled Monument", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "monument", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Ancient Semi-Natural Woodland (ASNW)", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "nature.ASNW", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Special Area of Conservation (SAC)", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "nature.SAC", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Site of Special Scientific Interest (SSSI)", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "nature.SSSI", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Historic Park or Garden", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "registeredPark", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Classified Road", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "road.classified", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Tree Preservation Order (TPO) or zone", - "type": "string" - }, - "overlaps": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "tpo", - "type": "string" - } - }, - "required": ["description", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Article 4 Direction area", - "type": "string" - }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" - }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" - } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "article4", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Central Activities Zone (CAZ)", - "type": "string" - }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" - }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" - } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "article4.caz", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Designated land", - "type": "string" - }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Conservation Area", + "type": "string" }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" - } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "designated", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Area of Outstanding Natural Beauty (AONB)", - "type": "string" - }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" + "intersects": { + "const": false, + "type": "boolean" }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "value": { + "const": "designated.conservationArea", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "designated.AONB", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Conservation Area", - "type": "string" + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "National Park", + "type": "string" }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "designated.nationalPark", + "type": "string" } - ] + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "overlaps": { - "const": true, - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "National Park - Broads", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "designated.nationalPark.broads", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "value": { - "const": "designated.conservationArea", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Special Protection Area (SPA)", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "designated.SPA", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "description": { - "const": "National Park", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "UNESCO World Heritage Site or buffer zone", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "designated.WHS", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone", + "type": "string" }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "flood", + "type": "string" } - ] + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "overlaps": { - "const": true, - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone 1 - Low risk", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "flood.zone.1", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "value": { - "const": "designated.nationalPark", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone 2 - Medium risk", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "flood.zone.2", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "description": { - "const": "National Park - Broads", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone 3 - High risk", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "flood.zone.3", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Listed Building", + "type": "string" }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "listed", + "type": "string" } - ] + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "overlaps": { - "const": true, - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Locally Listed Building", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "locallyListed", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "value": { - "const": "designated.nationalPark.broads", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Site of a Scheduled Monument", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "monument", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "description": { - "const": "Special Protection Area (SPA)", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Ancient Semi-Natural Woodland (ASNW)", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "nature.ASNW", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/URL" - } - }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Special Area of Conservation (SAC)", + "type": "string" }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "nature.SAC", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Site of Special Scientific Interest (SSSI)", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "nature.SSSI", + "type": "string" } - ] + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "overlaps": { - "const": true, - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Historic Park or Garden", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "registeredPark", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "value": { - "const": "designated.SPA", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Classified Road", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "road.classified", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" + ], + "description": "A planning designation that does not intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" }, { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "UNESCO World Heritage Site or buffer zone", - "type": "string" - }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Designated land", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "designated", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "designated.WHS", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "description": { - "const": "Flood Risk Zone", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Area of Outstanding Natural Beauty (AONB)", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" + }, + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "designated.AONB", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Conservation Area", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "name": { - "type": "string" + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "designated.conservationArea", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "National Park", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "designated.nationalPark", + "type": "string" } - ] + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "overlaps": { - "const": true, - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "National Park - Broads", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" + }, + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "designated.nationalPark.broads", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "value": { - "const": "flood", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Special Protection Area (SPA)", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" + }, + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "designated.SPA", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "description": { - "const": "Flood Risk Zone 1 - Low risk", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "UNESCO World Heritage Site or buffer zone", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" + }, + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "designated.WHS", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "name": { - "type": "string" + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "flood", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone 1 - Low risk", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "flood.zone.1", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "flood.zone.1", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Flood Risk Zone 2 - Medium risk", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone 2 - Medium risk", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "flood.zone.2", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "flood.zone.2", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Flood Risk Zone 3 - High risk", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flood Risk Zone 3 - High risk", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "flood.zone.3", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "flood.zone.3", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Listed Building", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Listed Building", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "listed", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "listed", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "description": { - "const": "Locally Listed Building", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Locally Listed Building", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" + }, + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "locallyListed", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Site of a Scheduled Monument", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "name": { - "type": "string" + "type": "array" + }, + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] + }, + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "monument", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Ancient Semi-Natural Woodland (ASNW)", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "nature.ASNW", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "locallyListed", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Site of a Scheduled Monument", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Special Area of Conservation (SAC)", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "nature.SAC", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "monument", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Ancient Semi-Natural Woodland (ASNW)", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Site of Special Scientific Interest (SSSI)", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "nature.SSSI", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "nature.ASNW", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Special Area of Conservation (SAC)", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Historic Park or Garden", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "registeredPark", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "nature.SAC", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Site of Special Scientific Interest (SSSI)", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Classified Road", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "road.classified", + "type": "string" + } + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" + } + ], + "description": "A planning designation that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" + } + ], + "description": "Planning designations that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey" + }, + "PlanningOrder": { + "$id": "#PlanningOrder", + "anyOf": [ + { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Article 4 Direction area", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "article4", + "type": "string" } - ] + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "overlaps": { - "const": true, - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Central Activities Zone (CAZ)", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "article4.caz", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" }, - "value": { - "const": "nature.SSSI", - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Tree Preservation Order (TPO) or zone", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "tpo", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" + ], + "description": "A planning order that does not intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" }, { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Historic Park or Garden", - "type": "string" - }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Article 4 Direction area", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "article4", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "registeredPark", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Classified Road", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Central Activities Zone (CAZ)", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "article4.caz", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "road.classified", - "type": "string" - } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "category": { - "enum": [ - "Ecology", - "Flooding", - "General policy", - "Heritage and conservation", - "Trees" - ], - "type": "string" - }, - "description": { - "const": "Tree Preservation Order (TPO) or zone", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" }, - "entities": { - "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Tree Preservation Order (TPO) or zone", + "type": "string" + }, + "entities": { + "anyOf": [ + { + "items": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/URL" + } + }, + "required": ["name"], + "type": "object" }, - "source": { - "$ref": "#/definitions/URL" - } + "type": "array" }, - "required": ["name"], - "type": "object" - }, - "type": "array" + { + "maxItems": 0, + "minItems": 0, + "type": "array" + } + ] }, - { - "maxItems": 0, - "minItems": 0, - "type": "array" + "intersects": { + "const": true, + "type": "boolean" + }, + "value": { + "const": "tpo", + "type": "string" } - ] - }, - "overlaps": { - "const": true, - "type": "boolean" - }, - "value": { - "const": "tpo", - "type": "string" + }, + "required": ["description", "entities", "intersects", "value"], + "type": "object" } - }, - "required": ["description", "entities", "overlaps", "value"], - "type": "object" + ], + "description": "A planning order that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" } ], - "description": "Planning constraints that overlap with the property site boundary determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey" + "description": "Planning orders that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey" }, "Point": { "additionalProperties": false, @@ -4599,6 +4320,14 @@ "required": ["reference", "date", "officer", "summary"], "type": "object" }, + "PreAssessment": { + "$id": "#PreAssessment", + "description": "The result of the application based on information provided by the applicant, prior to assessment by a planning officer. Results are determined by flags corresponding to responses; each application can have up to one result per flagset", + "items": { + "$ref": "#/definitions/ResultFlag" + }, + "type": "array" + }, "ProjectType": { "$id": "#ProjectType", "anyOf": [ @@ -14733,9 +14462,10 @@ "type": "string" }, "url": { - "type": "string" + "$ref": "#/definitions/URL" } }, + "required": ["text"], "type": "object" }, "type": "array" @@ -14795,14 +14525,6 @@ }, "type": "array" }, - "Result": { - "$id": "#Result", - "description": "The result of the application. Results are determined by flags corresponding to responses; each application can have up to one result per flagset", - "items": { - "$ref": "#/definitions/ResultFlag" - }, - "type": "array" - }, "ResultFlag": { "$id": "#ResultFlag", "anyOf": [ @@ -15329,26 +15051,68 @@ "required": ["site", "area"], "type": "object" }, - "constraints": { + "localAuthorityDistrict": { + "description": "Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district", + "items": { + "type": "string" + }, + "type": "array" + }, + "planning": { "additionalProperties": false, + "description": "Planning constraints and policies that intersect with this site and may impact or restrict development", "properties": { - "planning": { + "conditions": { + "items": { + "$ref": "#/definitions/PlanningConstraint" + }, + "type": "array" + }, + "designations": { + "items": { + "$ref": "#/definitions/PlanningDesignation" + }, + "type": "array" + }, + "guidance": { "items": { "$ref": "#/definitions/PlanningConstraint" }, "type": "array" + }, + "orders": { + "items": { + "$ref": "#/definitions/PlanningOrder" + }, + "type": "array" + }, + "plans": { + "additionalProperties": false, + "properties": { + "local": { + "items": { + "$ref": "#/definitions/PlanningConstraint" + }, + "type": "array" + }, + "neighbourhood": { + "items": { + "$ref": "#/definitions/PlanningConstraint" + }, + "type": "array" + } + }, + "required": ["local", "neighbourhood"], + "type": "object" + }, + "source": { + "$ref": "#/definitions/URL", + "description": "An open API request or website that explains how these constraints were sourced" } }, - "required": ["planning"], + "required": ["source"], "type": "object" }, - "localAuthorityDistrict": { - "description": "Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district", - "items": { - "type": "string" - }, - "type": "array" - }, "region": { "$ref": "#/definitions/UKRegion" }, @@ -15356,13 +15120,7 @@ "$ref": "#/definitions/PropertyType" } }, - "required": [ - "address", - "region", - "localAuthorityDistrict", - "type", - "constraints" - ], + "required": ["address", "region", "localAuthorityDistrict", "type"], "type": "object" }, "UKRegion": { @@ -15854,14 +15612,14 @@ "metadata": { "$ref": "#/definitions/Metadata" }, + "preAssessment": { + "$ref": "#/definitions/PreAssessment" + }, "responses": { "$ref": "#/definitions/Responses" - }, - "result": { - "$ref": "#/definitions/Result" } }, - "required": ["data", "result", "metadata", "responses", "files"], + "required": ["data", "responses", "files", "metadata"], "title": "Digital Planning Application", "type": "object" } diff --git a/src/export/digitalPlanning/schema/types.d.ts b/src/export/digitalPlanning/schema/types.d.ts index 16f3d875..0c8aa11c 100644 --- a/src/export/digitalPlanning/schema/types.d.ts +++ b/src/export/digitalPlanning/schema/types.d.ts @@ -135,6 +135,10 @@ export type ApplicationType = description: "Prior Approval - Install telecommunications equipment"; value: "pa.part16.classA"; } + | { + description: "Prior Approval - Specific Acts of Parliament or Local Orders"; + value: "pa.part18.classA"; + } | { description: "Prior Approval - Build homes on a detached blocks of flats"; value: "pa.part20.classA"; @@ -197,493 +201,16 @@ export type Geometry = */ export type Position = number[]; /** - * Planning constraints that overlap with the property site boundary determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey + * Planning constraints that intersect with the proposed site */ export type PlanningConstraint = | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Article 4 Direction area"; - overlaps: false; - value: "article4"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Central Activities Zone (CAZ)"; - overlaps: false; - value: "article4.caz"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Designated land"; - overlaps: false; - value: "designated"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Area of Outstanding Natural Beauty (AONB)"; - overlaps: false; - value: "designated.AONB"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Conservation Area"; - overlaps: false; - value: "designated.conservationArea"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "National Park"; - overlaps: false; - value: "designated.nationalPark"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "National Park - Broads"; - overlaps: false; - value: "designated.nationalPark.broads"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Special Protection Area (SPA)"; - overlaps: false; - value: "designated.SPA"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "UNESCO World Heritage Site or buffer zone"; - overlaps: false; - value: "designated.WHS"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone"; - overlaps: false; - value: "flood"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone 1 - Low risk"; - overlaps: false; - value: "flood.zone.1"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone 2 - Medium risk"; - overlaps: false; - value: "flood.zone.2"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone 3 - High risk"; - overlaps: false; - value: "flood.zone.3"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Listed Building"; - overlaps: false; - value: "listed"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Locally Listed Building"; - overlaps: false; - value: "locallyListed"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Site of a Scheduled Monument"; - overlaps: false; - value: "monument"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Ancient Semi-Natural Woodland (ASNW)"; - overlaps: false; - value: "nature.ASNW"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Special Area of Conservation (SAC)"; - overlaps: false; - value: "nature.SAC"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Site of Special Scientific Interest (SSSI)"; - overlaps: false; - value: "nature.SSSI"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Historic Park or Garden"; - overlaps: false; - value: "registeredPark"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Classified Road"; - overlaps: false; - value: "road.classified"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Tree Preservation Order (TPO) or zone"; - overlaps: false; - value: "tpo"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Article 4 Direction area"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "article4"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Central Activities Zone (CAZ)"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "article4.caz"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Designated land"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "designated"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Area of Outstanding Natural Beauty (AONB)"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "designated.AONB"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Conservation Area"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "designated.conservationArea"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "National Park"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "designated.nationalPark"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "National Park - Broads"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "designated.nationalPark.broads"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Special Protection Area (SPA)"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "designated.SPA"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "UNESCO World Heritage Site or buffer zone"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "designated.WHS"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "flood"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone 1 - Low risk"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "flood.zone.1"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone 2 - Medium risk"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "flood.zone.2"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Flood Risk Zone 3 - High risk"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "flood.zone.3"; + description: string; + intersects: false; + value: string; } | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Listed Building"; + description: string; entities: | { description?: string; @@ -691,154 +218,400 @@ export type PlanningConstraint = source?: URL; }[] | []; - overlaps: true; - value: "listed"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Locally Listed Building"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "locallyListed"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Site of a Scheduled Monument"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "monument"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Ancient Semi-Natural Woodland (ASNW)"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "nature.ASNW"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Special Area of Conservation (SAC)"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "nature.SAC"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Site of Special Scientific Interest (SSSI)"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "nature.SSSI"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Historic Park or Garden"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "registeredPark"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Classified Road"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "road.classified"; - } - | { - category?: - | "Ecology" - | "Flooding" - | "General policy" - | "Heritage and conservation" - | "Trees"; - description: "Tree Preservation Order (TPO) or zone"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - overlaps: true; - value: "tpo"; + intersects: true; + value: string; }; export type URL = string; +/** + * Planning designations that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey + */ +export type PlanningDesignation = + | ( + | { + description: "Designated land"; + intersects: false; + value: "designated"; + } + | { + description: "Area of Outstanding Natural Beauty (AONB)"; + intersects: false; + value: "designated.AONB"; + } + | { + description: "Conservation Area"; + intersects: false; + value: "designated.conservationArea"; + } + | { + description: "National Park"; + intersects: false; + value: "designated.nationalPark"; + } + | { + description: "National Park - Broads"; + intersects: false; + value: "designated.nationalPark.broads"; + } + | { + description: "Special Protection Area (SPA)"; + intersects: false; + value: "designated.SPA"; + } + | { + description: "UNESCO World Heritage Site or buffer zone"; + intersects: false; + value: "designated.WHS"; + } + | { + description: "Flood Risk Zone"; + intersects: false; + value: "flood"; + } + | { + description: "Flood Risk Zone 1 - Low risk"; + intersects: false; + value: "flood.zone.1"; + } + | { + description: "Flood Risk Zone 2 - Medium risk"; + intersects: false; + value: "flood.zone.2"; + } + | { + description: "Flood Risk Zone 3 - High risk"; + intersects: false; + value: "flood.zone.3"; + } + | { + description: "Listed Building"; + intersects: false; + value: "listed"; + } + | { + description: "Locally Listed Building"; + intersects: false; + value: "locallyListed"; + } + | { + description: "Site of a Scheduled Monument"; + intersects: false; + value: "monument"; + } + | { + description: "Ancient Semi-Natural Woodland (ASNW)"; + intersects: false; + value: "nature.ASNW"; + } + | { + description: "Special Area of Conservation (SAC)"; + intersects: false; + value: "nature.SAC"; + } + | { + description: "Site of Special Scientific Interest (SSSI)"; + intersects: false; + value: "nature.SSSI"; + } + | { + description: "Historic Park or Garden"; + intersects: false; + value: "registeredPark"; + } + | { + description: "Classified Road"; + intersects: false; + value: "road.classified"; + } + ) + | ( + | { + description: "Designated land"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "designated"; + } + | { + description: "Area of Outstanding Natural Beauty (AONB)"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "designated.AONB"; + } + | { + description: "Conservation Area"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "designated.conservationArea"; + } + | { + description: "National Park"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "designated.nationalPark"; + } + | { + description: "National Park - Broads"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "designated.nationalPark.broads"; + } + | { + description: "Special Protection Area (SPA)"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "designated.SPA"; + } + | { + description: "UNESCO World Heritage Site or buffer zone"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "designated.WHS"; + } + | { + description: "Flood Risk Zone"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "flood"; + } + | { + description: "Flood Risk Zone 1 - Low risk"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "flood.zone.1"; + } + | { + description: "Flood Risk Zone 2 - Medium risk"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "flood.zone.2"; + } + | { + description: "Flood Risk Zone 3 - High risk"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "flood.zone.3"; + } + | { + description: "Listed Building"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "listed"; + } + | { + description: "Locally Listed Building"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "locallyListed"; + } + | { + description: "Site of a Scheduled Monument"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "monument"; + } + | { + description: "Ancient Semi-Natural Woodland (ASNW)"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "nature.ASNW"; + } + | { + description: "Special Area of Conservation (SAC)"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "nature.SAC"; + } + | { + description: "Site of Special Scientific Interest (SSSI)"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "nature.SSSI"; + } + | { + description: "Historic Park or Garden"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "registeredPark"; + } + | { + description: "Classified Road"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "road.classified"; + } + ); +/** + * Planning orders that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey + */ +export type PlanningOrder = + | ( + | { + description: "Article 4 Direction area"; + intersects: false; + value: "article4"; + } + | { + description: "Central Activities Zone (CAZ)"; + intersects: false; + value: "article4.caz"; + } + | { + description: "Tree Preservation Order (TPO) or zone"; + intersects: false; + value: "tpo"; + } + ) + | ( + | { + description: "Article 4 Direction area"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "article4"; + } + | { + description: "Central Activities Zone (CAZ)"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "article4.caz"; + } + | { + description: "Tree Preservation Order (TPO) or zone"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "tpo"; + } + ); /** * The UK region that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area */ @@ -3780,12 +3553,12 @@ export type FileType = description: "Visualisations"; value: "proposal.visualisation"; }; -export type UUID = string; -export type DateTime = string; /** - * The ordered list of questions, answers, and their metadata for the application + * Details of the digital planning service which sent this application */ -export type Responses = QuestionAndResponses[]; +export type DigitalPlanningMetadata = BaseMetadata | PlanXMetadata; +export type DateTime = string; +export type UUID = string; /** * The result of a single flagset */ @@ -3911,9 +3684,13 @@ export type ResultFlag = value: "Community infrastructure levy / Not liable"; }; /** - * The result of the application. Results are determined by flags corresponding to responses; each application can have up to one result per flagset + * The result of the application based on information provided by the applicant, prior to assessment by a planning officer. Results are determined by flags corresponding to responses; each application can have up to one result per flagset */ -export type Result = ResultFlag[]; +export type PreAssessment = ResultFlag[]; +/** + * The ordered list of questions, answers, and their metadata for the application + */ +export type Responses = QuestionAndResponses[]; /** * The root specification for a planning application in England generated by a digital planning service @@ -3927,9 +3704,9 @@ export interface DigitalPlanningApplication { user: User; }; files: File[]; - metadata: Metadata; + metadata: DigitalPlanningMetadata; + preAssessment?: PreAssessment; responses: Responses; - result: Result; } /** * Information about the user who completed the application for themself, or information about the person who the user applied on behalf of @@ -4098,13 +3875,27 @@ export interface UKProperty { area: Area; site: GeoJSON; }; - constraints: { - planning: PlanningConstraint[]; - }; /** * Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district */ localAuthorityDistrict: string[]; + /** + * Planning constraints and policies that intersect with this site and may impact or restrict development + */ + planning?: { + conditions?: PlanningConstraint[]; + designations?: PlanningDesignation[]; + guidance?: PlanningConstraint[]; + orders?: PlanningOrder[]; + plans?: { + local: PlanningConstraint[]; + neighbourhood: PlanningConstraint[]; + }; + /** + * An open API request or website that explains how these constraints were sourced + */ + source: string; + }; region: UKRegion; type: PropertyType; } @@ -4376,13 +4167,27 @@ export interface LondonProperty { area: Area; site: GeoJSON; }; - constraints: { - planning: PlanningConstraint[]; - }; /** * Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district */ localAuthorityDistrict: string[]; + /** + * Planning constraints and policies that intersect with this site and may impact or restrict development + */ + planning?: { + conditions?: PlanningConstraint[]; + designations?: PlanningDesignation[]; + guidance?: PlanningConstraint[]; + orders?: PlanningOrder[]; + plans?: { + local: PlanningConstraint[]; + neighbourhood: PlanningConstraint[]; + }; + /** + * An open API request or website that explains how these constraints were sourced + */ + source: string; + }; region: "London"; titleNumber: { known: "Yes" | "No"; @@ -4602,26 +4407,40 @@ export interface File { name: string; type: FileType[]; } -export interface Metadata { - schema: { - url: URL; - }; - service: DigitalPlanningMetadata; - session: { - createdAt: DateTime; - id: UUID; - source: "PlanX"; - submittedAt?: DateTime; - }; +/** + * Minimum metadata expected for any application + */ +export interface BaseMetadata { + /** + * Unique identifier for this application + */ + id: string; + /** + * UK Local Authority that this application is being submitted to + */ + organisation: string; + schema: URL; + submittedAt: DateTime; } /** - * Details of the digital planning service which sent the application + * Additional metadata associated with applications submitted via PlanX */ -export interface DigitalPlanningMetadata { - flowId: UUID; - name: string; - owner: string; - url: URL; +export interface PlanXMetadata { + /** + * Unique identifier for this application + */ + id: string; + /** + * UK Local Authority that this application is being submitted to + */ + organisation: string; + schema: URL; + service: { + flowId: UUID; + url: URL; + }; + source: "PlanX"; + submittedAt: DateTime; } export interface QuestionAndResponses { metadata?: QuestionMetaData; @@ -4631,8 +4450,8 @@ export interface QuestionAndResponses { export interface QuestionMetaData { autoAnswered?: boolean; policyRefs?: { - text?: string; - url?: string; + text: string; + url?: URL; }[]; sectionName?: string; } From 7a2445fd0d5a9cbb839d9ba5129dbf6427e4475e Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 17 Nov 2023 11:13:10 +0100 Subject: [PATCH 2/3] updated data.property.planning mapping --- src/export/digitalPlanning/model.test.ts | 1 - src/export/digitalPlanning/model.ts | 90 ++----- src/export/digitalPlanning/schema/schema.json | 252 ++++++++---------- src/export/digitalPlanning/schema/types.d.ts | 96 +++---- 4 files changed, 187 insertions(+), 252 deletions(-) diff --git a/src/export/digitalPlanning/model.test.ts b/src/export/digitalPlanning/model.test.ts index ed403901..e4fd8e68 100644 --- a/src/export/digitalPlanning/model.test.ts +++ b/src/export/digitalPlanning/model.test.ts @@ -84,7 +84,6 @@ describe("DigitalPlanning", () => { }); const payload = instance.getPayload(); - console.log(JSON.stringify(payload.responses)); expect(payload).toEqual(instance.payload); }); diff --git a/src/export/digitalPlanning/model.ts b/src/export/digitalPlanning/model.ts index 11f2b60d..a91874a2 100644 --- a/src/export/digitalPlanning/model.ts +++ b/src/export/digitalPlanning/model.ts @@ -25,7 +25,6 @@ import { GeoJSON, LondonProperty, PlanningDesignation, - PlanningOrder, PlanXMetadata, ProjectType, Proposal, @@ -128,12 +127,16 @@ export class DigitalPlanning { } /** - * Get the possible enum values for a JSON schema Definition + * For a Planx passport value, find it's corresponding description in the JSON schema Definition for UnionTypes */ - private findPossibleValues(definition: string): string[] { - return jsonSchema["definitions"][definition]["anyOf"][0]["anyOf"].map( - (types: Record) => types.properties["value"].const, - ); + private findDescriptionFromValueUnionType( + definition: string, + value: string, + ): string { + return jsonSchema["definitions"][definition]["anyOf"][0]["anyOf"].filter( + (types: Record) => + types.properties["value"].const === value, + )[0]?.properties["description"].const; } /** @@ -385,13 +388,8 @@ export class DigitalPlanning { const teamSlug: string = this.metadata.flow.team.slug; const constraints = this.passport.data ?._constraints as unknown as EnhancedGISResponse[]; - - const designationKeys = this.findPossibleValues("PlanningDesignation"); const designations: PlanningDesignation[] = []; - const orderKeys = this.findPossibleValues("PlanningOrder"); - const orders: PlanningOrder[] = []; - constraints?.forEach((response: EnhancedGISResponse) => { response.constraints && Object.entries(response.constraints) @@ -399,15 +397,15 @@ export class DigitalPlanning { .map(([key, constraint]) => { if (constraint.value) { // Intersecting constraints - if (designationKeys.includes(key)) { - designations.push({ - value: key, - description: this.findDescriptionFromValue( - "PlanningDesignation", - key, - ), - intersects: constraint.value, - entities: constraint.data?.map( + designations.push({ + value: key, + description: this.findDescriptionFromValueUnionType( + "PlanningDesignation", + key, + ), + intersects: constraint.value, + entities: + constraint.data?.map( (entity) => Boolean(entity) && { name: entity.name, @@ -417,55 +415,25 @@ export class DigitalPlanning { ? "https://www.ordnancesurvey.co.uk/products/os-mastermap-highways-network-roads" : `https://planinng.data.gov.uk/entity/${entity.id}`, }, - ), - } as PlanningDesignation); - } else if (orderKeys.includes(key)) { - orders.push({ - value: key, - description: this.findDescriptionFromValue( - "PlanningOrder", - key, - ), - intersects: constraint.value, - entities: constraint.data?.map( - (entity) => - Boolean(entity) && { - name: entity.name, - description: entity.description, - source: `https://planinng.data.gov.uk/entity/${entity.id}`, - }, - ), - } as PlanningOrder); - } + ) || [], + } as PlanningDesignation); } else { // Non-intersecting constraints - if (designationKeys.includes(key)) { - designations.push({ - value: key, - description: this.findDescriptionFromValue( - "PlanningDesignation", - key, - ), - intersects: constraint.value, - } as PlanningDesignation); - } else if (orderKeys.includes(key)) { - orders.push({ - value: key, - description: this.findDescriptionFromValue( - "PlanningOrder", - key, - ), - intersects: constraint.value, - } as PlanningOrder); - } + designations.push({ + value: key, + description: this.findDescriptionFromValueUnionType( + "PlanningDesignation", + key, + ), + intersects: constraint.value, + } as PlanningDesignation); } }); }); return { - source: "https://www.planning.data.gov.uk", + sources: constraints?.map((constraint) => constraint.planxRequest) || [], designations: designations, - orders: orders, }; } diff --git a/src/export/digitalPlanning/schema/schema.json b/src/export/digitalPlanning/schema/schema.json index 7a8c5566..c819047f 100644 --- a/src/export/digitalPlanning/schema/schema.json +++ b/src/export/digitalPlanning/schema/schema.json @@ -2374,12 +2374,6 @@ }, "type": "array" }, - "orders": { - "items": { - "$ref": "#/definitions/PlanningOrder" - }, - "type": "array" - }, "plans": { "additionalProperties": false, "properties": { @@ -2399,12 +2393,15 @@ "required": ["local", "neighbourhood"], "type": "object" }, - "source": { - "$ref": "#/definitions/URL", - "description": "An open API request or website that explains how these constraints were sourced" + "sources": { + "description": "A list of open data requests or websites that explain how these constraints were sourced", + "items": { + "$ref": "#/definitions/URL" + }, + "type": "array" } }, - "required": ["source"], + "required": ["sources"], "type": "object" }, "region": { @@ -2767,6 +2764,44 @@ "anyOf": [ { "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Article 4 Direction area", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "article4", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Central Activities Zone (CAZ)", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "article4.caz", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -3127,6 +3162,25 @@ }, "required": ["description", "intersects", "value"], "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Tree Preservation Order (TPO) or zone", + "type": "string" + }, + "intersects": { + "const": false, + "type": "boolean" + }, + "value": { + "const": "tpo", + "type": "string" + } + }, + "required": ["description", "intersects", "value"], + "type": "object" } ], "description": "A planning designation that does not intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" @@ -3137,7 +3191,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Designated land", + "const": "Article 4 Direction area", "type": "string" }, "entities": { @@ -3173,7 +3227,7 @@ "type": "boolean" }, "value": { - "const": "designated", + "const": "article4", "type": "string" } }, @@ -3184,7 +3238,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Area of Outstanding Natural Beauty (AONB)", + "const": "Central Activities Zone (CAZ)", "type": "string" }, "entities": { @@ -3220,7 +3274,7 @@ "type": "boolean" }, "value": { - "const": "designated.AONB", + "const": "article4.caz", "type": "string" } }, @@ -3231,7 +3285,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Conservation Area", + "const": "Designated land", "type": "string" }, "entities": { @@ -3267,7 +3321,7 @@ "type": "boolean" }, "value": { - "const": "designated.conservationArea", + "const": "designated", "type": "string" } }, @@ -3278,7 +3332,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "National Park", + "const": "Area of Outstanding Natural Beauty (AONB)", "type": "string" }, "entities": { @@ -3314,7 +3368,7 @@ "type": "boolean" }, "value": { - "const": "designated.nationalPark", + "const": "designated.AONB", "type": "string" } }, @@ -3325,7 +3379,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "National Park - Broads", + "const": "Conservation Area", "type": "string" }, "entities": { @@ -3361,7 +3415,7 @@ "type": "boolean" }, "value": { - "const": "designated.nationalPark.broads", + "const": "designated.conservationArea", "type": "string" } }, @@ -3372,7 +3426,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Special Protection Area (SPA)", + "const": "National Park", "type": "string" }, "entities": { @@ -3408,7 +3462,7 @@ "type": "boolean" }, "value": { - "const": "designated.SPA", + "const": "designated.nationalPark", "type": "string" } }, @@ -3419,7 +3473,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "UNESCO World Heritage Site or buffer zone", + "const": "National Park - Broads", "type": "string" }, "entities": { @@ -3455,7 +3509,7 @@ "type": "boolean" }, "value": { - "const": "designated.WHS", + "const": "designated.nationalPark.broads", "type": "string" } }, @@ -3466,7 +3520,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Flood Risk Zone", + "const": "Special Protection Area (SPA)", "type": "string" }, "entities": { @@ -3502,7 +3556,7 @@ "type": "boolean" }, "value": { - "const": "flood", + "const": "designated.SPA", "type": "string" } }, @@ -3513,7 +3567,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Flood Risk Zone 1 - Low risk", + "const": "UNESCO World Heritage Site or buffer zone", "type": "string" }, "entities": { @@ -3549,7 +3603,7 @@ "type": "boolean" }, "value": { - "const": "flood.zone.1", + "const": "designated.WHS", "type": "string" } }, @@ -3560,7 +3614,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Flood Risk Zone 2 - Medium risk", + "const": "Flood Risk Zone", "type": "string" }, "entities": { @@ -3596,7 +3650,7 @@ "type": "boolean" }, "value": { - "const": "flood.zone.2", + "const": "flood", "type": "string" } }, @@ -3607,7 +3661,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Flood Risk Zone 3 - High risk", + "const": "Flood Risk Zone 1 - Low risk", "type": "string" }, "entities": { @@ -3643,7 +3697,7 @@ "type": "boolean" }, "value": { - "const": "flood.zone.3", + "const": "flood.zone.1", "type": "string" } }, @@ -3654,7 +3708,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Listed Building", + "const": "Flood Risk Zone 2 - Medium risk", "type": "string" }, "entities": { @@ -3690,7 +3744,7 @@ "type": "boolean" }, "value": { - "const": "listed", + "const": "flood.zone.2", "type": "string" } }, @@ -3701,7 +3755,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Locally Listed Building", + "const": "Flood Risk Zone 3 - High risk", "type": "string" }, "entities": { @@ -3737,7 +3791,7 @@ "type": "boolean" }, "value": { - "const": "locallyListed", + "const": "flood.zone.3", "type": "string" } }, @@ -3748,7 +3802,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Site of a Scheduled Monument", + "const": "Listed Building", "type": "string" }, "entities": { @@ -3784,7 +3838,7 @@ "type": "boolean" }, "value": { - "const": "monument", + "const": "listed", "type": "string" } }, @@ -3795,7 +3849,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Ancient Semi-Natural Woodland (ASNW)", + "const": "Locally Listed Building", "type": "string" }, "entities": { @@ -3831,7 +3885,7 @@ "type": "boolean" }, "value": { - "const": "nature.ASNW", + "const": "locallyListed", "type": "string" } }, @@ -3842,7 +3896,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Special Area of Conservation (SAC)", + "const": "Site of a Scheduled Monument", "type": "string" }, "entities": { @@ -3878,7 +3932,7 @@ "type": "boolean" }, "value": { - "const": "nature.SAC", + "const": "monument", "type": "string" } }, @@ -3889,7 +3943,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Site of Special Scientific Interest (SSSI)", + "const": "Ancient Semi-Natural Woodland (ASNW)", "type": "string" }, "entities": { @@ -3925,7 +3979,7 @@ "type": "boolean" }, "value": { - "const": "nature.SSSI", + "const": "nature.ASNW", "type": "string" } }, @@ -3936,7 +3990,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Historic Park or Garden", + "const": "Special Area of Conservation (SAC)", "type": "string" }, "entities": { @@ -3972,7 +4026,7 @@ "type": "boolean" }, "value": { - "const": "registeredPark", + "const": "nature.SAC", "type": "string" } }, @@ -3983,7 +4037,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Classified Road", + "const": "Site of Special Scientific Interest (SSSI)", "type": "string" }, "entities": { @@ -4019,91 +4073,18 @@ "type": "boolean" }, "value": { - "const": "road.classified", + "const": "nature.SSSI", "type": "string" } }, "required": ["description", "entities", "intersects", "value"], "type": "object" - } - ], - "description": "A planning designation that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" - } - ], - "description": "Planning designations that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey" - }, - "PlanningOrder": { - "$id": "#PlanningOrder", - "anyOf": [ - { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "description": { - "const": "Article 4 Direction area", - "type": "string" - }, - "intersects": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "article4", - "type": "string" - } - }, - "required": ["description", "intersects", "value"], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "description": { - "const": "Central Activities Zone (CAZ)", - "type": "string" - }, - "intersects": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "article4.caz", - "type": "string" - } - }, - "required": ["description", "intersects", "value"], - "type": "object" }, { "additionalProperties": false, "properties": { "description": { - "const": "Tree Preservation Order (TPO) or zone", - "type": "string" - }, - "intersects": { - "const": false, - "type": "boolean" - }, - "value": { - "const": "tpo", - "type": "string" - } - }, - "required": ["description", "intersects", "value"], - "type": "object" - } - ], - "description": "A planning order that does not intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" - }, - { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "description": { - "const": "Article 4 Direction area", + "const": "Historic Park or Garden", "type": "string" }, "entities": { @@ -4139,7 +4120,7 @@ "type": "boolean" }, "value": { - "const": "article4", + "const": "registeredPark", "type": "string" } }, @@ -4150,7 +4131,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Central Activities Zone (CAZ)", + "const": "Classified Road", "type": "string" }, "entities": { @@ -4186,7 +4167,7 @@ "type": "boolean" }, "value": { - "const": "article4.caz", + "const": "road.classified", "type": "string" } }, @@ -4241,10 +4222,10 @@ "type": "object" } ], - "description": "A planning order that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" + "description": "A planning designation that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects" } ], - "description": "Planning orders that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey" + "description": "Planning designations that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey" }, "Point": { "additionalProperties": false, @@ -15080,12 +15061,6 @@ }, "type": "array" }, - "orders": { - "items": { - "$ref": "#/definitions/PlanningOrder" - }, - "type": "array" - }, "plans": { "additionalProperties": false, "properties": { @@ -15105,12 +15080,15 @@ "required": ["local", "neighbourhood"], "type": "object" }, - "source": { - "$ref": "#/definitions/URL", - "description": "An open API request or website that explains how these constraints were sourced" + "sources": { + "description": "A list of open data requests or websites that explain how these constraints were sourced", + "items": { + "$ref": "#/definitions/URL" + }, + "type": "array" } }, - "required": ["source"], + "required": ["sources"], "type": "object" }, "region": { diff --git a/src/export/digitalPlanning/schema/types.d.ts b/src/export/digitalPlanning/schema/types.d.ts index 0c8aa11c..ee030a1e 100644 --- a/src/export/digitalPlanning/schema/types.d.ts +++ b/src/export/digitalPlanning/schema/types.d.ts @@ -227,6 +227,16 @@ export type URL = string; */ export type PlanningDesignation = | ( + | { + description: "Article 4 Direction area"; + intersects: false; + value: "article4"; + } + | { + description: "Central Activities Zone (CAZ)"; + intersects: false; + value: "article4.caz"; + } | { description: "Designated land"; intersects: false; @@ -322,8 +332,37 @@ export type PlanningDesignation = intersects: false; value: "road.classified"; } + | { + description: "Tree Preservation Order (TPO) or zone"; + intersects: false; + value: "tpo"; + } ) | ( + | { + description: "Article 4 Direction area"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "article4"; + } + | { + description: "Central Activities Zone (CAZ)"; + entities: + | { + description?: string; + name: string; + source?: URL; + }[] + | []; + intersects: true; + value: "article4.caz"; + } | { description: "Designated land"; entities: @@ -552,53 +591,6 @@ export type PlanningDesignation = intersects: true; value: "road.classified"; } - ); -/** - * Planning orders that may intersect with the proposed site determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey - */ -export type PlanningOrder = - | ( - | { - description: "Article 4 Direction area"; - intersects: false; - value: "article4"; - } - | { - description: "Central Activities Zone (CAZ)"; - intersects: false; - value: "article4.caz"; - } - | { - description: "Tree Preservation Order (TPO) or zone"; - intersects: false; - value: "tpo"; - } - ) - | ( - | { - description: "Article 4 Direction area"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - intersects: true; - value: "article4"; - } - | { - description: "Central Activities Zone (CAZ)"; - entities: - | { - description?: string; - name: string; - source?: URL; - }[] - | []; - intersects: true; - value: "article4.caz"; - } | { description: "Tree Preservation Order (TPO) or zone"; entities: @@ -3886,15 +3878,14 @@ export interface UKProperty { conditions?: PlanningConstraint[]; designations?: PlanningDesignation[]; guidance?: PlanningConstraint[]; - orders?: PlanningOrder[]; plans?: { local: PlanningConstraint[]; neighbourhood: PlanningConstraint[]; }; /** - * An open API request or website that explains how these constraints were sourced + * A list of open data requests or websites that explain how these constraints were sourced */ - source: string; + sources: URL[]; }; region: UKRegion; type: PropertyType; @@ -4178,15 +4169,14 @@ export interface LondonProperty { conditions?: PlanningConstraint[]; designations?: PlanningDesignation[]; guidance?: PlanningConstraint[]; - orders?: PlanningOrder[]; plans?: { local: PlanningConstraint[]; neighbourhood: PlanningConstraint[]; }; /** - * An open API request or website that explains how these constraints were sourced + * A list of open data requests or websites that explain how these constraints were sourced */ - source: string; + sources: URL[]; }; region: "London"; titleNumber: { From ae736bfdf007d4f8479cc471d32bca5f76ddbba6 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 17 Nov 2023 14:57:25 +0100 Subject: [PATCH 3/3] v0.2.0 and team referenceCode --- .../mocks/lawfulDevelopmentCertificate.ts | 2 + .../mocks/planningPermission.ts | 1 + .../digitalPlanning/mocks/priorApproval.ts | 1 + src/export/digitalPlanning/model.test.ts | 27 ++++++++++--- src/export/digitalPlanning/model.ts | 2 +- src/export/digitalPlanning/schema/schema.json | 38 +++++++++++++++++-- src/export/digitalPlanning/schema/types.d.ts | 12 +++++- src/requests/session.ts | 1 + src/types/session.ts | 1 + 9 files changed, 74 insertions(+), 11 deletions(-) diff --git a/src/export/digitalPlanning/mocks/lawfulDevelopmentCertificate.ts b/src/export/digitalPlanning/mocks/lawfulDevelopmentCertificate.ts index f7b05073..a5687db4 100644 --- a/src/export/digitalPlanning/mocks/lawfulDevelopmentCertificate.ts +++ b/src/export/digitalPlanning/mocks/lawfulDevelopmentCertificate.ts @@ -5,6 +5,7 @@ export const mockLDCESession = { slug: "apply-for-a-lawful-development-certificate", team: { slug: "buckinghamshire", + referenceCode: "BKM", }, }, created_at: "2023-09-01T06:11:24.502169+00:00", @@ -4505,6 +4506,7 @@ export const mockLDCPSession = { slug: "apply-for-a-lawful-development-certificate", team: { slug: "buckinghamshire", + referenceCode: "BKM", }, }, created_at: "2023-09-04T05:59:05.516553+00:00", diff --git a/src/export/digitalPlanning/mocks/planningPermission.ts b/src/export/digitalPlanning/mocks/planningPermission.ts index ee5e4dda..a1259455 100644 --- a/src/export/digitalPlanning/mocks/planningPermission.ts +++ b/src/export/digitalPlanning/mocks/planningPermission.ts @@ -5,6 +5,7 @@ export const mockPlanningPermissionSession = { slug: "apply-for-planning-permission", team: { slug: "lambeth", + referenceCode: "LBH", }, }, created_at: "2023-08-31T17:33:46.22695+00:00", diff --git a/src/export/digitalPlanning/mocks/priorApproval.ts b/src/export/digitalPlanning/mocks/priorApproval.ts index f9e01c4a..0b0e616a 100644 --- a/src/export/digitalPlanning/mocks/priorApproval.ts +++ b/src/export/digitalPlanning/mocks/priorApproval.ts @@ -5,6 +5,7 @@ export const mockPriorApprovalSession = { slug: "apply-for-prior-approval", team: { slug: "southwark", + referenceCode: "SWK", }, }, created_at: "2023-09-02T13:36:24.49483+00:00", diff --git a/src/export/digitalPlanning/model.test.ts b/src/export/digitalPlanning/model.test.ts index e4fd8e68..99150823 100644 --- a/src/export/digitalPlanning/model.test.ts +++ b/src/export/digitalPlanning/model.test.ts @@ -12,7 +12,10 @@ import { mockPriorApprovalSession } from "./mocks/priorApproval"; import { DigitalPlanning } from "./model"; // `getPlanningConstraints` relies on an accurate teamSlug to be available, other vars can be be mocked -const mockMetadataForSession = (teamSlug: string): SessionMetadata => ({ +const mockMetadataForSession = ( + teamSlug: string, + referenceCode: string, +): SessionMetadata => ({ id: "c06eebb7-6201-4bc0-9fe7-ec5d7a1c0797", createdAt: "2023-01-01 00:00:00", submittedAt: "2023-01-02 00:00:00", @@ -22,6 +25,7 @@ const mockMetadataForSession = (teamSlug: string): SessionMetadata => ({ team: { name: teamSlug, slug: teamSlug, + referenceCode: referenceCode, }, }, }); @@ -33,21 +37,30 @@ const mockSessions = [ passport: new Passport({ data: { ...mockLDCPSession.passport } }), breadcrumbs: mockLDCPSession.breadcrumbs as Breadcrumbs, flow: mockPublishedLDCFlow, - metadata: mockMetadataForSession(mockLDCPSession.flow.team.slug), + metadata: mockMetadataForSession( + mockLDCPSession.flow.team.slug, + mockLDCPSession.flow.team.referenceCode, + ), }, { name: "LDC - Existing", passport: new Passport({ data: { ...mockLDCESession.passport } }), breadcrumbs: mockLDCESession.breadcrumbs as Breadcrumbs, flow: mockPublishedLDCFlow, - metadata: mockMetadataForSession(mockLDCESession.flow.team.slug), + metadata: mockMetadataForSession( + mockLDCESession.flow.team.slug, + mockLDCESession.flow.team.referenceCode, + ), }, { name: "Prior Approval", passport: new Passport({ data: { ...mockPriorApprovalSession.passport } }), breadcrumbs: mockPriorApprovalSession.breadcrumbs as Breadcrumbs, flow: mockPublishedPriorApprovalFlow, - metadata: mockMetadataForSession(mockPriorApprovalSession.flow.team.slug), + metadata: mockMetadataForSession( + mockPriorApprovalSession.flow.team.slug, + mockPriorApprovalSession.flow.team.referenceCode, + ), }, { name: "Planning Permission", @@ -58,6 +71,7 @@ const mockSessions = [ flow: mockPublishedPlanningPermissionFlow, metadata: mockMetadataForSession( mockPlanningPermissionSession.flow.team.slug, + mockPlanningPermissionSession.flow.team.referenceCode, ), }, ]; @@ -68,7 +82,10 @@ const mockParams = { passport: new Passport({ data: { ...mockLDCPSession.passport } }), breadcrumbs: mockLDCPSession.breadcrumbs, flow: mockPublishedLDCFlow, - metadata: mockMetadataForSession(mockLDCPSession.flow.team.slug), + metadata: mockMetadataForSession( + mockLDCPSession.flow.team.slug, + mockLDCPSession.flow.team.referenceCode, + ), }; describe("DigitalPlanning", () => { diff --git a/src/export/digitalPlanning/model.ts b/src/export/digitalPlanning/model.ts index a91874a2..32030ca7 100644 --- a/src/export/digitalPlanning/model.ts +++ b/src/export/digitalPlanning/model.ts @@ -760,7 +760,7 @@ export class DigitalPlanning { private getMetadata(): Payload["metadata"] { return { id: this.sessionId, - organisation: this.metadata.flow.team.slug, + organisation: this.metadata.flow.team.referenceCode, submittedAt: this.metadata.submittedAt, source: "PlanX", service: { diff --git a/src/export/digitalPlanning/schema/schema.json b/src/export/digitalPlanning/schema/schema.json index c819047f..3d997060 100644 --- a/src/export/digitalPlanning/schema/schema.json +++ b/src/export/digitalPlanning/schema/schema.json @@ -1,5 +1,5 @@ { - "$id": "@next", + "$id": "v0.2.0", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { @@ -820,6 +820,36 @@ }, "required": ["value", "description"], "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Planning Permission - Major application", + "type": "string" + }, + "value": { + "const": "pp.full.major", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Planning Permission - Minor application", + "type": "string" + }, + "value": { + "const": "pp.full.minor", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" } ], "description": "Planning application types" @@ -981,7 +1011,8 @@ "description": "Unique identifier for this application" }, "organisation": { - "description": "UK Local Authority that this application is being submitted to", + "description": "The reference code for the organisation responsible for processing this planning application, sourced from planning.data.gov.uk/dataset/local-authority", + "maxLength": 4, "type": "string" }, "schema": { @@ -2652,7 +2683,8 @@ "description": "Unique identifier for this application" }, "organisation": { - "description": "UK Local Authority that this application is being submitted to", + "description": "The reference code for the organisation responsible for processing this planning application, sourced from planning.data.gov.uk/dataset/local-authority", + "maxLength": 4, "type": "string" }, "schema": { diff --git a/src/export/digitalPlanning/schema/types.d.ts b/src/export/digitalPlanning/schema/types.d.ts index ee030a1e..ce854d75 100644 --- a/src/export/digitalPlanning/schema/types.d.ts +++ b/src/export/digitalPlanning/schema/types.d.ts @@ -174,6 +174,14 @@ export type ApplicationType = | { description: "Planning Permission - Full householder retrospective"; value: "pp.full.householder.retro"; + } + | { + description: "Planning Permission - Major application"; + value: "pp.full.major"; + } + | { + description: "Planning Permission - Minor application"; + value: "pp.full.minor"; }; /** * Information about the site where the works will happen @@ -4406,7 +4414,7 @@ export interface BaseMetadata { */ id: string; /** - * UK Local Authority that this application is being submitted to + * The reference code for the organisation responsible for processing this planning application, sourced from planning.data.gov.uk/dataset/local-authority */ organisation: string; schema: URL; @@ -4421,7 +4429,7 @@ export interface PlanXMetadata { */ id: string; /** - * UK Local Authority that this application is being submitted to + * The reference code for the organisation responsible for processing this planning application, sourced from planning.data.gov.uk/dataset/local-authority */ organisation: string; schema: URL; diff --git a/src/requests/session.ts b/src/requests/session.ts index 2f86f209..f10cf91e 100644 --- a/src/requests/session.ts +++ b/src/requests/session.ts @@ -163,6 +163,7 @@ export async function getSessionMetadata( team { name slug + referenceCode: reference_code } } } diff --git a/src/types/session.ts b/src/types/session.ts index dbd2522e..3ce3d2d5 100644 --- a/src/types/session.ts +++ b/src/types/session.ts @@ -65,6 +65,7 @@ export type SessionMetadata = { team: { name: string; slug: string; + referenceCode: string; }; }; };