From 51fd5f75f0919093811ab9b487a35fd40174dc1e Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Fri, 27 Oct 2023 16:19:36 +0100 Subject: [PATCH] feat: update digital planning data schema mappings (#176) --- src/export/digitalPlanning/model.ts | 137 +-- src/export/digitalPlanning/schema/schema.json | 941 ++++++++++++++---- src/export/digitalPlanning/schema/types.d.ts | 488 +++++++-- 3 files changed, 1213 insertions(+), 353 deletions(-) diff --git a/src/export/digitalPlanning/model.ts b/src/export/digitalPlanning/model.ts index 3683c85d..da4f8251 100644 --- a/src/export/digitalPlanning/model.ts +++ b/src/export/digitalPlanning/model.ts @@ -23,6 +23,7 @@ import { DigitalPlanningApplication as Payload, File, FileType, + GeoJSON, LondonProperty, PlanningConstraint, ProjectType, @@ -83,34 +84,23 @@ export class DigitalPlanning { type: this.getApplicationType(), fee: this.getApplicationFee(), declaration: this.getApplicationDeclaration(), + ...(this.passport.data?.["application.preAppAdvice.form"] && + this.passport.data?.["application.preAppAdvice.form"][0] === + "Yes" && { + preApp: this.getPreApp(), + }), }, proposal: this.getProposal(), }, result: this.getResult(), responses: this.getResponses(), files: this.getFiles(), - metadata: { - 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`, - }, - }, + metadata: this.getMetadata(), }; } validatePayload() { - const ajv = addFormats(new Ajv()); + const ajv = addFormats(new Ajv({ allowUnionTypes: true })); const validate = ajv.compile(jsonSchema); const isValid = validate(this.payload); @@ -200,24 +190,24 @@ export class DigitalPlanning { private getApplicant(): Payload["data"]["applicant"] { const baseApplicant: Payload["data"]["applicant"] = { type: this.passport.data?.["applicant.type"]?.[0], - contact: { - name: { - title: this.passport.data?.["applicant.name.title"] as string, - first: this.passport.data?.["applicant.name.first"] as string, - last: this.passport.data?.["applicant.name.last"] as string, - }, - email: - (this.passport.data?.["applicant.email"] as string) || - (this.passport.data?.["applicant.agent.email"] as string), - phone: { - primary: - (this.passport.data?.["applicant.phone.primary"] as string) || - "Not provided by agent", - }, + name: { + title: this.passport.data?.["applicant.name.title"] as string, + first: this.passport.data?.["applicant.name.first"] as string, + last: this.passport.data?.["applicant.name.last"] as string, + }, + email: + (this.passport.data?.["applicant.email"] as string) || + (this.passport.data?.["applicant.agent.email"] as string), + phone: { + primary: + (this.passport.data?.["applicant.phone.primary"] as string) || + "Not provided by agent", + }, + ...(this.passport.data?.["applicant.company.name"] && { company: { name: this.passport.data?.["applicant.company.name"] as string, }, - }, + }), address: { sameAsSiteAddress: true, }, @@ -241,24 +231,24 @@ export class DigitalPlanning { return { ...this.getApplicant(), agent: { - contact: { - name: { - title: this.passport.data?.["applicant.agent.name.title"] as string, - first: this.passport.data?.["applicant.agent.name.first"] as string, - last: this.passport.data?.["applicant.agent.name.last"] as string, - }, - email: this.passport.data?.["applicant.agent.email"] as string, - phone: { - primary: this.passport.data?.[ - "applicant.agent.phone.primary" - ] as string, - }, + name: { + title: this.passport.data?.["applicant.agent.name.title"] as string, + first: this.passport.data?.["applicant.agent.name.first"] as string, + last: this.passport.data?.["applicant.agent.name.last"] as string, + }, + email: this.passport.data?.["applicant.agent.email"] as string, + phone: { + primary: this.passport.data?.[ + "applicant.agent.phone.primary" + ] as string, + }, + ...(this.passport.data?.["applicant.agent.company.name"] && { company: { name: this.passport.data?.[ "applicant.agent.company.name" ] as string, }, - }, + }), address: { line1: this.passport.data?.["applicant.agent.address"]?.["line1"], line2: this.passport.data?.["applicant.agent.address"]?.["line2"], @@ -323,7 +313,9 @@ export class DigitalPlanning { private getBoundary(): Payload["data"]["property"]["boundary"] { return { - site: this.passport.data?.["property.boundary.site"], + site: this.passport.data?.[ + "property.boundary.site" + ] as unknown as GeoJSON, area: { hectares: this.passport.data?.["proposal.siteArea.hectares"] || @@ -348,25 +340,30 @@ export class DigitalPlanning { this.passport.data?.["property.type"]?.[0], ), }, - // Only include the 'boundary' & `constraints` keys in cases where we have data + constraints: 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(), }), - ...(this.passport.data?._constraint && { - constraints: this.getPlanningConstraints(), - }), }; if (this.passport.data?._address?.["property.region"]?.[0] === "London") { return { ...baseProperty, titleNumber: { - known: this.passport.data?.["property.titleNumberKnown.form"], - number: this.passport.data?.["property.titleNumber"], + known: this.passport.data?.["property.titleNumberKnown.form"]?.[0], + ...(this.passport.data?.["property.titleNumberKnown.form"]?.[0] === + "Yes" && { + number: this.passport.data?.["property.titleNumber"], + }), }, EPC: { - known: this.passport.data?.["property.EPCKnown.form"], - number: this.passport.data?.["property.EPC.number"], + known: this.passport.data?.["property.EPCKnown.form"]?.[0], + ...(this.passport.data?.["property.EPCKnown.form"]?.[0]?.startsWith( + "Yes", + ) && { + number: this.passport.data?.["property.EPC.number"], + }), }, } as LondonProperty; } else { @@ -489,6 +486,15 @@ export class DigitalPlanning { }; } + private getPreApp(): Payload["data"]["application"]["preApp"] { + return { + reference: this.passport.data?.["application.preAppAdvice.reference"], + date: this.passport.data?.["application.preApp.date"], + officer: this.passport.data?.["application.preAppAdvice.officerName"], + summary: this.passport.data?.["application.preApp.summary"], + } as Payload["data"]["application"]["preApp"]; + } + // @todo getResult() should support flagsets beyond Planning Permission private getResult(): Payload["result"] { // Planning Permission application types won't have a Planning Permission result right now @@ -523,7 +529,6 @@ export class DigitalPlanning { }), description: this.passport.data?.["proposal.description"] || "Not provided", - boundary: this.getBoundary(), date: { start: this.passport.generic("proposal.start.date"), completion: this.passport.generic("proposal.completion.date"), // this.passport.data?.["proposal.finish.date"], @@ -737,4 +742,24 @@ export class DigitalPlanning { return responses as Payload["responses"]; } + + private getMetadata(): Payload["metadata"] { + return { + 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`, + }, + }; + } } diff --git a/src/export/digitalPlanning/schema/schema.json b/src/export/digitalPlanning/schema/schema.json index 221c595e..aff36b8f 100644 --- a/src/export/digitalPlanning/schema/schema.json +++ b/src/export/digitalPlanning/schema/schema.json @@ -1,12 +1,12 @@ { - "$id": "v0.1.1", + "$id": "v0.1.2", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { - "AddressInput": { - "$id": "#AddressInput", + "Address": { + "$id": "#Address", "additionalProperties": false, - "description": "Address information for a personal contact not necessarily associated with the site", + "description": "Address information for a person associated with this application not at the property address", "properties": { "country": { "type": "string" @@ -33,7 +33,7 @@ "Agent": { "$id": "#Agent", "additionalProperties": false, - "description": "Information about the user who completed the application on behalf of someone else", + "description": "Information about the agent or proxy who completed the application on behalf of someone else", "properties": { "address": { "$ref": "#/definitions/UserAddress" @@ -42,60 +42,95 @@ "additionalProperties": false, "properties": { "address": { - "$ref": "#/definitions/AddressInput" + "$ref": "#/definitions/Address" }, - "contact": { - "$ref": "#/definitions/UserContact" + "company": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": ["name"], + "type": "object" + }, + "email": { + "$ref": "#/definitions/Email" + }, + "name": { + "additionalProperties": false, + "properties": { + "first": { + "type": "string" + }, + "last": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": ["first", "last"], + "type": "object" + }, + "phone": { + "additionalProperties": false, + "properties": { + "primary": { + "type": "string" + } + }, + "required": ["primary"], + "type": "object" + } + }, + "required": ["name", "email", "phone", "address"], + "type": "object" + }, + "company": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" } }, - "required": ["contact", "address"], + "required": ["name"], "type": "object" }, - "contact": { - "$ref": "#/definitions/UserContact" + "email": { + "$ref": "#/definitions/Email" }, "interest": { - "enum": ["owner.sole", "owner.co", "tenant", "occupier"], + "enum": ["owner.sole", "owner.co", "tenant", "occupier", "other"], "type": "string" }, - "ownership": { + "name": { "additionalProperties": false, "properties": { - "certificate": { - "enum": ["a", "b", "c", "d"], + "first": { "type": "string" }, - "noticeGiven": { - "type": "boolean" + "last": { + "type": "string" }, - "owners": { - "items": { - "additionalProperties": false, - "properties": { - "address": { - "anyOf": [ - { - "$ref": "#/definitions/AddressInput" - }, - { - "type": "string" - } - ] - }, - "name": { - "type": "string" - }, - "noticeDate": { - "$ref": "#/definitions/Date" - } - }, - "required": ["name", "address"], - "type": "object" - }, - "type": "array" + "title": { + "type": "string" + } + }, + "required": ["first", "last"], + "type": "object" + }, + "ownership": { + "$ref": "#/definitions/Ownership" + }, + "phone": { + "additionalProperties": false, + "properties": { + "primary": { + "type": "string" } }, - "required": ["certificate"], + "required": ["primary"], "type": "object" }, "siteContact": { @@ -112,7 +147,15 @@ "type": "string" } }, - "required": ["address", "agent", "contact", "siteContact", "type"], + "required": [ + "address", + "agent", + "email", + "name", + "phone", + "siteContact", + "type" + ], "type": "object" }, "Applicant": { @@ -133,34 +176,7 @@ "description": "Information about this planning application", "properties": { "declaration": { - "additionalProperties": false, - "properties": { - "accurate": { - "type": "boolean" - }, - "connection": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "value": { - "enum": [ - "employee", - "relation.employee", - "electedMember", - "relation.electedMember", - "none" - ], - "type": "string" - } - }, - "required": ["value"], - "type": "object" - } - }, - "required": ["accurate", "connection"], - "type": "object" + "$ref": "#/definitions/ApplicationDeclaration" }, "fee": { "$ref": "#/definitions/ApplicationFee" @@ -175,6 +191,38 @@ "required": ["type", "fee", "declaration"], "type": "object" }, + "ApplicationDeclaration": { + "$id": "#ApplicationDeclaration", + "additionalProperties": false, + "description": "Declarations about the accuracy of this application and any personal connections to the receiving authority", + "properties": { + "accurate": { + "type": "boolean" + }, + "connection": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "value": { + "enum": [ + "employee", + "relation.employee", + "electedMember", + "relation.electedMember", + "none" + ], + "type": "string" + } + }, + "required": ["value"], + "type": "object" + } + }, + "required": ["accurate", "connection"], + "type": "object" + }, "ApplicationFee": { "$id": "#ApplicationFee", "additionalProperties": false, @@ -219,6 +267,7 @@ "additionalProperties": false, "properties": { "govPay": { + "description": "GOV.UK Pay payment reference number", "type": "string" } }, @@ -251,7 +300,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Lawful Development Certificate - Proposed", + "const": "Lawful Development Certificate - Proposed use", "type": "string" }, "value": { @@ -266,7 +315,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Lawful Development Certificate - Existing", + "const": "Lawful Development Certificate - Existing use", "type": "string" }, "value": { @@ -277,6 +326,36 @@ "required": ["value", "description"], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Lawful Development Certificate - Continue an existing use", + "type": "string" + }, + "value": { + "const": "ldc.existing.regularise", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Lawful Development Certificate - Lawful not to comply with a condition or limitation", + "type": "string" + }, + "value": { + "const": "ldc.condition", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -744,6 +823,27 @@ "required": ["squareMetres"], "type": "object" }, + "BBox": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "maxItems": 4, + "minItems": 4, + "type": "array" + }, + { + "items": { + "type": "number" + }, + "maxItems": 6, + "minItems": 6, + "type": "array" + } + ], + "description": "Bounding box https://tools.ietf.org/html/rfc7946#section-5" + }, "BaseApplicant": { "$id": "#BaseApplicant", "additionalProperties": false, @@ -752,51 +852,50 @@ "address": { "$ref": "#/definitions/UserAddress" }, - "contact": { - "$ref": "#/definitions/UserContact" + "company": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": ["name"], + "type": "object" + }, + "email": { + "$ref": "#/definitions/Email" }, "interest": { - "enum": ["owner.sole", "owner.co", "tenant", "occupier"], + "enum": ["owner.sole", "owner.co", "tenant", "occupier", "other"], "type": "string" }, - "ownership": { + "name": { "additionalProperties": false, "properties": { - "certificate": { - "enum": ["a", "b", "c", "d"], + "first": { "type": "string" }, - "noticeGiven": { - "type": "boolean" + "last": { + "type": "string" }, - "owners": { - "items": { - "additionalProperties": false, - "properties": { - "address": { - "anyOf": [ - { - "$ref": "#/definitions/AddressInput" - }, - { - "type": "string" - } - ] - }, - "name": { - "type": "string" - }, - "noticeDate": { - "$ref": "#/definitions/Date" - } - }, - "required": ["name", "address"], - "type": "object" - }, - "type": "array" + "title": { + "type": "string" + } + }, + "required": ["first", "last"], + "type": "object" + }, + "ownership": { + "$ref": "#/definitions/Ownership" + }, + "phone": { + "additionalProperties": false, + "properties": { + "primary": { + "type": "string" } }, - "required": ["certificate"], + "required": ["primary"], "type": "object" }, "siteContact": { @@ -813,7 +912,7 @@ "type": "string" } }, - "required": ["type", "contact", "address", "siteContact"], + "required": ["type", "name", "email", "phone", "address", "siteContact"], "type": "object" }, "BaseDetails": { @@ -869,6 +968,87 @@ "format": "email", "type": "string" }, + "Feature": { + "additionalProperties": false, + "description": "A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "geometry": { + "$ref": "#/definitions/Geometry", + "description": "The feature's geometry" + }, + "id": { + "description": "A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2.", + "type": ["string", "number"] + }, + "properties": { + "$ref": "#/definitions/GeoJsonProperties", + "description": "Properties associated with this feature." + }, + "type": { + "const": "Feature", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["geometry", "properties", "type"], + "type": "object" + }, + "Feature": { + "additionalProperties": false, + "description": "A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "geometry": { + "$ref": "#/definitions/Geometry", + "description": "The feature's geometry" + }, + "id": { + "description": "A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2.", + "type": ["string", "number"] + }, + "properties": { + "$ref": "#/definitions/GeoJsonProperties", + "description": "Properties associated with this feature." + }, + "type": { + "const": "Feature", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["geometry", "properties", "type"], + "type": "object" + }, + "FeatureCollection": { + "additionalProperties": false, + "description": "A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "features": { + "items": { + "$ref": "#/definitions/Feature%3CGeometry%2CGeoJsonProperties%3E" + }, + "type": "array" + }, + "type": { + "const": "FeatureCollection", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["features", "type"], + "type": "object" + }, "File": { "$id": "#File", "additionalProperties": false, @@ -897,7 +1077,22 @@ "additionalProperties": false, "properties": { "description": { - "const": "Elevation plan - existing", + "const": "Evidence for application fee exemption - disability", + "type": "string" + }, + "value": { + "const": "applicant.disability.evidence", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Elevations - existing", "type": "string" }, "value": { @@ -942,7 +1137,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Section - existing", + "const": "Sections - existing", "type": "string" }, "value": { @@ -1002,11 +1197,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Location plan", + "const": "Elevations - proposed", "type": "string" }, "value": { - "const": "property.site.locationPlan", + "const": "proposal.drawing.elevation", "type": "string" } }, @@ -1017,11 +1212,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Elevation plan - proposed", + "const": "Floor plan - proposed", "type": "string" }, "value": { - "const": "proposal.drawing.elevation", + "const": "proposal.drawing.floorPlan", "type": "string" } }, @@ -1032,11 +1227,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Floor plan - proposed", + "const": "Location plan", "type": "string" }, "value": { - "const": "proposal.drawing.floorPlan", + "const": "proposal.drawing.locationPlan", "type": "string" } }, @@ -1077,7 +1272,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Section - proposed", + "const": "Sections - proposed", "type": "string" }, "value": { @@ -1404,44 +1599,153 @@ "type": "object" }, { - "additionalProperties": false, - "properties": { - "description": { - "const": "Photographs", - "type": "string" - }, - "value": { - "const": "proposal.photograph", - "type": "string" - } - }, - "required": ["value", "description"], - "type": "object" + "additionalProperties": false, + "properties": { + "description": { + "const": "Photographs", + "type": "string" + }, + "value": { + "const": "proposal.photograph", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Photographs - evidence", + "type": "string" + }, + "value": { + "const": "proposal.photograph.evidence", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Visualisations", + "type": "string" + }, + "value": { + "const": "proposal.visualisation", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + } + ], + "description": "Types of planning documents and drawings" + }, + "GeoJSON": { + "anyOf": [ + { + "$ref": "#/definitions/Geometry" + }, + { + "$ref": "#/definitions/Feature" + }, + { + "$ref": "#/definitions/FeatureCollection" + } + ], + "description": "Union of GeoJSON objects." + }, + "GeoJsonProperties": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ] + }, + "Geometry": { + "anyOf": [ + { + "$ref": "#/definitions/Point" + }, + { + "$ref": "#/definitions/MultiPoint" + }, + { + "$ref": "#/definitions/LineString" + }, + { + "$ref": "#/definitions/MultiLineString" + }, + { + "$ref": "#/definitions/Polygon" }, { - "additionalProperties": false, - "properties": { - "description": { - "const": "Visualisations", - "type": "string" - }, - "value": { - "const": "proposal.visualisation", - "type": "string" - } - }, - "required": ["value", "description"], - "type": "object" + "$ref": "#/definitions/MultiPolygon" + }, + { + "$ref": "#/definitions/GeometryCollection" } ], - "description": "Types of planning documents and drawings" + "description": "Geometry object. https://tools.ietf.org/html/rfc7946#section-3" }, - "GeoJSON": { - "$id": "#GeoJSON", + "GeometryCollection": { + "additionalProperties": false, + "description": "Geometry Collection https://tools.ietf.org/html/rfc7946#section-3.1.8", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "geometries": { + "items": { + "$ref": "#/definitions/Geometry" + }, + "type": "array" + }, + "type": { + "const": "GeometryCollection", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["geometries", "type"], + "type": "object" + }, + "LineString": { + "additionalProperties": false, + "description": "LineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.4", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "coordinates": { + "items": { + "$ref": "#/definitions/Position" + }, + "type": "array" + }, + "type": { + "const": "LineString", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["coordinates", "type"], "type": "object" }, "LondonDetails": { + "$id": "#LondonDetails", "additionalProperties": false, + "description": "Proposal details for project sites within the Greater London Authority (GLA) area", "properties": { "extend": { "additionalProperties": false, @@ -1958,7 +2262,7 @@ "LondonProperty": { "$id": "#LondonProperty", "additionalProperties": false, - "description": "Property details for sites within London", + "description": "Property details for sites within the Greater London Authority (GLA) area", "properties": { "EPC": { "additionalProperties": false, @@ -1977,6 +2281,7 @@ } }, "required": ["known"], + "title": "Energy Performance Certificate", "type": "object" }, "address": { @@ -2016,12 +2321,14 @@ "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" }, "titleNumber": { @@ -2045,6 +2352,7 @@ "required": [ "EPC", "address", + "constraints", "localAuthorityDistrict", "region", "titleNumber", @@ -2125,15 +2433,95 @@ "required": ["service", "session", "schema"], "type": "object" }, + "MultiLineString": { + "additionalProperties": false, + "description": "MultiLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.5", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "coordinates": { + "items": { + "items": { + "$ref": "#/definitions/Position" + }, + "type": "array" + }, + "type": "array" + }, + "type": { + "const": "MultiLineString", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["coordinates", "type"], + "type": "object" + }, + "MultiPoint": { + "additionalProperties": false, + "description": "MultiPoint geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.3", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "coordinates": { + "items": { + "$ref": "#/definitions/Position" + }, + "type": "array" + }, + "type": { + "const": "MultiPoint", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["coordinates", "type"], + "type": "object" + }, + "MultiPolygon": { + "additionalProperties": false, + "description": "MultiPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.7", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "coordinates": { + "items": { + "items": { + "items": { + "$ref": "#/definitions/Position" + }, + "type": "array" + }, + "type": "array" + }, + "type": "array" + }, + "type": { + "const": "MultiPolygon", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["coordinates", "type"], + "type": "object" + }, "OSAddress": { "$id": "#OSAddress", "additionalProperties": false, "description": "Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium", "properties": { "latitude": { + "description": "Latitude coordinate in EPSG:4326 (WGS84)", "type": "number" }, "longitude": { + "description": "Longitude coordinate in EPSG:4326 (WGS84)", "type": "number" }, "organisation": { @@ -2162,15 +2550,21 @@ "type": "string" }, "uprn": { + "maxLength": 12, + "title": "Unique Property Reference Number", "type": "string" }, "usrn": { + "maxLength": 8, + "title": "Unique Street Reference Number", "type": "string" }, "x": { + "description": "Easting coordinate in British National Grid (OSGB36)", "type": "number" }, "y": { + "description": "Northing coordinate in British National Grid (OSGB36)", "type": "number" } }, @@ -2191,6 +2585,48 @@ ], "type": "object" }, + "Ownership": { + "$id": "#Ownership", + "additionalProperties": false, + "description": "Information about the ownership certificate and property owners, if different than the applicant", + "properties": { + "certificate": { + "enum": ["a", "b", "c", "d"], + "type": "string" + }, + "noticeGiven": { + "type": "boolean" + }, + "owners": { + "items": { + "additionalProperties": false, + "properties": { + "address": { + "anyOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "type": "string" + } + ] + }, + "name": { + "type": "string" + }, + "noticeDate": { + "$ref": "#/definitions/Date" + } + }, + "required": ["name", "address"], + "type": "object" + }, + "type": "array" + } + }, + "required": ["certificate"], + "type": "object" + }, "PlanningConstraint": { "$id": "#PlanningConstraint", "anyOf": [ @@ -4089,6 +4525,59 @@ ], "description": "Planning constraints that overlap with the property site boundary determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey" }, + "Point": { + "additionalProperties": false, + "description": "Point geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "coordinates": { + "$ref": "#/definitions/Position" + }, + "type": { + "const": "Point", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["coordinates", "type"], + "type": "object" + }, + "Polygon": { + "additionalProperties": false, + "description": "Polygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.6", + "properties": { + "bbox": { + "$ref": "#/definitions/BBox", + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" + }, + "coordinates": { + "items": { + "items": { + "$ref": "#/definitions/Position" + }, + "type": "array" + }, + "type": "array" + }, + "type": { + "const": "Polygon", + "description": "Specifies the type of GeoJSON object.", + "type": "string" + } + }, + "required": ["coordinates", "type"], + "type": "object" + }, + "Position": { + "description": "A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined.", + "items": { + "type": "number" + }, + "type": "array" + }, "PreApplication": { "$id": "#PreApplication", "additionalProperties": false, @@ -4113,6 +4602,21 @@ "ProjectType": { "$id": "#ProjectType", "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Alter a building", + "type": "string" + }, + "value": { + "const": "alter", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -5782,7 +6286,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Convert a building to a different use", + "const": "Change the use of a building", "type": "string" }, "value": { @@ -6033,6 +6537,21 @@ "required": ["value", "description"], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Extend a building or add an outbuilding", + "type": "string" + }, + "value": { + "const": "extend", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -6772,7 +7291,7 @@ "additionalProperties": false, "properties": { "description": { - "const": "Another type of building", + "const": "Add another type of building", "type": "string" }, "value": { @@ -7053,6 +7572,21 @@ "required": ["value", "description"], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Change of units", + "type": "string" + }, + "value": { + "const": "unit", + "type": "string" + } + }, + "required": ["value", "description"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -14083,16 +14617,7 @@ "type": "object" }, "date": { - "additionalProperties": false, - "properties": { - "completion": { - "$ref": "#/definitions/Date" - }, - "start": { - "$ref": "#/definitions/Date" - } - }, - "type": "object" + "$ref": "#/definitions/ProposalDates" }, "description": { "type": "string" @@ -14110,6 +14635,20 @@ "required": ["projectType", "description"], "type": "object" }, + "ProposalDates": { + "$id": "#ProposalDates", + "additionalProperties": false, + "description": "When the proposed works will start and be completed by, not required for all application types", + "properties": { + "completion": { + "$ref": "#/definitions/Date" + }, + "start": { + "$ref": "#/definitions/Date" + } + }, + "type": "object" + }, "ProposalDetails": { "$id": "#ProposalDetails", "anyOf": [ @@ -14128,9 +14667,11 @@ "description": "Address information for sites without a known Unique Property Reference Number (UPRN)", "properties": { "latitude": { + "description": "Latitude coordinate in EPSG:4326 (WGS84)", "type": "number" }, "longitude": { + "description": "Longitude coordinate in EPSG:4326 (WGS84)", "type": "number" }, "source": { @@ -14141,9 +14682,11 @@ "type": "string" }, "x": { + "description": "Easting coordinate in British National Grid (OSGB36)", "type": "number" }, "y": { + "description": "Northing coordinate in British National Grid (OSGB36)", "type": "number" } }, @@ -14800,21 +15343,44 @@ "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": { - "type": "string" + "$ref": "#/definitions/UKRegion" }, "type": { "$ref": "#/definitions/PropertyType" } }, - "required": ["address", "region", "localAuthorityDistrict", "type"], + "required": [ + "address", + "region", + "localAuthorityDistrict", + "type", + "constraints" + ], "type": "object" }, + "UKRegion": { + "$id": "#UKRegion", + "description": "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", + "enum": [ + "North East", + "North West", + "Yorkshire and The Humber", + "East Midlands", + "West Midlands", + "East of England", + "London", + "South East", + "South West" + ], + "type": "string" + }, "URL": { "format": "uri", "pattern": "^https?://", @@ -14860,7 +15426,7 @@ "UserAddressNotSameSite": { "$id": "#UserAddressNotSameSite", "additionalProperties": false, - "description": "Address information for an applicant with contact information that differs from the site address", + "description": "Address information for an applicant with contact information that differs from the property address", "properties": { "country": { "type": "string" @@ -14888,53 +15454,6 @@ "required": ["line1", "postcode", "sameAsSiteAddress", "town"], "type": "object" }, - "UserContact": { - "$id": "#UserContact", - "additionalProperties": false, - "description": "Contact information for any user", - "properties": { - "company": { - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - } - }, - "type": "object" - }, - "email": { - "$ref": "#/definitions/Email" - }, - "name": { - "additionalProperties": false, - "properties": { - "first": { - "type": "string" - }, - "last": { - "type": "string" - }, - "title": { - "type": "string" - } - }, - "required": ["first", "last"], - "type": "object" - }, - "phone": { - "additionalProperties": false, - "properties": { - "primary": { - "type": "string" - } - }, - "required": ["primary"], - "type": "object" - } - }, - "required": ["name", "email", "phone"], - "type": "object" - }, "VehicleParking": { "$id": "#VehicleParking", "anyOf": [ @@ -15302,7 +15821,7 @@ "description": "Vehicle parking types" } }, - "description": "The root schema for an application generated by a digital planning service", + "description": "The root specification for a planning application in England generated by a digital planning service", "properties": { "data": { "additionalProperties": false, diff --git a/src/export/digitalPlanning/schema/types.d.ts b/src/export/digitalPlanning/schema/types.d.ts index b65fb63f..16f3d875 100644 --- a/src/export/digitalPlanning/schema/types.d.ts +++ b/src/export/digitalPlanning/schema/types.d.ts @@ -36,13 +36,21 @@ export type ApplicationType = value: "ldc"; } | { - description: "Lawful Development Certificate - Proposed"; + description: "Lawful Development Certificate - Proposed use"; value: "ldc.proposed"; } | { - description: "Lawful Development Certificate - Existing"; + description: "Lawful Development Certificate - Existing use"; value: "ldc.existing"; } + | { + description: "Lawful Development Certificate - Continue an existing use"; + value: "ldc.existing.regularise"; + } + | { + description: "Lawful Development Certificate - Lawful not to comply with a condition or limitation"; + value: "ldc.condition"; + } | { description: "Prior Approval"; value: "pa"; @@ -167,6 +175,27 @@ export type ApplicationType = * Information about the site where the works will happen */ export type Property = UKProperty | LondonProperty; +export type UniquePropertyReferenceNumber = string; +export type UniqueStreetReferenceNumber = string; +/** + * Union of GeoJSON objects. + */ +export type GeoJSON = Geometry | Feature | FeatureCollection; +/** + * Geometry object. https://tools.ietf.org/html/rfc7946#section-3 + */ +export type Geometry = + | Point + | MultiPoint + | LineString + | MultiLineString + | Polygon + | MultiPolygon + | GeometryCollection; +/** + * A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined. + */ +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 */ @@ -810,6 +839,19 @@ export type PlanningConstraint = value: "tpo"; }; export type URL = string; +/** + * 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 + */ +export type UKRegion = + | "North East" + | "North West" + | "Yorkshire and The Humber" + | "East Midlands" + | "West Midlands" + | "East of England" + | "London" + | "South East" + | "South West"; /** * Property types derived from Basic Land and Property Unit (BLPU) classification codes */ @@ -2778,6 +2820,10 @@ export type VehicleParking = * Planning project types */ export type ProjectType = + | { + description: "Alter a building"; + value: "alter"; + } | { description: "Add or alter a balcony"; value: "alter.balcony"; @@ -3223,7 +3269,7 @@ export type ProjectType = value: "alter.trees"; } | { - description: "Convert a building to a different use"; + description: "Change the use of a building"; value: "changeOfUse"; } | { @@ -3290,6 +3336,10 @@ export type ProjectType = description: "Demolish a building and build homes in its place"; value: "demolish.replace"; } + | { + description: "Extend a building or add an outbuilding"; + value: "extend"; + } | { description: "Add a basement extension"; value: "extend.basement"; @@ -3487,7 +3537,7 @@ export type ProjectType = value: "internal.windows.openings"; } | { - description: "Another type of building"; + description: "Add another type of building"; value: "new"; } | { @@ -3562,6 +3612,10 @@ export type ProjectType = description: "Storage or distribution premises"; value: "new.warehouse"; } + | { + description: "Change of units"; + value: "unit"; + } | { description: "Convert two or more properties into one"; value: "unit.merge"; @@ -3575,7 +3629,11 @@ export type ProjectType = */ export type FileType = | { - description: "Elevation plan - existing"; + description: "Evidence for application fee exemption - disability"; + value: "applicant.disability.evidence"; + } + | { + description: "Elevations - existing"; value: "property.drawing.elevation"; } | { @@ -3587,7 +3645,7 @@ export type FileType = value: "property.drawing.roofPlan"; } | { - description: "Section - existing"; + description: "Sections - existing"; value: "property.drawing.section"; } | { @@ -3603,17 +3661,17 @@ export type FileType = value: "property.photograph"; } | { - description: "Location plan"; - value: "property.site.locationPlan"; - } - | { - description: "Elevation plan - proposed"; + description: "Elevations - proposed"; value: "proposal.drawing.elevation"; } | { description: "Floor plan - proposed"; value: "proposal.drawing.floorPlan"; } + | { + description: "Location plan"; + value: "proposal.drawing.locationPlan"; + } | { description: "Other - drawing"; value: "proposal.drawing.other"; @@ -3623,7 +3681,7 @@ export type FileType = value: "proposal.drawing.roofPlan"; } | { - description: "Section - proposed"; + description: "Sections - proposed"; value: "proposal.drawing.section"; } | { @@ -3714,6 +3772,10 @@ export type FileType = description: "Photographs"; value: "proposal.photograph"; } + | { + description: "Photographs - evidence"; + value: "proposal.photograph.evidence"; + } | { description: "Visualisations"; value: "proposal.visualisation"; @@ -3854,7 +3916,7 @@ export type ResultFlag = export type Result = ResultFlag[]; /** - * The root schema for an application generated by a digital planning service + * The root specification for a planning application in England generated by a digital planning service */ export interface DigitalPlanningApplication { data: { @@ -3874,22 +3936,25 @@ export interface DigitalPlanningApplication { */ export interface BaseApplicant { address: UserAddress; - contact: UserContact; - interest?: "owner.sole" | "owner.co" | "tenant" | "occupier"; - ownership?: { - certificate: "a" | "b" | "c" | "d"; - noticeGiven?: boolean; - owners?: { - address: AddressInput | string; - name: string; - noticeDate?: Date; - }[]; + company?: { + name: string; + }; + email: Email; + interest?: "owner.sole" | "owner.co" | "tenant" | "occupier" | "other"; + name: { + first: string; + last: string; + title?: string; + }; + ownership?: Ownership; + phone: { + primary: string; }; siteContact: SiteContact; type: "individual" | "company" | "charity" | "public" | "parishCouncil"; } /** - * Address information for an applicant with contact information that differs from the site address + * Address information for an applicant with contact information that differs from the property address */ export interface UserAddressNotSameSite { country?: string; @@ -3901,26 +3966,21 @@ export interface UserAddressNotSameSite { town: string; } /** - * Contact information for any user + * Information about the ownership certificate and property owners, if different than the applicant */ -export interface UserContact { - company?: { - name?: string; - }; - email: Email; - name: { - first: string; - last: string; - title?: string; - }; - phone: { - primary: string; - }; +export interface Ownership { + certificate: "a" | "b" | "c" | "d"; + noticeGiven?: boolean; + owners?: { + address: Address | string; + name: string; + noticeDate?: Date; + }[]; } /** - * Address information for a personal contact not necessarily associated with the site + * Address information for a person associated with this application not at the property address */ -export interface AddressInput { +export interface Address { country?: string; county?: string; line1: string; @@ -3938,24 +3998,38 @@ export interface SiteContactOther { role: "other"; } /** - * Information about the user who completed the application on behalf of someone else + * Information about the agent or proxy who completed the application on behalf of someone else */ export interface Agent { address: UserAddress; agent: { - address: AddressInput; - contact: UserContact; - }; - contact: UserContact; - interest?: "owner.sole" | "owner.co" | "tenant" | "occupier"; - ownership?: { - certificate: "a" | "b" | "c" | "d"; - noticeGiven?: boolean; - owners?: { - address: AddressInput | string; + address: Address; + company?: { name: string; - noticeDate?: Date; - }[]; + }; + email: Email; + name: { + first: string; + last: string; + title?: string; + }; + phone: { + primary: string; + }; + }; + company?: { + name: string; + }; + email: Email; + interest?: "owner.sole" | "owner.co" | "tenant" | "occupier" | "other"; + name: { + first: string; + last: string; + title?: string; + }; + ownership?: Ownership; + phone: { + primary: string; }; siteContact: SiteContact; type: "individual" | "company" | "charity" | "public" | "parishCouncil"; @@ -3964,22 +4038,26 @@ export interface Agent { * Information about this planning application */ export interface Application { - declaration: { - accurate: boolean; - connection: { - description?: string; - value: - | "employee" - | "relation.employee" - | "electedMember" - | "relation.electedMember" - | "none"; - }; - }; + declaration: ApplicationDeclaration; fee: ApplicationFee; preApp?: PreApplication; type: ApplicationType; } +/** + * Declarations about the accuracy of this application and any personal connections to the receiving authority + */ +export interface ApplicationDeclaration { + accurate: boolean; + connection: { + description?: string; + value: + | "employee" + | "relation.employee" + | "electedMember" + | "relation.electedMember" + | "none"; + }; +} /** * The costs associated with this application */ @@ -3996,6 +4074,9 @@ export interface ApplicationFee { sports: boolean; }; reference?: { + /** + * GOV.UK Pay payment reference number + */ govPay: string; }; } @@ -4017,29 +4098,50 @@ export interface UKProperty { area: Area; site: GeoJSON; }; - constraints?: { + 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[]; - region: string; + region: UKRegion; type: PropertyType; } /** * Address information for sites without a known Unique Property Reference Number (UPRN) */ export interface ProposedAddress { + /** + * Latitude coordinate in EPSG:4326 (WGS84) + */ latitude: number; + /** + * Longitude coordinate in EPSG:4326 (WGS84) + */ longitude: number; source: "Proposed by applicant"; title: string; + /** + * Easting coordinate in British National Grid (OSGB36) + */ x: number; + /** + * Northing coordinate in British National Grid (OSGB36) + */ y: number; } /** * Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium */ export interface OSAddress { + /** + * Latitude coordinate in EPSG:4326 (WGS84) + */ latitude: number; + /** + * Longitude coordinate in EPSG:4326 (WGS84) + */ longitude: number; organisation?: string; pao: string; @@ -4049,46 +4151,253 @@ export interface OSAddress { street: string; title: string; town: string; - uprn: string; - usrn: string; + uprn: UniquePropertyReferenceNumber; + usrn: UniqueStreetReferenceNumber; + /** + * Easting coordinate in British National Grid (OSGB36) + */ x: number; + /** + * Northing coordinate in British National Grid (OSGB36) + */ y: number; } export interface Area { hectares?: number; squareMetres: number; } -export interface GeoJSON { - [k: string]: unknown; +/** + * Point geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2 + */ +export interface Point { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + coordinates: Position; + /** + * Specifies the type of GeoJSON object. + */ + type: "Point"; +} +/** + * MultiPoint geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.3 + */ +export interface MultiPoint { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + coordinates: Position[]; + /** + * Specifies the type of GeoJSON object. + */ + type: "MultiPoint"; +} +/** + * LineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.4 + */ +export interface LineString { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + coordinates: Position[]; + /** + * Specifies the type of GeoJSON object. + */ + type: "LineString"; +} +/** + * MultiLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.5 + */ +export interface MultiLineString { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + coordinates: Position[][]; + /** + * Specifies the type of GeoJSON object. + */ + type: "MultiLineString"; } /** - * Property details for sites within London + * Polygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.6 + */ +export interface Polygon { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + coordinates: Position[][]; + /** + * Specifies the type of GeoJSON object. + */ + type: "Polygon"; +} +/** + * MultiPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.7 + */ +export interface MultiPolygon { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + coordinates: Position[][][]; + /** + * Specifies the type of GeoJSON object. + */ + type: "MultiPolygon"; +} +/** + * Geometry Collection https://tools.ietf.org/html/rfc7946#section-3.1.8 + */ +export interface GeometryCollection { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + geometries: Geometry[]; + /** + * Specifies the type of GeoJSON object. + */ + type: "GeometryCollection"; +} +/** + * A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 + */ +export interface Feature { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + /** + * The feature's geometry + */ + geometry: + | Point + | MultiPoint + | LineString + | MultiLineString + | Polygon + | MultiPolygon + | GeometryCollection; + /** + * A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. + */ + id?: string | number; + /** + * Properties associated with this feature. + */ + properties: { + [k: string]: unknown; + } | null; + /** + * Specifies the type of GeoJSON object. + */ + type: "Feature"; +} +/** + * A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3 + */ +export interface FeatureCollection { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + features: Feature3CGeometry2CGeoJsonProperties3E[]; + /** + * Specifies the type of GeoJSON object. + */ + type: "FeatureCollection"; +} +/** + * A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 + */ +export interface Feature3CGeometry2CGeoJsonProperties3E { + /** + * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5 + */ + bbox?: + | [number, number, number, number] + | [number, number, number, number, number, number]; + /** + * Geometry object. https://tools.ietf.org/html/rfc7946#section-3 + */ + geometry: + | Point + | MultiPoint + | LineString + | MultiLineString + | Polygon + | MultiPolygon + | GeometryCollection; + /** + * A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. + */ + id?: string | number; + /** + * Properties associated with this feature. + */ + properties: { + [k: string]: unknown; + } | null; + /** + * Specifies the type of GeoJSON object. + */ + type: "Feature"; +} +/** + * Property details for sites within the Greater London Authority (GLA) area */ export interface LondonProperty { - EPC: { - known: - | "Yes" - | "Yes, but only some of the properties have one" - | "The property does not have one" - | "No"; - number?: string; - }; + EPC: EnergyPerformanceCertificate; address: ProposedAddress | OSAddress; boundary?: { area: Area; site: GeoJSON; }; - constraints?: { + 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[]; - region: string; + region: "London"; titleNumber: { known: "Yes" | "No"; number?: string; }; type: PropertyType; } +export interface EnergyPerformanceCertificate { + known: + | "Yes" + | "Yes, but only some of the properties have one" + | "The property does not have one" + | "No"; + number?: string; +} /** * Information about the proposed works and any changes to the property */ @@ -4097,14 +4406,18 @@ export interface Proposal { area: Area; site: GeoJSON; }; - date?: { - completion?: Date; - start?: Date; - }; + date?: ProposalDates; description: string; details?: ProposalDetails; projectType: ProjectType[]; } +/** + * When the proposed works will start and be completed by, not required for all application types + */ +export interface ProposalDates { + completion?: Date; + start?: Date; +} export interface BaseDetails { extend?: { area: Area; @@ -4118,6 +4431,9 @@ export interface BaseDetails { }; }; } +/** + * Proposal details for project sites within the Greater London Authority (GLA) area + */ export interface LondonDetails { extend?: { area: Area;