From 8cdd8ad2cd66fc10f88f249d89191b959d9b4e46 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Mon, 1 Jul 2024 15:52:04 +0200 Subject: [PATCH 1/4] extend interface with omission to share keys btwn UK & GLA --- schema/schema.json | 319 ++++++++++++++++++++++++++++++++++ types/schema/data/Property.ts | 8 + types/schema/data/Proposal.ts | 40 ++++- 3 files changed, 366 insertions(+), 1 deletion(-) diff --git a/schema/schema.json b/schema/schema.json index e93f28c4..a0dcc892 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": { + "type": "string" + }, + "identicalUnits": { + "type": "number" + }, + "type": { + "type": "string" + } + }, + "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", @@ -5000,6 +5036,42 @@ "type": { "$ref": "#/definitions/PropertyType" }, + "units": { + "additionalProperties": false, + "properties": { + "residential": { + "items": { + "additionalProperties": false, + "properties": { + "bedrooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "tenure": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "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 +5693,217 @@ "schemeName": { "type": "string" }, + "units": { + "additionalProperties": false, + "properties": { + "residential": { + "additionalProperties": false, + "properties": { + "new": { + "items": { + "additionalProperties": false, + "properties": { + "area": { + "$ref": "#/definitions/Area" + }, + "bedrooms": { + "type": "number" + }, + "compliance": { + "type": "string" + }, + "development": { + "type": "string" + }, + "garden": { + "type": "boolean" + }, + "habitableRooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "olderPersons": { + "type": "boolean" + }, + "provider": { + "type": "string" + }, + "sheltered": { + "type": "boolean" + }, + "tenure": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "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": { + "type": "string" + }, + "development": { + "type": "string" + }, + "garden": { + "type": "boolean" + }, + "habitableRooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "olderPersons": { + "type": "boolean" + }, + "provider": { + "type": "string" + }, + "sheltered": { + "type": "boolean" + }, + "tenure": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "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": { + "type": "string" + }, + "habitableRooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "olderPersons": { + "type": "boolean" + }, + "provider": { + "type": "string" + }, + "sheltered": { + "type": "boolean" + }, + "tenure": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "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": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "bedrooms", + "tenure", + "type", + "identicalUnits" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "residential" + ], + "type": "object" + }, "urbanGreeningFactor": { "additionalProperties": false, "description": "Urban Greening Factor Score", @@ -24662,6 +24945,42 @@ "type": { "$ref": "#/definitions/PropertyType" }, + "units": { + "additionalProperties": false, + "properties": { + "residential": { + "items": { + "additionalProperties": false, + "properties": { + "bedrooms": { + "type": "number" + }, + "identicalUnits": { + "type": "number" + }, + "tenure": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "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", diff --git a/types/schema/data/Property.ts b/types/schema/data/Property.ts index c768db17..99cf025b 100644 --- a/types/schema/data/Property.ts +++ b/types/schema/data/Property.ts @@ -69,6 +69,14 @@ export interface UKProperty { lastUseEndDate: Date; }; }; + units?: { + residential: { + tenure: string; // enum + type: string; // enum + bedrooms: number; + identicalUnits: number; + }[]; + }; } /** diff --git a/types/schema/data/Proposal.ts b/types/schema/data/Proposal.ts index 0c8ac349..3b7d6b07 100644 --- a/types/schema/data/Proposal.ts +++ b/types/schema/data/Proposal.ts @@ -104,13 +104,21 @@ export interface BaseProposal { newDwellings?: { newBuild?: {count: number}; }; + units?: { + residential: { + development: string; // enum + type: string; // enum + 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 +232,14 @@ export interface LondonProposal extends BaseProposal { waste?: { reuseRecycle: {percent: number}; }; + units?: { + residential: { + new?: GLAGainedUnit[]; + rebuilt?: GLAGainedUnit[]; + removed?: GLALostUnit[]; + retained?: GLARetainedUnit[]; + }; + }; } type ProposedCount = { @@ -323,3 +339,25 @@ type ProtectedSpaceDesignationMap = { */ export type ProtectedSpaceDesignation = ProtectedSpaceDesignationMap[keyof ProtectedSpaceDesignationMap]; + +interface GLARetainedUnit { + bedrooms: number; + tenure: string; // enum + type: string; // enum + identicalUnits: number; +} + +interface GLALostUnit extends GLARetainedUnit { + habitableRooms: number; + compliance: string; // enum + provider: string; // enum + area: Area; + sheltered: boolean; + olderPersons: boolean; +} + +interface GLAGainedUnit extends GLALostUnit { + development: string; // enum + garden: boolean; + sheltered: boolean; +} From 04c0bb9cd3eb308f4a7f8caca7f28f7fbb26730c Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Tue, 2 Jul 2024 22:22:11 +0200 Subject: [PATCH 2/4] full res unit types, refactor enum definitions --- types/enums/ApplicationTypes.ts | 17 +++++ types/enums/BuildingRegulations.ts | 26 +++++++ types/enums/DevelopmentTypes.ts | 17 +++++ types/enums/FileTypes.ts | 17 +++++ types/enums/Flags.ts | 17 +++++ types/enums/HousingProviders.ts | 17 +++++ types/enums/OpenSpaces.ts | 36 ++++++++++ types/enums/PlanningConstraints.ts | 39 +++++++++++ types/enums/ProjectTypes.ts | 17 +++++ types/enums/PropertyTypes.ts | 17 +++++ types/enums/ProtectedSpaces.ts | 20 ++++++ types/enums/ResidentialUnitTypes.ts | 38 +++++++++- types/enums/TenureTypes.ts | 38 +++++++++- types/enums/UseClasses.ts | 17 +++++ types/schema/File.ts | 19 +---- types/schema/Metadata.ts | 6 +- types/schema/PreAssessment.ts | 19 +---- types/schema/data/Application.ts | 19 +---- types/schema/data/Property.ts | 83 +++------------------- types/schema/data/Proposal.ts | 104 +++++----------------------- types/schema/data/shared.ts | 15 ++++ 21 files changed, 376 insertions(+), 222 deletions(-) create mode 100644 types/enums/BuildingRegulations.ts 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..ea849ee1 --- /dev/null +++ b/types/enums/BuildingRegulations.ts @@ -0,0 +1,26 @@ +/** + * 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..0fa74ff4 100644 --- a/types/enums/HousingProviders.ts +++ b/types/enums/HousingProviders.ts @@ -9,3 +9,20 @@ 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..4a17d541 100644 --- a/types/enums/OpenSpaces.ts +++ b/types/enums/OpenSpaces.ts @@ -21,3 +21,39 @@ 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]; + \ No newline at end of file diff --git a/types/enums/PlanningConstraints.ts b/types/enums/PlanningConstraints.ts index 10ac5fe4..8a71b6d4 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..c98026e8 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,40 @@ 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]; \ No newline at end of file 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..8c016946 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]; \ No newline at end of file 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..83307e49 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -1,6 +1,6 @@ -import {DateTime, URL, UUID} from './../utils'; -import {FileType} from './File'; -import {QuestionMetaData} from './Responses'; +import { FileType } from '../enums/FileTypes'; +import { DateTime, URL, UUID } from './../utils'; +import { QuestionMetaData } from './Responses'; /** * @id #DigitalPlanningMetadata 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..063fd533 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 99cf025b..19ff3f0d 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 {Date, URL} from '../../utils'; -import {GeoBoundary, Materials} from './shared'; +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 { Entity, GeoBoundary, Materials } from './shared'; /** * @id #Property @@ -71,8 +73,8 @@ export interface UKProperty { }; units?: { residential: { - tenure: string; // enum - type: string; // enum + tenure: UKTenureType; + type: UKResidentialUnitType; bedrooms: number; identicalUnits: number; }[]; @@ -187,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; @@ -268,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 3b7d6b07..186786f5 100644 --- a/types/schema/data/Proposal.ts +++ b/types/schema/data/Proposal.ts @@ -1,11 +1,16 @@ +import { BuildingRegulation } from '../../enums/BuildingRegulations'; +import { DevelopmentType } from '../../enums/DevelopmentTypes'; +import { GLAHousingProvider } from "../../enums/HousingProviders"; import { - GLAOpenSpaceTypes, - GLAOpenSpaceDesignations, + OpenSpaceDesignation, + OpenSpaceType } from '../../enums/OpenSpaces'; -import {GLAProtectedSpaceDesignations} from '../../enums/ProtectedSpaces'; -import {ProjectTypes} from '../../enums/ProjectTypes'; -import {Area, Date} from '../../utils'; -import {GeoBoundary, Materials} from './shared'; +import { ProjectType } from '../../enums/ProjectTypes'; +import { ProtectedSpaceDesignation } from '../../enums/ProtectedSpaces'; +import { GLAResidentialUnitType, UKResidentialUnitType } from '../../enums/ResidentialUnitTypes'; +import { GLATenureType } from '../../enums/TenureTypes'; +import { Area, Date } from '../../utils'; +import { GeoBoundary, Materials } from './shared'; /** * @id #Proposal @@ -106,8 +111,8 @@ export interface BaseProposal { }; units?: { residential: { - development: string; // enum - type: string; // enum + development: DevelopmentType; + type: UKResidentialUnitType; bedrooms: number; identicalUnits: number; }[]; @@ -268,96 +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]; -}; - -type ProtectedSpaceDesignationMap = { - [K in ProtectedSpaceDesignationKeys]: GenericProtectedSpaceDesignation; -}; - -/** - * @id #ProtectedSpaceDesignation - * @description Designations of natural protected spaces - */ -export type ProtectedSpaceDesignation = - ProtectedSpaceDesignationMap[keyof ProtectedSpaceDesignationMap]; - interface GLARetainedUnit { bedrooms: number; - tenure: string; // enum - type: string; // enum + tenure: GLATenureType; + type: GLAResidentialUnitType; identicalUnits: number; } interface GLALostUnit extends GLARetainedUnit { habitableRooms: number; - compliance: string; // enum - provider: string; // enum + compliance: BuildingRegulation[]; + provider: GLAHousingProvider; area: Area; sheltered: boolean; olderPersons: boolean; } interface GLAGainedUnit extends GLALostUnit { - development: string; // enum + development: DevelopmentType; garden: boolean; - sheltered: boolean; } diff --git a/types/schema/data/shared.ts b/types/schema/data/shared.ts index d2a2c603..58706ffc 100644 --- a/types/schema/data/shared.ts +++ b/types/schema/data/shared.ts @@ -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'; +}; \ No newline at end of file From 0d6d6901b0ff8383a493ad62058efa99108203b2 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Tue, 2 Jul 2024 22:24:12 +0200 Subject: [PATCH 3/4] full res unit types, refactor enum definitions --- schema/schema.json | 2614 ++++++++++++--------------- types/enums/BuildingRegulations.ts | 11 +- types/enums/HousingProviders.ts | 3 +- types/enums/OpenSpaces.ts | 1 - types/enums/PlanningConstraints.ts | 2 +- types/enums/ResidentialUnitTypes.ts | 6 +- types/enums/UseClasses.ts | 2 +- types/schema/Metadata.ts | 6 +- types/schema/data/Application.ts | 2 +- types/schema/data/Property.ts | 12 +- types/schema/data/Proposal.ts | 24 +- types/schema/data/shared.ts | 4 +- 12 files changed, 1236 insertions(+), 1451 deletions(-) diff --git a/schema/schema.json b/schema/schema.json index a0dcc892..14eadb39 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -2250,13 +2250,13 @@ "type": "number" }, "development": { - "type": "string" + "$ref": "#/definitions/DevelopmentType" }, "identicalUnits": { "type": "number" }, "type": { - "type": "string" + "$ref": "#/definitions/UKResidentialUnitType" } }, "required": [ @@ -2416,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, @@ -2501,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", @@ -4466,8 +4726,656 @@ "locationPlan": { "$ref": "#/definitions/GeoBoundary" } - }, - "type": "object" + }, + "type": "object" + }, + "GLAHousingProvider": { + "$id": "#GLAHousingProvider", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Other affordable housing provider", + "type": "string" + }, + "value": { + "const": "affordableHousing", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Council delivered build to rent", + "type": "string" + }, + "value": { + "const": "councilBuildToRent", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Council delivery company", + "type": "string" + }, + "value": { + "const": "councilDelivery", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Housing association", + "type": "string" + }, + "value": { + "const": "HA", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Local Authority", + "type": "string" + }, + "value": { + "const": "LA", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Private", + "type": "string" + }, + "value": { + "const": "private", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Private rented sector", + "type": "string" + }, + "value": { + "const": "privateRented", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Other public authority", + "type": "string" + }, + "value": { + "const": "publicAuthority", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Self-build", + "type": "string" + }, + "value": { + "const": "selfBuild", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Housing provider categories tracked by the Greater London Authority (GLA)" + }, + "GLAResidentialUnitType": { + "$id": "#GLAResidentialUnitType", + "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": "Co-living unit", + "type": "string" + }, + "value": { + "const": "coLiving", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Detached home", + "type": "string" + }, + "value": { + "const": "detached", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Flat/apartment or maisonette", + "type": "string" + }, + "value": { + "const": "flat", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "House in multiple occupation (HMO)", + "type": "string" + }, + "value": { + "const": "HMO", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Hostel room", + "type": "string" + }, + "value": { + "const": "hostel", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Live/work unit", + "type": "string" + }, + "value": { + "const": "LW", + "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": "Semi-detached home", + "type": "string" + }, + "value": { + "const": "semiDetached", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Student accomodation", + "type": "string" + }, + "value": { + "const": "student", + "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" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Terraced home", + "type": "string" + }, + "value": { + "const": "terraced", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Residential unit types tracked by the Greater London Authority (GLA)" + }, + "GLATenureType": { + "$id": "#GLATenureType", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Affordable rent (not at LAR benchmark rents)", + "type": "string" + }, + "value": { + "const": "AR", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Discount market rate", + "type": "string" + }, + "value": { + "const": "DMR", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Discount market rate (charged at London Living Rents)", + "type": "string" + }, + "value": { + "const": "DMRLLR", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Discount market sale", + "type": "string" + }, + "value": { + "const": "DMS", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "London Affordable Rent", + "type": "string" + }, + "value": { + "const": "LAR", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "London Living Rent", + "type": "string" + }, + "value": { + "const": "LRR", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "London Shared Ownership", + "type": "string" + }, + "value": { + "const": "LSO", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Market for rent", + "type": "string" + }, + "value": { + "const": "marketForRent", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Market for sale", + "type": "string" + }, + "value": { + "const": "marketForSale", + "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": "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" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Shared equity", + "type": "string" + }, + "value": { + "const": "sharedEquity", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Social rent", + "type": "string" + }, + "value": { + "const": "SR", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "Tenure types tracked by the Greater London Authority (GLA)" }, "GeoBoundary": { "additionalProperties": false, @@ -5050,10 +5958,10 @@ "type": "number" }, "tenure": { - "type": "string" + "$ref": "#/definitions/UKTenureType" }, "type": { - "type": "string" + "$ref": "#/definitions/UKResidentialUnitType" } }, "required": [ @@ -5710,10 +6618,13 @@ "type": "number" }, "compliance": { - "type": "string" + "items": { + "$ref": "#/definitions/BuildingRegulation" + }, + "type": "array" }, "development": { - "type": "string" + "$ref": "#/definitions/DevelopmentType" }, "garden": { "type": "boolean" @@ -5728,16 +6639,16 @@ "type": "boolean" }, "provider": { - "type": "string" + "$ref": "#/definitions/GLAHousingProvider" }, "sheltered": { "type": "boolean" }, "tenure": { - "type": "string" + "$ref": "#/definitions/GLATenureType" }, "type": { - "type": "string" + "$ref": "#/definitions/GLAResidentialUnitType" } }, "required": [ @@ -5769,10 +6680,13 @@ "type": "number" }, "compliance": { - "type": "string" + "items": { + "$ref": "#/definitions/BuildingRegulation" + }, + "type": "array" }, "development": { - "type": "string" + "$ref": "#/definitions/DevelopmentType" }, "garden": { "type": "boolean" @@ -5787,16 +6701,16 @@ "type": "boolean" }, "provider": { - "type": "string" + "$ref": "#/definitions/GLAHousingProvider" }, "sheltered": { "type": "boolean" }, "tenure": { - "type": "string" + "$ref": "#/definitions/GLATenureType" }, "type": { - "type": "string" + "$ref": "#/definitions/GLAResidentialUnitType" } }, "required": [ @@ -5828,7 +6742,10 @@ "type": "number" }, "compliance": { - "type": "string" + "items": { + "$ref": "#/definitions/BuildingRegulation" + }, + "type": "array" }, "habitableRooms": { "type": "number" @@ -5840,16 +6757,16 @@ "type": "boolean" }, "provider": { - "type": "string" + "$ref": "#/definitions/GLAHousingProvider" }, "sheltered": { "type": "boolean" }, "tenure": { - "type": "string" + "$ref": "#/definitions/GLATenureType" }, "type": { - "type": "string" + "$ref": "#/definitions/GLAResidentialUnitType" } }, "required": [ @@ -5879,10 +6796,10 @@ "type": "number" }, "tenure": { - "type": "string" + "$ref": "#/definitions/GLATenureType" }, "type": { - "type": "string" + "$ref": "#/definitions/GLAResidentialUnitType" } }, "required": [ @@ -7009,54 +7926,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" }, @@ -7751,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" }, @@ -7837,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" }, @@ -7923,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" }, @@ -8009,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" }, @@ -8095,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" }, @@ -8181,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" }, @@ -8267,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" }, @@ -8353,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" }, @@ -8439,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" }, @@ -8525,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" }, @@ -8611,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" }, @@ -8697,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" }, @@ -8783,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" }, @@ -8869,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" }, @@ -8955,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" }, @@ -9041,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" }, @@ -9127,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" }, @@ -9213,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" }, @@ -9299,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" }, @@ -9385,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" }, @@ -9471,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" }, @@ -9557,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" }, @@ -9643,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" }, @@ -9729,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" }, @@ -9815,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" }, @@ -9901,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" }, @@ -9987,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" }, @@ -10073,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" }, @@ -24959,10 +24513,10 @@ "type": "number" }, "tenure": { - "type": "string" + "$ref": "#/definitions/UKTenureType" }, "type": { - "type": "string" + "$ref": "#/definitions/UKResidentialUnitType" } }, "required": [ @@ -25031,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/BuildingRegulations.ts b/types/enums/BuildingRegulations.ts index ea849ee1..6d35bdc2 100644 --- a/types/enums/BuildingRegulations.ts +++ b/types/enums/BuildingRegulations.ts @@ -2,10 +2,10 @@ * 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", + 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; @@ -23,4 +23,5 @@ type BuildingRegulationMap = { * @id #BuildingRegulation * @description Building regulations */ -export type BuildingRegulation = BuildingRegulationMap[keyof BuildingRegulationMap]; +export type BuildingRegulation = + BuildingRegulationMap[keyof BuildingRegulationMap]; diff --git a/types/enums/HousingProviders.ts b/types/enums/HousingProviders.ts index 0fa74ff4..30a28dc0 100644 --- a/types/enums/HousingProviders.ts +++ b/types/enums/HousingProviders.ts @@ -25,4 +25,5 @@ type GLAHousingProviderMap = { * @id #GLAHousingProvider * @description Housing provider categories tracked by the Greater London Authority (GLA) */ -export type GLAHousingProvider = GLAHousingProviderMap[keyof GLAHousingProviderMap]; +export type GLAHousingProvider = + GLAHousingProviderMap[keyof GLAHousingProviderMap]; diff --git a/types/enums/OpenSpaces.ts b/types/enums/OpenSpaces.ts index 4a17d541..d4c467eb 100644 --- a/types/enums/OpenSpaces.ts +++ b/types/enums/OpenSpaces.ts @@ -56,4 +56,3 @@ type OpenSpaceDesignationMap = { */ export type OpenSpaceDesignation = OpenSpaceDesignationMap[keyof OpenSpaceDesignationMap]; - \ No newline at end of file diff --git a/types/enums/PlanningConstraints.ts b/types/enums/PlanningConstraints.ts index 8a71b6d4..a08af89d 100644 --- a/types/enums/PlanningConstraints.ts +++ b/types/enums/PlanningConstraints.ts @@ -1,4 +1,4 @@ -import { Entity } from "../schema/data/shared"; +import {Entity} from '../schema/data/shared'; /** * Values for `data.property.planning.designations` diff --git a/types/enums/ResidentialUnitTypes.ts b/types/enums/ResidentialUnitTypes.ts index c98026e8..c8fb3e41 100644 --- a/types/enums/ResidentialUnitTypes.ts +++ b/types/enums/ResidentialUnitTypes.ts @@ -42,7 +42,8 @@ type UKResidentialUnitTypeMap = { * @id #UKResidentialUnitType * @description Residential unit types tracked throughout the UK */ -export type UKResidentialUnitType = UKResidentialUnitTypeMap[keyof UKResidentialUnitTypeMap]; +export type UKResidentialUnitType = + UKResidentialUnitTypeMap[keyof UKResidentialUnitTypeMap]; type GLAResidentialUnitTypeKeys = keyof typeof GLAResidentialUnitTypes; @@ -59,4 +60,5 @@ type GLAResidentialUnitTypeMap = { * @id #GLAResidentialUnitType * @description Residential unit types tracked by the Greater London Authority (GLA) */ -export type GLAResidentialUnitType = GLAResidentialUnitTypeMap[keyof GLAResidentialUnitTypeMap]; \ No newline at end of file +export type GLAResidentialUnitType = + GLAResidentialUnitTypeMap[keyof GLAResidentialUnitTypeMap]; diff --git a/types/enums/UseClasses.ts b/types/enums/UseClasses.ts index 8c016946..4f1ee737 100644 --- a/types/enums/UseClasses.ts +++ b/types/enums/UseClasses.ts @@ -28,4 +28,4 @@ type GLAUseClassMap = { * @id #GLAUseClass * @description Use classes tracked by the Greater London Authority (GLA) */ -export type GLAUseClass = GLAUseClassMap[keyof GLAUseClassMap]; \ No newline at end of file +export type GLAUseClass = GLAUseClassMap[keyof GLAUseClassMap]; diff --git a/types/schema/Metadata.ts b/types/schema/Metadata.ts index 83307e49..151aef1a 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -1,6 +1,6 @@ -import { FileType } from '../enums/FileTypes'; -import { DateTime, URL, UUID } from './../utils'; -import { QuestionMetaData } from './Responses'; +import {FileType} from '../enums/FileTypes'; +import {DateTime, URL, UUID} from './../utils'; +import {QuestionMetaData} from './Responses'; /** * @id #DigitalPlanningMetadata diff --git a/types/schema/data/Application.ts b/types/schema/data/Application.ts index 063fd533..1264341c 100644 --- a/types/schema/data/Application.ts +++ b/types/schema/data/Application.ts @@ -1,4 +1,4 @@ -import { ApplicationType } from '../../enums/ApplicationTypes'; +import {ApplicationType} from '../../enums/ApplicationTypes'; import {Date} from '../../utils'; /** diff --git a/types/schema/data/Property.ts b/types/schema/data/Property.ts index 19ff3f0d..d8948651 100644 --- a/types/schema/data/Property.ts +++ b/types/schema/data/Property.ts @@ -1,9 +1,9 @@ -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 { Entity, GeoBoundary, Materials } from './shared'; +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 {Entity, GeoBoundary, Materials} from './shared'; /** * @id #Property diff --git a/types/schema/data/Proposal.ts b/types/schema/data/Proposal.ts index 186786f5..c459046e 100644 --- a/types/schema/data/Proposal.ts +++ b/types/schema/data/Proposal.ts @@ -1,16 +1,16 @@ -import { BuildingRegulation } from '../../enums/BuildingRegulations'; -import { DevelopmentType } from '../../enums/DevelopmentTypes'; -import { GLAHousingProvider } from "../../enums/HousingProviders"; +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 { - OpenSpaceDesignation, - OpenSpaceType -} from '../../enums/OpenSpaces'; -import { ProjectType } from '../../enums/ProjectTypes'; -import { ProtectedSpaceDesignation } from '../../enums/ProtectedSpaces'; -import { GLAResidentialUnitType, UKResidentialUnitType } from '../../enums/ResidentialUnitTypes'; -import { GLATenureType } from '../../enums/TenureTypes'; -import { Area, Date } from '../../utils'; -import { GeoBoundary, Materials } from './shared'; + GLAResidentialUnitType, + UKResidentialUnitType, +} from '../../enums/ResidentialUnitTypes'; +import {GLATenureType} from '../../enums/TenureTypes'; +import {Area, Date} from '../../utils'; +import {GeoBoundary, Materials} from './shared'; /** * @id #Proposal diff --git a/types/schema/data/shared.ts b/types/schema/data/shared.ts index 58706ffc..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; @@ -30,4 +30,4 @@ type PlanningDataSource = { type OSRoadsSource = { text: 'Ordnance Survey MasterMap Highways'; -}; \ No newline at end of file +}; From 4cb62e2fb83af55d8fe96ec45e2126b851c859f4 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Tue, 2 Jul 2024 22:45:36 +0200 Subject: [PATCH 4/4] update prior approval example --- .../priorApproval/convertCommercialToHome.ts | 37 +++++++++++++- .../convertCommercialToHome.json | 49 ++++++++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-) 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": [ {