diff --git a/examples/data/priorApproval/convertCommercialToHome.ts b/examples/data/priorApproval/convertCommercialToHome.ts index 8f46ead7..1e6c821e 100644 --- a/examples/data/priorApproval/convertCommercialToHome.ts +++ b/examples/data/priorApproval/convertCommercialToHome.ts @@ -442,6 +442,41 @@ export const priorApprovalConvertCommercialToHome: Schema = { difference: 0, }, }, + units: { + residential: { + rebuilt: [ + { + development: {value: 'changeOfUse', description: 'Change of use'}, + type: {value: 'terraced', description: 'Terraced home'}, + bedrooms: 3, + habitableRooms: 7, + area: {squareMetres: 300}, + tenure: {value: 'marketForRent', description: 'Market for rent'}, + provider: {value: 'private', description: 'Private'}, + garden: false, + sheltered: false, + olderPersons: false, + compliance: [ + { + value: 'm42', + description: 'Part M4(2) of the Building Regulations 2010', + }, + { + value: 'm432a', + description: + 'Part M4(3)(2a) of the Building Regulations 2010', + }, + { + value: 'm432b', + description: + 'Part M4(3)(2b) of the Building Regulations 2010', + }, + ], + identicalUnits: 1, + }, + ], + }, + }, energy: { type: ['heatPump'], heatPumps: { @@ -1523,7 +1558,7 @@ export const priorApprovalConvertCommercialToHome: Schema = { source: 'PlanX', service: { flowId: 'f3cae2c8-9a64-4ce1-8cef-8e6832ad383d', - url: 'https://editor.planx.uk/lambeth/apply-for-prior-approval/published', + url: 'https://editor.planx.dev/lambeth/apply-for-prior-approval/published', files: { required: [ { diff --git a/examples/priorApproval/convertCommercialToHome.json b/examples/priorApproval/convertCommercialToHome.json index 5c3bcd22..e566d681 100644 --- a/examples/priorApproval/convertCommercialToHome.json +++ b/examples/priorApproval/convertCommercialToHome.json @@ -468,6 +468,53 @@ "difference": 0 } }, + "units": { + "residential": { + "rebuilt": [ + { + "development": { + "value": "changeOfUse", + "description": "Change of use" + }, + "type": { + "value": "terraced", + "description": "Terraced home" + }, + "bedrooms": 3, + "habitableRooms": 7, + "area": { + "squareMetres": 300 + }, + "tenure": { + "value": "marketForRent", + "description": "Market for rent" + }, + "provider": { + "value": "private", + "description": "Private" + }, + "garden": false, + "sheltered": false, + "olderPersons": false, + "compliance": [ + { + "value": "m42", + "description": "Part M4(2) of the Building Regulations 2010" + }, + { + "value": "m432a", + "description": "Part M4(3)(2a) of the Building Regulations 2010" + }, + { + "value": "m432b", + "description": "Part M4(3)(2b) of the Building Regulations 2010" + } + ], + "identicalUnits": 1 + } + ] + } + }, "energy": { "type": [ "heatPump" @@ -1573,7 +1620,7 @@ "source": "PlanX", "service": { "flowId": "f3cae2c8-9a64-4ce1-8cef-8e6832ad383d", - "url": "https://editor.planx.uk/lambeth/apply-for-prior-approval/published", + "url": "https://editor.planx.dev/lambeth/apply-for-prior-approval/published", "files": { "required": [ { diff --git a/schema/schema.json b/schema/schema.json index e93f28c4..14eadb39 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -2239,6 +2239,42 @@ }, "type": "array" }, + "units": { + "additionalProperties": false, + "properties": { + "residential": { + "items": { + "additionalProperties": false, + "properties": { + "bedrooms": { + "type": "number" + }, + "development": { + "$ref": "#/definitions/DevelopmentType" + }, + "identicalUnits": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/UKResidentialUnitType" + } + }, + "required": [ + "development", + "type", + "bedrooms", + "identicalUnits" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "residential" + ], + "type": "object" + }, "use": { "additionalProperties": false, "description": "Proposed land use, including storage of hazardous materials, if applicable to application.type", @@ -2380,6 +2416,84 @@ ], "type": "object" }, + "BuildingRegulation": { + "$id": "#BuildingRegulation", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Part M4(2) of the Building Regulations 2010", + "type": "string" + }, + "value": { + "const": "m42", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Part M4(3)(2a) of the Building Regulations 2010", + "type": "string" + }, + "value": { + "const": "m432a", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Part M4(3)(2b) of the Building Regulations 2010", + "type": "string" + }, + "value": { + "const": "m432b", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "None of these", + "type": "string" + }, + "value": { + "const": "none", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Building regulations" + }, "CalculateMetadata": { "$id": "#CalculateMetadata", "additionalProperties": false, @@ -2465,10 +2579,192 @@ ], "type": "object" }, + "DevelopmentType": { + "$id": "#DevelopmentType", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Change of use", + "type": "string" + }, + "value": { + "const": "changeOfUse", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Change of use of an existing single home", + "type": "string" + }, + "value": { + "const": "changeOfUseFrom", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Change of use to a home", + "type": "string" + }, + "value": { + "const": "changeOfUseTo", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Conversion", + "type": "string" + }, + "value": { + "const": "conversion", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Extension", + "type": "string" + }, + "value": { + "const": "extension", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "New build", + "type": "string" + }, + "value": { + "const": "newBuild", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Not known", + "type": "string" + }, + "value": { + "const": "notKnown", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Development types" + }, "Email": { "format": "email", "type": "string" }, + "Entity": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "text": { + "const": "Planning Data", + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + }, + "required": [ + "text", + "url" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "text": { + "const": "Ordnance Survey MasterMap Highways", + "type": "string" + } + }, + "required": [ + "text" + ], + "type": "object" + } + ] + } + }, + "required": [ + "name", + "source" + ], + "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", @@ -3787,11 +4083,664 @@ "additionalProperties": false, "properties": { "description": { - "const": "Sections - existing", + "const": "Sections - existing", + "type": "string" + }, + "value": { + "const": "sections.existing", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Sections - proposed", + "type": "string" + }, + "value": { + "const": "sections.proposed", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Site plan - existing", + "type": "string" + }, + "value": { + "const": "sitePlan.existing", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Site plan - proposed", + "type": "string" + }, + "value": { + "const": "sitePlan.proposed", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Sketch plan", + "type": "string" + }, + "value": { + "const": "sketchPlan", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Statement of community involvement", + "type": "string" + }, + "value": { + "const": "statementOfCommunityInvolvement", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Statutory declaration", + "type": "string" + }, + "value": { + "const": "statutoryDeclaration", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Details of storage treatment or disposal of waste", + "type": "string" + }, + "value": { + "const": "storageTreatmentAndWasteDisposalDetails", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Street scene drawing", + "type": "string" + }, + "value": { + "const": "streetScene", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Subsidence report", + "type": "string" + }, + "value": { + "const": "subsidenceReport", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Sunlight and daylight report", + "type": "string" + }, + "value": { + "const": "sunlightAndDaylightReport", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Sustainability statement", + "type": "string" + }, + "value": { + "const": "sustainabilityStatement", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Technical evidence", + "type": "string" + }, + "value": { + "const": "technicalEvidence", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Tenancy agreement", + "type": "string" + }, + "value": { + "const": "tenancyAgreement", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Tenancy invoice", + "type": "string" + }, + "value": { + "const": "tenancyInvoice", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Town centre uses - Impact assessment", + "type": "string" + }, + "value": { + "const": "townCentreImpactAssessment", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Town centre uses - Sequential assessment", + "type": "string" + }, + "value": { + "const": "townCentreSequentialAssessment", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Transport assessment", + "type": "string" + }, + "value": { + "const": "transportAssessment", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Travel plan", + "type": "string" + }, + "value": { + "const": "travelPlan", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Location of trees and hedges", + "type": "string" + }, + "value": { + "const": "treeAndHedgeLocation", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Removed or pruned trees and hedges", + "type": "string" + }, + "value": { + "const": "treeAndHedgeRemovedOrPruned", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Tree canopy calculator", + "type": "string" + }, + "value": { + "const": "treeCanopyCalculator", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Tree condition report", + "type": "string" + }, + "value": { + "const": "treeConditionReport", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Trees report", + "type": "string" + }, + "value": { + "const": "treesReport", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Unit plan - existing", + "type": "string" + }, + "value": { + "const": "unitPlan.existing", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Unit plan - proposed", + "type": "string" + }, + "value": { + "const": "unitPlan.proposed", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Use plan - existing", + "type": "string" + }, + "value": { + "const": "usePlan.existing", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Use plan - proposed", + "type": "string" + }, + "value": { + "const": "usePlan.proposed", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Utility bill", + "type": "string" + }, + "value": { + "const": "utilityBill", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Utilities statement", + "type": "string" + }, + "value": { + "const": "utilitiesStatement", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Ventilation or extraction statement", + "type": "string" + }, + "value": { + "const": "ventilationStatement", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Viability Appraisal", + "type": "string" + }, + "value": { + "const": "viabilityAppraisal", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Visualisations", + "type": "string" + }, + "value": { + "const": "visualisations", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Waste and recycling strategy", + "type": "string" + }, + "value": { + "const": "wasteAndRecyclingStrategy", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Water environment assessment", + "type": "string" + }, + "value": { + "const": "waterEnvironmentAssessment", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Types of planning documents and drawings" + }, + "FilesAsData": { + "$id": "#FilesAsData", + "additionalProperties": false, + "description": "File types that can optionally be provided by answering structured questions, rather than via document upload (see root `files` for uploads)", + "properties": { + "designAndAccessStatement": { + "$ref": "#/definitions/DesignAndAccessStatement" + }, + "heritageStatement": { + "$ref": "#/definitions/HeritageStatement" + }, + "locationPlan": { + "$ref": "#/definitions/GeoBoundary" + } + }, + "type": "object" + }, + "GLAHousingProvider": { + "$id": "#GLAHousingProvider", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Other affordable housing provider", "type": "string" }, "value": { - "const": "sections.existing", + "const": "affordableHousing", "type": "string" } }, @@ -3805,11 +4754,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Sections - proposed", + "const": "Council delivered build to rent", "type": "string" }, "value": { - "const": "sections.proposed", + "const": "councilBuildToRent", "type": "string" } }, @@ -3823,11 +4772,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Site plan - existing", + "const": "Council delivery company", "type": "string" }, "value": { - "const": "sitePlan.existing", + "const": "councilDelivery", "type": "string" } }, @@ -3841,11 +4790,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Site plan - proposed", + "const": "Housing association", "type": "string" }, "value": { - "const": "sitePlan.proposed", + "const": "HA", "type": "string" } }, @@ -3859,11 +4808,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Sketch plan", + "const": "Local Authority", "type": "string" }, "value": { - "const": "sketchPlan", + "const": "LA", "type": "string" } }, @@ -3877,11 +4826,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Statement of community involvement", + "const": "Private", "type": "string" }, "value": { - "const": "statementOfCommunityInvolvement", + "const": "private", "type": "string" } }, @@ -3895,11 +4844,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Statutory declaration", + "const": "Private rented sector", "type": "string" }, "value": { - "const": "statutoryDeclaration", + "const": "privateRented", "type": "string" } }, @@ -3913,11 +4862,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Details of storage treatment or disposal of waste", + "const": "Other public authority", "type": "string" }, "value": { - "const": "storageTreatmentAndWasteDisposalDetails", + "const": "publicAuthority", "type": "string" } }, @@ -3931,11 +4880,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Street scene drawing", + "const": "Self-build", "type": "string" }, "value": { - "const": "streetScene", + "const": "selfBuild", "type": "string" } }, @@ -3944,16 +4893,22 @@ "description" ], "type": "object" - }, + } + ], + "description": "Housing provider categories tracked by the Greater London Authority (GLA)" + }, + "GLAResidentialUnitType": { + "$id": "#GLAResidentialUnitType", + "anyOf": [ { "additionalProperties": false, "properties": { "description": { - "const": "Subsidence report", + "const": "Cluster flat", "type": "string" }, "value": { - "const": "subsidenceReport", + "const": "cluster", "type": "string" } }, @@ -3967,11 +4922,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Sunlight and daylight report", + "const": "Co-living unit", "type": "string" }, "value": { - "const": "sunlightAndDaylightReport", + "const": "coLiving", "type": "string" } }, @@ -3985,11 +4940,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Sustainability statement", + "const": "Detached home", "type": "string" }, "value": { - "const": "sustainabilityStatement", + "const": "detached", "type": "string" } }, @@ -4003,11 +4958,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Technical evidence", + "const": "Flat/apartment or maisonette", "type": "string" }, "value": { - "const": "technicalEvidence", + "const": "flat", "type": "string" } }, @@ -4021,11 +4976,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Tenancy agreement", + "const": "House in multiple occupation (HMO)", "type": "string" }, "value": { - "const": "tenancyAgreement", + "const": "HMO", "type": "string" } }, @@ -4039,11 +4994,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Tenancy invoice", + "const": "Hostel room", "type": "string" }, "value": { - "const": "tenancyInvoice", + "const": "hostel", "type": "string" } }, @@ -4057,11 +5012,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Town centre uses - Impact assessment", + "const": "Live/work unit", "type": "string" }, "value": { - "const": "townCentreImpactAssessment", + "const": "LW", "type": "string" } }, @@ -4075,11 +5030,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Town centre uses - Sequential assessment", + "const": "Other", "type": "string" }, "value": { - "const": "townCentreSequentialAssessment", + "const": "other", "type": "string" } }, @@ -4093,11 +5048,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Transport assessment", + "const": "Semi-detached home", "type": "string" }, "value": { - "const": "transportAssessment", + "const": "semiDetached", "type": "string" } }, @@ -4111,11 +5066,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Travel plan", + "const": "Student accomodation", "type": "string" }, "value": { - "const": "travelPlan", + "const": "student", "type": "string" } }, @@ -4129,11 +5084,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Location of trees and hedges", + "const": "Studio or bedsit", "type": "string" }, "value": { - "const": "treeAndHedgeLocation", + "const": "studio", "type": "string" } }, @@ -4147,11 +5102,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Removed or pruned trees and hedges", + "const": "Terraced home", "type": "string" }, "value": { - "const": "treeAndHedgeRemovedOrPruned", + "const": "terraced", "type": "string" } }, @@ -4160,16 +5115,22 @@ "description" ], "type": "object" - }, + } + ], + "description": "Residential unit types tracked by the Greater London Authority (GLA)" + }, + "GLATenureType": { + "$id": "#GLATenureType", + "anyOf": [ { "additionalProperties": false, "properties": { "description": { - "const": "Tree canopy calculator", + "const": "Affordable rent (not at LAR benchmark rents)", "type": "string" }, "value": { - "const": "treeCanopyCalculator", + "const": "AR", "type": "string" } }, @@ -4183,11 +5144,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Tree condition report", + "const": "Discount market rate", "type": "string" }, "value": { - "const": "treeConditionReport", + "const": "DMR", "type": "string" } }, @@ -4201,11 +5162,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Trees report", + "const": "Discount market rate (charged at London Living Rents)", "type": "string" }, "value": { - "const": "treesReport", + "const": "DMRLLR", "type": "string" } }, @@ -4219,11 +5180,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Unit plan - existing", + "const": "Discount market sale", "type": "string" }, "value": { - "const": "unitPlan.existing", + "const": "DMS", "type": "string" } }, @@ -4237,11 +5198,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Unit plan - proposed", + "const": "London Affordable Rent", "type": "string" }, "value": { - "const": "unitPlan.proposed", + "const": "LAR", "type": "string" } }, @@ -4255,11 +5216,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Use plan - existing", + "const": "London Living Rent", "type": "string" }, "value": { - "const": "usePlan.existing", + "const": "LRR", "type": "string" } }, @@ -4273,11 +5234,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Use plan - proposed", + "const": "London Shared Ownership", "type": "string" }, "value": { - "const": "usePlan.proposed", + "const": "LSO", "type": "string" } }, @@ -4291,11 +5252,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Utility bill", + "const": "Market for rent", "type": "string" }, "value": { - "const": "utilityBill", + "const": "marketForRent", "type": "string" } }, @@ -4309,11 +5270,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Utilities statement", + "const": "Market for sale", "type": "string" }, "value": { - "const": "utilitiesStatement", + "const": "marketForSale", "type": "string" } }, @@ -4327,11 +5288,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Ventilation or extraction statement", + "const": "Other", "type": "string" }, "value": { - "const": "ventilationStatement", + "const": "other", "type": "string" } }, @@ -4345,11 +5306,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Viability Appraisal", + "const": "Self-build and custom build", "type": "string" }, "value": { - "const": "viabilityAppraisal", + "const": "selfCustomBuild", "type": "string" } }, @@ -4363,11 +5324,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Visualisations", + "const": "Starter homes", "type": "string" }, "value": { - "const": "visualisations", + "const": "SH", "type": "string" } }, @@ -4381,11 +5342,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Waste and recycling strategy", + "const": "Shared equity", "type": "string" }, "value": { - "const": "wasteAndRecyclingStrategy", + "const": "sharedEquity", "type": "string" } }, @@ -4399,11 +5360,11 @@ "additionalProperties": false, "properties": { "description": { - "const": "Water environment assessment", + "const": "Social rent", "type": "string" }, "value": { - "const": "waterEnvironmentAssessment", + "const": "SR", "type": "string" } }, @@ -4414,24 +5375,7 @@ "type": "object" } ], - "description": "Types of planning documents and drawings" - }, - "FilesAsData": { - "$id": "#FilesAsData", - "additionalProperties": false, - "description": "File types that can optionally be provided by answering structured questions, rather than via document upload (see root `files` for uploads)", - "properties": { - "designAndAccessStatement": { - "$ref": "#/definitions/DesignAndAccessStatement" - }, - "heritageStatement": { - "$ref": "#/definitions/HeritageStatement" - }, - "locationPlan": { - "$ref": "#/definitions/GeoBoundary" - } - }, - "type": "object" + "description": "Tenure types tracked by the Greater London Authority (GLA)" }, "GeoBoundary": { "additionalProperties": false, @@ -5000,6 +5944,42 @@ "type": { "$ref": "#/definitions/PropertyType" }, + "units": { + "additionalProperties": false, + "properties": { + "residential": { + "items": { + "additionalProperties": false, + "properties": { + "bedrooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "tenure": { + "$ref": "#/definitions/UKTenureType" + }, + "type": { + "$ref": "#/definitions/UKResidentialUnitType" + } + }, + "required": [ + "tenure", + "type", + "bedrooms", + "identicalUnits" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "residential" + ], + "type": "object" + }, "use": { "additionalProperties": false, "description": "Existing land use, if applicable to application.type", @@ -5621,6 +6601,226 @@ "schemeName": { "type": "string" }, + "units": { + "additionalProperties": false, + "properties": { + "residential": { + "additionalProperties": false, + "properties": { + "new": { + "items": { + "additionalProperties": false, + "properties": { + "area": { + "$ref": "#/definitions/Area" + }, + "bedrooms": { + "type": "number" + }, + "compliance": { + "items": { + "$ref": "#/definitions/BuildingRegulation" + }, + "type": "array" + }, + "development": { + "$ref": "#/definitions/DevelopmentType" + }, + "garden": { + "type": "boolean" + }, + "habitableRooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "olderPersons": { + "type": "boolean" + }, + "provider": { + "$ref": "#/definitions/GLAHousingProvider" + }, + "sheltered": { + "type": "boolean" + }, + "tenure": { + "$ref": "#/definitions/GLATenureType" + }, + "type": { + "$ref": "#/definitions/GLAResidentialUnitType" + } + }, + "required": [ + "area", + "bedrooms", + "compliance", + "development", + "garden", + "habitableRooms", + "identicalUnits", + "olderPersons", + "provider", + "sheltered", + "tenure", + "type" + ], + "type": "object" + }, + "type": "array" + }, + "rebuilt": { + "items": { + "additionalProperties": false, + "properties": { + "area": { + "$ref": "#/definitions/Area" + }, + "bedrooms": { + "type": "number" + }, + "compliance": { + "items": { + "$ref": "#/definitions/BuildingRegulation" + }, + "type": "array" + }, + "development": { + "$ref": "#/definitions/DevelopmentType" + }, + "garden": { + "type": "boolean" + }, + "habitableRooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "olderPersons": { + "type": "boolean" + }, + "provider": { + "$ref": "#/definitions/GLAHousingProvider" + }, + "sheltered": { + "type": "boolean" + }, + "tenure": { + "$ref": "#/definitions/GLATenureType" + }, + "type": { + "$ref": "#/definitions/GLAResidentialUnitType" + } + }, + "required": [ + "area", + "bedrooms", + "compliance", + "development", + "garden", + "habitableRooms", + "identicalUnits", + "olderPersons", + "provider", + "sheltered", + "tenure", + "type" + ], + "type": "object" + }, + "type": "array" + }, + "removed": { + "items": { + "additionalProperties": false, + "properties": { + "area": { + "$ref": "#/definitions/Area" + }, + "bedrooms": { + "type": "number" + }, + "compliance": { + "items": { + "$ref": "#/definitions/BuildingRegulation" + }, + "type": "array" + }, + "habitableRooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "olderPersons": { + "type": "boolean" + }, + "provider": { + "$ref": "#/definitions/GLAHousingProvider" + }, + "sheltered": { + "type": "boolean" + }, + "tenure": { + "$ref": "#/definitions/GLATenureType" + }, + "type": { + "$ref": "#/definitions/GLAResidentialUnitType" + } + }, + "required": [ + "area", + "bedrooms", + "compliance", + "habitableRooms", + "identicalUnits", + "olderPersons", + "provider", + "sheltered", + "tenure", + "type" + ], + "type": "object" + }, + "type": "array" + }, + "retained": { + "items": { + "additionalProperties": false, + "properties": { + "bedrooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "tenure": { + "$ref": "#/definitions/GLATenureType" + }, + "type": { + "$ref": "#/definitions/GLAResidentialUnitType" + } + }, + "required": [ + "bedrooms", + "tenure", + "type", + "identicalUnits" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "residential" + ], + "type": "object" + }, "urbanGreeningFactor": { "additionalProperties": false, "description": "Urban Greening Factor Score", @@ -6724,56 +7924,9 @@ }, "entities": { "anyOf": [ - { - "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + { + "items": { + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -7468,54 +8621,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -7554,54 +8660,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -7640,54 +8699,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -7726,54 +8738,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -7812,54 +8777,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -7898,54 +8816,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -7984,54 +8855,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8070,54 +8894,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8156,54 +8933,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8242,54 +8972,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8328,54 +9011,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8414,54 +9050,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8500,54 +9089,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8586,54 +9128,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8672,54 +9167,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8758,54 +9206,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8844,54 +9245,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -8930,54 +9284,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9016,54 +9323,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9102,54 +9362,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9188,54 +9401,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9274,54 +9440,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9360,54 +9479,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9446,54 +9518,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9532,54 +9557,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9618,54 +9596,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9704,54 +9635,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -9790,54 +9674,7 @@ "anyOf": [ { "items": { - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Planning Data", - "type": "string" - }, - "url": { - "$ref": "#/definitions/URL" - } - }, - "required": [ - "text", - "url" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "text": { - "const": "Ordnance Survey MasterMap Highways", - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - ] - } - }, - "required": [ - "name", - "source" - ], - "type": "object" + "$ref": "#/definitions/Entity" }, "type": "array" }, @@ -24662,6 +24499,42 @@ "type": { "$ref": "#/definitions/PropertyType" }, + "units": { + "additionalProperties": false, + "properties": { + "residential": { + "items": { + "additionalProperties": false, + "properties": { + "bedrooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "tenure": { + "$ref": "#/definitions/UKTenureType" + }, + "type": { + "$ref": "#/definitions/UKResidentialUnitType" + } + }, + "required": [ + "tenure", + "type", + "bedrooms", + "identicalUnits" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "residential" + ], + "type": "object" + }, "use": { "additionalProperties": false, "description": "Existing land use, if applicable to application.type", @@ -24712,6 +24585,234 @@ ], "type": "string" }, + "UKResidentialUnitType": { + "$id": "#UKResidentialUnitType", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Cluster flat", + "type": "string" + }, + "value": { + "const": "cluster", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flat", + "type": "string" + }, + "value": { + "const": "flat", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "House", + "type": "string" + }, + "value": { + "const": "house", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Other", + "type": "string" + }, + "value": { + "const": "other", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Sheltered housing", + "type": "string" + }, + "value": { + "const": "sheltered", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Studio or bedsit", + "type": "string" + }, + "value": { + "const": "studio", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Residential unit types tracked throughout the UK" + }, + "UKTenureType": { + "$id": "#UKTenureType", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Affordable home ownership", + "type": "string" + }, + "value": { + "const": "AHO", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Market housing", + "type": "string" + }, + "value": { + "const": "MH", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Other", + "type": "string" + }, + "value": { + "const": "other", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Social, affordable or interim rent", + "type": "string" + }, + "value": { + "const": "SAIR", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Self-build and custom build", + "type": "string" + }, + "value": { + "const": "selfCustomBuild", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Starter homes", + "type": "string" + }, + "value": { + "const": "SH", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Tenure types tracked throughout the UK" + }, "URL": { "format": "uri", "pattern": "^https?://", diff --git a/types/enums/ApplicationTypes.ts b/types/enums/ApplicationTypes.ts index 7e65c4f8..ed61080d 100644 --- a/types/enums/ApplicationTypes.ts +++ b/types/enums/ApplicationTypes.ts @@ -135,3 +135,20 @@ export const ApplicationTypes = { 'wtt.notice': 'Works to trees - Notification of proposed works to a tree in a Conservation Area', }; + +type ApplicationTypeKeys = keyof typeof ApplicationTypes; + +type GenericApplicationType = { + value: TKey; + description: (typeof ApplicationTypes)[TKey]; +}; + +type ApplicationTypeMap = { + [K in ApplicationTypeKeys]: GenericApplicationType; +}; + +/** + * @id #ApplicationType + * @description Planning application types + */ +export type ApplicationType = ApplicationTypeMap[keyof ApplicationTypeMap]; diff --git a/types/enums/BuildingRegulations.ts b/types/enums/BuildingRegulations.ts new file mode 100644 index 00000000..6d35bdc2 --- /dev/null +++ b/types/enums/BuildingRegulations.ts @@ -0,0 +1,27 @@ +/** + * Values of `data.proposal.units.residential` + */ +export const BuildingRegulations = { + m42: 'Part M4(2) of the Building Regulations 2010', + m432a: 'Part M4(3)(2a) of the Building Regulations 2010', + m432b: 'Part M4(3)(2b) of the Building Regulations 2010', + none: 'None of these', +}; + +type BuildingRegulationKeys = keyof typeof BuildingRegulations; + +type GenericBuildingRegulation = { + value: TKey; + description: (typeof BuildingRegulations)[TKey]; +}; + +type BuildingRegulationMap = { + [K in BuildingRegulationKeys]: GenericBuildingRegulation; +}; + +/** + * @id #BuildingRegulation + * @description Building regulations + */ +export type BuildingRegulation = + BuildingRegulationMap[keyof BuildingRegulationMap]; diff --git a/types/enums/DevelopmentTypes.ts b/types/enums/DevelopmentTypes.ts index ea8d5c70..671e82f5 100644 --- a/types/enums/DevelopmentTypes.ts +++ b/types/enums/DevelopmentTypes.ts @@ -7,3 +7,20 @@ export const DevelopmentTypes = { newBuild: 'New build', notKnown: 'Not known', }; + +type DevelopmentTypeKeys = keyof typeof DevelopmentTypes; + +type GenericDevelopmentType = { + value: TKey; + description: (typeof DevelopmentTypes)[TKey]; +}; + +type DevelopmentTypeMap = { + [K in DevelopmentTypeKeys]: GenericDevelopmentType; +}; + +/** + * @id #DevelopmentType + * @description Development types + */ +export type DevelopmentType = DevelopmentTypeMap[keyof DevelopmentTypeMap]; diff --git a/types/enums/FileTypes.ts b/types/enums/FileTypes.ts index 45d1191d..fc35956b 100644 --- a/types/enums/FileTypes.ts +++ b/types/enums/FileTypes.ts @@ -105,3 +105,20 @@ export const FileTypes = { wasteAndRecyclingStrategy: 'Waste and recycling strategy', waterEnvironmentAssessment: 'Water environment assessment', }; + +type FileTypeKeys = keyof typeof FileTypes; + +type GenericFileType = { + value: TKey; + description: (typeof FileTypes)[TKey]; +}; + +type FileTypeMap = { + [K in FileTypeKeys]: GenericFileType; +}; + +/** + * @id #FileType + * @description Types of planning documents and drawings + */ +export type FileType = FileTypeMap[keyof FileTypeMap]; diff --git a/types/enums/Flags.ts b/types/enums/Flags.ts index 3b1c6aa5..a98d3581 100644 --- a/types/enums/Flags.ts +++ b/types/enums/Flags.ts @@ -40,3 +40,20 @@ export const Flags = { 'Community infrastructure levy / Liable': '', 'Community infrastructure levy / Not liable': '', }; + +type FlagKeys = keyof typeof Flags; + +type GenericFlag = { + value: TKey; + description: (typeof Flags)[TKey]; +}; + +type FlagMap = { + [K in FlagKeys]: GenericFlag; +}; + +/** + * @id #ResultFlag + * @description The result of a single flagset + */ +export type ResultFlag = FlagMap[keyof FlagMap]; diff --git a/types/enums/HousingProviders.ts b/types/enums/HousingProviders.ts index 508f7ef5..30a28dc0 100644 --- a/types/enums/HousingProviders.ts +++ b/types/enums/HousingProviders.ts @@ -9,3 +9,21 @@ export const GLAHousingProviders = { publicAuthority: 'Other public authority', selfBuild: 'Self-build', }; + +type GLAHousingProviderKeys = keyof typeof GLAHousingProviders; + +type GenericGLAHousingProvider = { + value: TKey; + description: (typeof GLAHousingProviders)[TKey]; +}; + +type GLAHousingProviderMap = { + [K in GLAHousingProviderKeys]: GenericGLAHousingProvider; +}; + +/** + * @id #GLAHousingProvider + * @description Housing provider categories tracked by the Greater London Authority (GLA) + */ +export type GLAHousingProvider = + GLAHousingProviderMap[keyof GLAHousingProviderMap]; diff --git a/types/enums/OpenSpaces.ts b/types/enums/OpenSpaces.ts index 598b3ec8..d4c467eb 100644 --- a/types/enums/OpenSpaces.ts +++ b/types/enums/OpenSpaces.ts @@ -21,3 +21,38 @@ export const GLAOpenSpaceDesignations = { none: 'Not designated', other: 'Other designation', }; + +type OpenSpaceTypeKeys = keyof typeof GLAOpenSpaceTypes; + +type GenericOpenSpaceType = { + value: TKey; + description: (typeof GLAOpenSpaceTypes)[TKey]; +}; + +type OpenSpaceTypeMap = { + [K in OpenSpaceTypeKeys]: GenericOpenSpaceType; +}; + +/** + * @id #OpenSpaceType + * @description Types of natural open spaces + */ +export type OpenSpaceType = OpenSpaceTypeMap[keyof OpenSpaceTypeMap]; + +type OpenSpaceDesignationKeys = keyof typeof GLAOpenSpaceDesignations; + +type GenericOpenSpaceDesignation = { + value: TKey; + description: (typeof GLAOpenSpaceDesignations)[TKey]; +}; + +type OpenSpaceDesignationMap = { + [K in OpenSpaceDesignationKeys]: GenericOpenSpaceDesignation; +}; + +/** + * @id #OpenSpaceDesignation + * @description Designations of natural open spaces + */ +export type OpenSpaceDesignation = + OpenSpaceDesignationMap[keyof OpenSpaceDesignationMap]; diff --git a/types/enums/PlanningConstraints.ts b/types/enums/PlanningConstraints.ts index 10ac5fe4..a08af89d 100644 --- a/types/enums/PlanningConstraints.ts +++ b/types/enums/PlanningConstraints.ts @@ -1,3 +1,5 @@ +import {Entity} from '../schema/data/shared'; + /** * Values for `data.property.planning.designations` */ @@ -31,3 +33,40 @@ export const PlanningDesignations = { 'road.classified': 'Classified Road', tpo: 'Tree Preservation Order (TPO) or zone', }; + +type PlanningDesigationKeys = keyof typeof PlanningDesignations; + +type GenericPlanningDesignation = { + value: TKey; + description: (typeof PlanningDesignations)[TKey]; +}; + +type PlanningDesignationMap = { + [K in PlanningDesigationKeys]: GenericPlanningDesignation; +}; + +type BasePlanningDesignation = + PlanningDesignationMap[keyof PlanningDesignationMap]; + +/** + * @description A planning designation that does not intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects + */ +type NonIntersectingPlanningDesignation = { + intersects: false; +} & BasePlanningDesignation; + +/** + * @description A planning designation that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects + */ +type IntersectingPlanningDesignation = { + intersects: true; + entities: Entity[] | []; +} & BasePlanningDesignation; + +/** + * @id #PlanningDesignation + * @description 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 = + | NonIntersectingPlanningDesignation + | IntersectingPlanningDesignation; diff --git a/types/enums/ProjectTypes.ts b/types/enums/ProjectTypes.ts index 6427c2a2..22d2b41d 100644 --- a/types/enums/ProjectTypes.ts +++ b/types/enums/ProjectTypes.ts @@ -344,3 +344,20 @@ export const ProjectTypes = { 'unit.merge': 'Convert two or more properties into one', 'unit.subdivide': 'Convert a home or part of a home into flats', }; + +type ProjectTypeKeys = keyof typeof ProjectTypes; + +type GenericProjectType = { + value: TKey; + description: (typeof ProjectTypes)[TKey]; +}; + +type ProjectTypeMap = { + [K in ProjectTypeKeys]: GenericProjectType; +}; + +/** + * @id #ProjectType + * @description Planning project types + */ +export type ProjectType = ProjectTypeMap[keyof ProjectTypeMap]; diff --git a/types/enums/PropertyTypes.ts b/types/enums/PropertyTypes.ts index 037757d4..6221ff58 100644 --- a/types/enums/PropertyTypes.ts +++ b/types/enums/PropertyTypes.ts @@ -503,3 +503,20 @@ export const PropertyTypes = { 'object.religious.building.synagogue': 'Synagogue', 'object.religious.building.temple': 'Temple', }; + +type PropertyTypeKeys = keyof typeof PropertyTypes; + +type GenericPropertyType = { + value: TKey; + description: (typeof PropertyTypes)[TKey]; +}; + +type PropertyTypeMap = { + [K in PropertyTypeKeys]: GenericPropertyType; +}; + +/** + * @id #PropertyType + * @description Property types derived from Basic Land and Property Unit (BLPU) classification codes + */ +export type PropertyType = PropertyTypeMap[keyof PropertyTypeMap]; diff --git a/types/enums/ProtectedSpaces.ts b/types/enums/ProtectedSpaces.ts index 3d0969be..3dd78038 100644 --- a/types/enums/ProtectedSpaces.ts +++ b/types/enums/ProtectedSpaces.ts @@ -7,3 +7,23 @@ export const GLAProtectedSpaceDesignations = { none: 'Not designated', SSSI: 'Sites of Special Scientific Interest', }; + +type ProtectedSpaceDesignationKeys = keyof typeof GLAProtectedSpaceDesignations; + +type GenericProtectedSpaceDesignation< + TKey extends ProtectedSpaceDesignationKeys, +> = { + value: TKey; + description: (typeof GLAProtectedSpaceDesignations)[TKey]; +}; + +type ProtectedSpaceDesignationMap = { + [K in ProtectedSpaceDesignationKeys]: GenericProtectedSpaceDesignation; +}; + +/** + * @id #ProtectedSpaceDesignation + * @description Designations of natural protected spaces + */ +export type ProtectedSpaceDesignation = + ProtectedSpaceDesignationMap[keyof ProtectedSpaceDesignationMap]; diff --git a/types/enums/ResidentialUnitTypes.ts b/types/enums/ResidentialUnitTypes.ts index 5519ba94..c8fb3e41 100644 --- a/types/enums/ResidentialUnitTypes.ts +++ b/types/enums/ResidentialUnitTypes.ts @@ -1,4 +1,4 @@ -export const NationalResidentialUnitTypes = { +export const UKResidentialUnitTypes = { cluster: 'Cluster flat', flat: 'Flat', house: 'House', @@ -23,6 +23,42 @@ export const GLAResidentialUnitTypes = { }; export const ResidentialUnitTypes = { - ...NationalResidentialUnitTypes, + ...UKResidentialUnitTypes, ...GLAResidentialUnitTypes, }; + +type UKResidentialUnitTypeKeys = keyof typeof UKResidentialUnitTypes; + +type GenericUKResidentialUnitType = { + value: TKey; + description: (typeof UKResidentialUnitTypes)[TKey]; +}; + +type UKResidentialUnitTypeMap = { + [K in UKResidentialUnitTypeKeys]: GenericUKResidentialUnitType; +}; + +/** + * @id #UKResidentialUnitType + * @description Residential unit types tracked throughout the UK + */ +export type UKResidentialUnitType = + UKResidentialUnitTypeMap[keyof UKResidentialUnitTypeMap]; + +type GLAResidentialUnitTypeKeys = keyof typeof GLAResidentialUnitTypes; + +type GenericGLAResidentialUnitType = { + value: TKey; + description: (typeof GLAResidentialUnitTypes)[TKey]; +}; + +type GLAResidentialUnitTypeMap = { + [K in GLAResidentialUnitTypeKeys]: GenericGLAResidentialUnitType; +}; + +/** + * @id #GLAResidentialUnitType + * @description Residential unit types tracked by the Greater London Authority (GLA) + */ +export type GLAResidentialUnitType = + GLAResidentialUnitTypeMap[keyof GLAResidentialUnitTypeMap]; diff --git a/types/enums/TenureTypes.ts b/types/enums/TenureTypes.ts index 75f07dcc..fea207b6 100644 --- a/types/enums/TenureTypes.ts +++ b/types/enums/TenureTypes.ts @@ -1,4 +1,4 @@ -export const NationalTenureTypes = { +export const UKTenureTypes = { AHO: 'Affordable home ownership', MH: 'Market housing', other: 'Other', @@ -25,6 +25,40 @@ export const GLATenureTypes = { }; export const TenureTypes = { - ...NationalTenureTypes, + ...UKTenureTypes, ...GLATenureTypes, }; + +type UKTenureTypeKeys = keyof typeof UKTenureTypes; + +type GenericUKTenureType = { + value: TKey; + description: (typeof UKTenureTypes)[TKey]; +}; + +type UKTenureTypeMap = { + [K in UKTenureTypeKeys]: GenericUKTenureType; +}; + +/** + * @id #UKTenureType + * @description Tenure types tracked throughout the UK + */ +export type UKTenureType = UKTenureTypeMap[keyof UKTenureTypeMap]; + +type GLATenureTypeKeys = keyof typeof GLATenureTypes; + +type GenericGLATenureType = { + value: TKey; + description: (typeof GLATenureTypes)[TKey]; +}; + +type GLATenureTypeMap = { + [K in GLATenureTypeKeys]: GenericGLATenureType; +}; + +/** + * @id #GLATenureType + * @description Tenure types tracked by the Greater London Authority (GLA) + */ +export type GLATenureType = GLATenureTypeMap[keyof GLATenureTypeMap]; diff --git a/types/enums/UseClasses.ts b/types/enums/UseClasses.ts index 0a158bf6..4f1ee737 100644 --- a/types/enums/UseClasses.ts +++ b/types/enums/UseClasses.ts @@ -12,3 +12,20 @@ export const GLAUseClasses = { SG: 'Sui generis', unknown: 'Not known', }; + +type GLAUseClassKeys = keyof typeof GLAUseClasses; + +type GenericGLAUseClass = { + value: TKey; + description: (typeof GLAUseClasses)[TKey]; +}; + +type GLAUseClassMap = { + [K in GLAUseClassKeys]: GenericGLAUseClass; +}; + +/** + * @id #GLAUseClass + * @description Use classes tracked by the Greater London Authority (GLA) + */ +export type GLAUseClass = GLAUseClassMap[keyof GLAUseClassMap]; diff --git a/types/schema/File.ts b/types/schema/File.ts index 0b744e42..55c55cec 100644 --- a/types/schema/File.ts +++ b/types/schema/File.ts @@ -1,4 +1,4 @@ -import {FileTypes} from '../enums/FileTypes'; +import {FileType} from '../enums/FileTypes'; /** * @id #File @@ -9,20 +9,3 @@ export interface File { type: FileType[]; description?: string; } - -type FileTypeKeys = keyof typeof FileTypes; - -type GenericFileType = { - value: TKey; - description: (typeof FileTypes)[TKey]; -}; - -type FileTypeMap = { - [K in FileTypeKeys]: GenericFileType; -}; - -/** - * @id #FileType - * @description Types of planning documents and drawings - */ -export type FileType = FileTypeMap[keyof FileTypeMap]; diff --git a/types/schema/Metadata.ts b/types/schema/Metadata.ts index a7a434b0..151aef1a 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -1,5 +1,5 @@ +import {FileType} from '../enums/FileTypes'; import {DateTime, URL, UUID} from './../utils'; -import {FileType} from './File'; import {QuestionMetaData} from './Responses'; /** diff --git a/types/schema/PreAssessment.ts b/types/schema/PreAssessment.ts index e11099b9..c7b1ea46 100644 --- a/types/schema/PreAssessment.ts +++ b/types/schema/PreAssessment.ts @@ -1,24 +1,7 @@ -import {Flags} from '../enums/Flags'; +import {ResultFlag} from '../enums/Flags'; /** * @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 */ export type PreAssessment = ResultFlag[]; // @todo validate/restrict array to one result per flagset - -type FlagKeys = keyof typeof Flags; - -type GenericFlag = { - value: TKey; - description: (typeof Flags)[TKey]; -}; - -type FlagMap = { - [K in FlagKeys]: GenericFlag; -}; - -/** - * @id #ResultFlag - * @description The result of a single flagset - */ -export type ResultFlag = FlagMap[keyof FlagMap]; diff --git a/types/schema/data/Application.ts b/types/schema/data/Application.ts index 0373465a..1264341c 100644 --- a/types/schema/data/Application.ts +++ b/types/schema/data/Application.ts @@ -1,4 +1,4 @@ -import {ApplicationTypes} from '../../enums/ApplicationTypes'; +import {ApplicationType} from '../../enums/ApplicationTypes'; import {Date} from '../../utils'; /** @@ -180,20 +180,3 @@ export interface LeadDeveloper { registrationNumber: string; }; } - -type ApplicationTypeKeys = keyof typeof ApplicationTypes; - -type GenericApplicationType = { - value: TKey; - description: (typeof ApplicationTypes)[TKey]; -}; - -type ApplicationTypeMap = { - [K in ApplicationTypeKeys]: GenericApplicationType; -}; - -/** - * @id #ApplicationType - * @description Planning application types - */ -export type ApplicationType = ApplicationTypeMap[keyof ApplicationTypeMap]; diff --git a/types/schema/data/Property.ts b/types/schema/data/Property.ts index c768db17..d8948651 100644 --- a/types/schema/data/Property.ts +++ b/types/schema/data/Property.ts @@ -1,7 +1,9 @@ -import {PlanningDesignations} from '../../enums/PlanningConstraints'; -import {PropertyTypes} from '../../enums/PropertyTypes'; +import {PlanningDesignation} from '../../enums/PlanningConstraints'; +import {PropertyType} from '../../enums/PropertyTypes'; +import {UKResidentialUnitType} from '../../enums/ResidentialUnitTypes'; +import {UKTenureType} from '../../enums/TenureTypes'; import {Date, URL} from '../../utils'; -import {GeoBoundary, Materials} from './shared'; +import {Entity, GeoBoundary, Materials} from './shared'; /** * @id #Property @@ -69,6 +71,14 @@ export interface UKProperty { lastUseEndDate: Date; }; }; + units?: { + residential: { + tenure: UKTenureType; + type: UKResidentialUnitType; + bedrooms: number; + identicalUnits: number; + }[]; + }; } /** @@ -179,60 +189,6 @@ export interface OSAddress extends SiteAddress { source: 'Ordnance Survey'; } -type PropertyTypeKeys = keyof typeof PropertyTypes; - -type GenericPropertyType = { - value: TKey; - description: (typeof PropertyTypes)[TKey]; -}; - -type PropertyTypeMap = { - [K in PropertyTypeKeys]: GenericPropertyType; -}; - -/** - * @id #PropertyType - * @description Property types derived from Basic Land and Property Unit (BLPU) classification codes - */ -export type PropertyType = PropertyTypeMap[keyof PropertyTypeMap]; - -type PlanningDesigationKeys = keyof typeof PlanningDesignations; - -type GenericPlanningDesignation = { - value: TKey; - description: (typeof PlanningDesignations)[TKey]; -}; - -type PlanningDesignationMap = { - [K in PlanningDesigationKeys]: GenericPlanningDesignation; -}; - -type BasePlanningDesignation = - PlanningDesignationMap[keyof PlanningDesignationMap]; - -/** - * @description A planning designation that does not intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects - */ -type NonIntersectingPlanningDesignation = { - intersects: false; -} & BasePlanningDesignation; - -/** - * @description A planning designation that does intersect with the proposed site, per the DE-9IM spatial relationship definition of intersects - */ -type IntersectingPlanningDesignation = { - intersects: true; - entities: Entity[] | []; -} & BasePlanningDesignation; - -/** - * @id #PlanningDesignation - * @description 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 = - | NonIntersectingPlanningDesignation - | IntersectingPlanningDesignation; - type BasePlanningConstraint = { value: string; description: string; @@ -260,18 +216,3 @@ type IntersectingPlanningConstraint = { export type PlanningConstraint = | NonIntersectingPlanningConstraint | IntersectingPlanningConstraint; - -type Entity = { - name: string; - description?: string; - source: PlanningDataSource | OSRoadsSource; -}; - -type PlanningDataSource = { - text: 'Planning Data'; - url: URL; -}; - -type OSRoadsSource = { - text: 'Ordnance Survey MasterMap Highways'; -}; diff --git a/types/schema/data/Proposal.ts b/types/schema/data/Proposal.ts index 0c8ac349..c459046e 100644 --- a/types/schema/data/Proposal.ts +++ b/types/schema/data/Proposal.ts @@ -1,9 +1,14 @@ +import {BuildingRegulation} from '../../enums/BuildingRegulations'; +import {DevelopmentType} from '../../enums/DevelopmentTypes'; +import {GLAHousingProvider} from '../../enums/HousingProviders'; +import {OpenSpaceDesignation, OpenSpaceType} from '../../enums/OpenSpaces'; +import {ProjectType} from '../../enums/ProjectTypes'; +import {ProtectedSpaceDesignation} from '../../enums/ProtectedSpaces'; import { - GLAOpenSpaceTypes, - GLAOpenSpaceDesignations, -} from '../../enums/OpenSpaces'; -import {GLAProtectedSpaceDesignations} from '../../enums/ProtectedSpaces'; -import {ProjectTypes} from '../../enums/ProjectTypes'; + GLAResidentialUnitType, + UKResidentialUnitType, +} from '../../enums/ResidentialUnitTypes'; +import {GLATenureType} from '../../enums/TenureTypes'; import {Area, Date} from '../../utils'; import {GeoBoundary, Materials} from './shared'; @@ -104,13 +109,21 @@ export interface BaseProposal { newDwellings?: { newBuild?: {count: number}; }; + units?: { + residential: { + development: DevelopmentType; + type: UKResidentialUnitType; + bedrooms: number; + identicalUnits: number; + }[]; + }; } /** * @id #LondonProposal * @description Proposal details for project sites within the Greater London Authority (GLA) area */ -export interface LondonProposal extends BaseProposal { +export interface LondonProposal extends Omit { schemeName?: string; /** * @description Proposed parking spaces @@ -224,6 +237,14 @@ export interface LondonProposal extends BaseProposal { waste?: { reuseRecycle: {percent: number}; }; + units?: { + residential: { + new?: GLAGainedUnit[]; + rebuilt?: GLAGainedUnit[]; + removed?: GLALostUnit[]; + retained?: GLARetainedUnit[]; + }; + }; } type ProposedCount = { @@ -252,74 +273,23 @@ export interface ProposalDates { completion?: Date; } -type ProjectTypeKeys = keyof typeof ProjectTypes; - -type GenericProjectType = { - value: TKey; - description: (typeof ProjectTypes)[TKey]; -}; - -type ProjectTypeMap = { - [K in ProjectTypeKeys]: GenericProjectType; -}; - -/** - * @id #ProjectType - * @description Planning project types - */ -export type ProjectType = ProjectTypeMap[keyof ProjectTypeMap]; - -type OpenSpaceTypeKeys = keyof typeof GLAOpenSpaceTypes; - -type GenericOpenSpaceType = { - value: TKey; - description: (typeof GLAOpenSpaceTypes)[TKey]; -}; - -type OpenSpaceTypeMap = { - [K in OpenSpaceTypeKeys]: GenericOpenSpaceType; -}; - -/** - * @id #OpenSpaceType - * @description Types of natural open spaces - */ -export type OpenSpaceType = OpenSpaceTypeMap[keyof OpenSpaceTypeMap]; - -type OpenSpaceDesignationKeys = keyof typeof GLAOpenSpaceDesignations; - -type GenericOpenSpaceDesignation = { - value: TKey; - description: (typeof GLAOpenSpaceDesignations)[TKey]; -}; - -type OpenSpaceDesignationMap = { - [K in OpenSpaceDesignationKeys]: GenericOpenSpaceDesignation; -}; - -/** - * @id #OpenSpaceDesignation - * @description Designations of natural open spaces - */ -export type OpenSpaceDesignation = - OpenSpaceDesignationMap[keyof OpenSpaceDesignationMap]; - -type ProtectedSpaceDesignationKeys = keyof typeof GLAProtectedSpaceDesignations; - -type GenericProtectedSpaceDesignation< - TKey extends ProtectedSpaceDesignationKeys, -> = { - value: TKey; - description: (typeof GLAProtectedSpaceDesignations)[TKey]; -}; +interface GLARetainedUnit { + bedrooms: number; + tenure: GLATenureType; + type: GLAResidentialUnitType; + identicalUnits: number; +} -type ProtectedSpaceDesignationMap = { - [K in ProtectedSpaceDesignationKeys]: GenericProtectedSpaceDesignation; -}; +interface GLALostUnit extends GLARetainedUnit { + habitableRooms: number; + compliance: BuildingRegulation[]; + provider: GLAHousingProvider; + area: Area; + sheltered: boolean; + olderPersons: boolean; +} -/** - * @id #ProtectedSpaceDesignation - * @description Designations of natural protected spaces - */ -export type ProtectedSpaceDesignation = - ProtectedSpaceDesignationMap[keyof ProtectedSpaceDesignationMap]; +interface GLAGainedUnit extends GLALostUnit { + development: DevelopmentType; + garden: boolean; +} diff --git a/types/schema/data/shared.ts b/types/schema/data/shared.ts index d2a2c603..b857c335 100644 --- a/types/schema/data/shared.ts +++ b/types/schema/data/shared.ts @@ -1,5 +1,5 @@ import {GeoJSON} from 'geojson'; -import {Area} from '../../utils'; +import {Area, URL} from '../../utils'; export type Materials = { boundary?: string; @@ -16,3 +16,18 @@ export type GeoBoundary = { site: GeoJSON; area: Area; }; + +export type Entity = { + name: string; + description?: string; + source: PlanningDataSource | OSRoadsSource; +}; + +type PlanningDataSource = { + text: 'Planning Data'; + url: URL; +}; + +type OSRoadsSource = { + text: 'Ordnance Survey MasterMap Highways'; +};