diff --git a/schemas/application.json b/schemas/application.json index 0f55d0d9..1056c206 100644 --- a/schemas/application.json +++ b/schemas/application.json @@ -7919,9 +7919,8 @@ "type": "object" }, "OSAddress": { - "$id": "#OSAddress", "additionalProperties": false, - "description": "Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium", + "description": "Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium LPI source", "properties": { "latitude": { "description": "Latitude coordinate in EPSG:4326 (WGS84)", @@ -7968,6 +7967,7 @@ "type": "string" }, "title": { + "description": "Single line address description", "type": "string" }, "town": { @@ -8007,6 +8007,7 @@ "x", "y" ], + "title": "#OSAddress", "type": "object" }, "OpenSpaceDesignation": { @@ -24017,7 +24018,6 @@ "type": "object" }, "ProposedAddress": { - "$id": "#ProposedAddress", "additionalProperties": false, "description": "Address information for sites without a known Unique Property Reference Number (UPRN)", "properties": { @@ -24034,6 +24034,7 @@ "type": "string" }, "title": { + "description": "Single line address description", "type": "string" }, "x": { @@ -24053,6 +24054,7 @@ "x", "y" ], + "title": "#ProposedAddress", "type": "object" }, "ProtectedSpaceDesignation": { @@ -24246,6 +24248,22 @@ }, "type": "object" }, + "Region": { + "description": "The region in England that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area", + "enum": [ + "North East", + "North West", + "Yorkshire and The Humber", + "East Midlands", + "West Midlands", + "East of England", + "London", + "South East", + "South West" + ], + "title": "#Region", + "type": "string" + }, "RequestedFiles": { "$id": "#RequestedFiles", "additionalProperties": false, @@ -25068,7 +25086,7 @@ "type": "object" }, "region": { - "$ref": "#/definitions/UKRegion" + "$ref": "#/definitions/Region" }, "trees": { "additionalProperties": false, @@ -25127,22 +25145,6 @@ ], "type": "object" }, - "UKRegion": { - "$id": "#UKRegion", - "description": "The UK region that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area", - "enum": [ - "North East", - "North West", - "Yorkshire and The Humber", - "East Midlands", - "West Midlands", - "East of England", - "London", - "South East", - "South West" - ], - "type": "string" - }, "UKResidentialUnitType": { "$id": "#UKResidentialUnitType", "anyOf": [ diff --git a/schemas/prototypeApplication.json b/schemas/prototypeApplication.json index 0c38d365..39cc296a 100644 --- a/schemas/prototypeApplication.json +++ b/schemas/prototypeApplication.json @@ -989,7 +989,7 @@ "type": "object" }, "boundary": { - "$ref": "#/definitions/GeoBoundaryPrototype", + "$ref": "#/definitions/GeoBoundary", "description": "Location plan boundary proposed by the user, commonly referred to as the red line boundary" }, "date": { @@ -1902,22 +1902,6 @@ ], "type": "object" }, - "GeoBoundaryPrototype": { - "additionalProperties": false, - "properties": { - "area": { - "$ref": "#/definitions/Area" - }, - "site": { - "$ref": "#/definitions/GeoJSON" - } - }, - "required": [ - "site", - "area" - ], - "type": "object" - }, "GeoJSON": { "anyOf": [ { @@ -3154,7 +3138,7 @@ "type": "object" }, "boundary": { - "$ref": "#/definitions/GeoBoundaryPrototype", + "$ref": "#/definitions/GeoBoundary", "description": "Location plan boundary proposed by the user, commonly referred to as the red line boundary" }, "charging": { @@ -4464,7 +4448,7 @@ }, "OSAddress": { "additionalProperties": false, - "description": "Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium (LPI)", + "description": "Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium LPI source", "properties": { "latitude": { "description": "Latitude coordinate in EPSG:4326 (WGS84)", @@ -4511,6 +4495,7 @@ "type": "string" }, "title": { + "description": "Single line address description", "type": "string" }, "town": { @@ -4550,6 +4535,7 @@ "x", "y" ], + "title": "#OSAddress", "type": "object" }, "OpenSpaceDesignation": { @@ -10197,6 +10183,7 @@ "type": "string" }, "title": { + "description": "Single line address description", "type": "string" }, "x": { @@ -10216,6 +10203,7 @@ "x", "y" ], + "title": "#ProposedAddress", "type": "object" }, "ProtectedSpaceDesignation": { @@ -10939,6 +10927,7 @@ "South East", "South West" ], + "title": "#Region", "type": "string" }, "ResidentialUnits": { diff --git a/types/schemas/application/data/Files.ts b/types/schemas/application/data/Files.ts index 793251cf..a0dc89e1 100644 --- a/types/schemas/application/data/Files.ts +++ b/types/schemas/application/data/Files.ts @@ -1,4 +1,4 @@ -import {GeoBoundary} from './shared'; +import {GeoBoundary} from './../../../shared/Boundaries'; /** * @id #FilesAsData diff --git a/types/schemas/application/data/Property.ts b/types/schemas/application/data/Property.ts index 04205df6..d11db148 100644 --- a/types/schemas/application/data/Property.ts +++ b/types/schemas/application/data/Property.ts @@ -1,7 +1,11 @@ +import {OSAddress, ProposedAddress} from '../../../shared/Addresses'; +import {GeoBoundary} from './../../../shared/Boundaries'; +import {Materials} from '../../../shared/Materials'; +import {Region} from '../../../shared/Regions'; +import {Date, URL} from '../../../shared/utils'; import {PlanningDesignation} from '../enums/PlanningConstraints'; import {PropertyType} from '../enums/PropertyTypes'; -import {Date, URL} from '../../../shared/utils'; -import {Entity, GeoBoundary, Materials, ResidentialUnits} from './shared'; +import {Entity, ResidentialUnits} from './shared'; /** * @id #Property @@ -9,28 +13,13 @@ import {Entity, GeoBoundary, Materials, ResidentialUnits} from './shared'; */ export type Property = UKProperty | LondonProperty; -/** - * @id #UKRegion - * @description The UK region that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area - */ -export type UKRegion = - | 'North East' - | 'North West' - | 'Yorkshire and The Humber' - | 'East Midlands' - | 'West Midlands' - | 'East of England' - | 'London' - | 'South East' - | 'South West'; - /** * @id #UKProperty * @description Property details for sites anywhere in the UK */ export interface UKProperty { address: ProposedAddress | OSAddress; - region: UKRegion; + region: Region; /** * @description Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district */ @@ -91,7 +80,7 @@ export interface UKProperty { * @description Property details for sites within the Greater London Authority (GLA) area */ export interface LondonProperty extends UKProperty { - region: Extract; + region: Extract; titleNumber?: { known: 'Yes' | 'No'; number?: string; @@ -138,81 +127,6 @@ export interface LondonProperty extends UKProperty { type ExistingCount = {count: number}; -/** - * @id #SiteAddress - * @description Address information available for any site, whether existing or proposed - */ -export interface SiteAddress { - title: string; - /** - * @description Easting coordinate in British National Grid (OSGB36) - */ - x: number; - /** - * @description Northing coordinate in British National Grid (OSGB36) - */ - y: number; - /** - * @description Latitude coordinate in EPSG:4326 (WGS84) - */ - latitude: number; - /** - * @description Longitude coordinate in EPSG:4326 (WGS84) - */ - longitude: number; -} - -/** - * @id #ProposedAddress - * @description Address information for sites without a known Unique Property Reference Number (UPRN) - */ -export interface ProposedAddress extends SiteAddress { - source: 'Proposed by applicant'; -} - -/** - * @id #OSAddress - * @description Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium - */ -export interface OSAddress extends SiteAddress { - /** - * @title Unique Property Reference Number - * @maxLength 12 - */ - uprn: string; - /** - * @title Unique Street Reference Number - * @maxLength 8 - */ - usrn: string; - /** - * @title Primary Addressable Object start range and/or building description - * @description Combined `PAO_START_NUMBER`, `PAO_START_SUFFIX`, `PAO_TEXT` OS LPI properties - */ - pao: string; - /** - * @title Primary Addressable Object (PAO) end range - * @description Combined `PAO_END_NUMBER`, `PAO_END_SUFFIX` OS LPI properties - */ - paoEnd?: string; - /** - * @title Secondary Addressable Object (SAO) start range and/or building description - * @description Combined `SAO_START_NUMBER`, `SAO_START_SUFFIX`, `SAO_TEXT` OS LPI properties - */ - sao?: string; - /** - * @title Secondary Addressable Object (SAO) end range - * @description Combined `SAO_END_NUMBER`, `SAO_END_SUFFIX` OS LPI properties - */ - saoEnd?: string; - street: string; - town: string; - postcode: string; - organisation?: string; - singleLine: string; - source: 'Ordnance Survey'; -} - type BasePlanningConstraint = { value: string; description: string; diff --git a/types/schemas/application/data/Proposal.ts b/types/schemas/application/data/Proposal.ts index 88add32c..826b3e6d 100644 --- a/types/schemas/application/data/Proposal.ts +++ b/types/schemas/application/data/Proposal.ts @@ -1,3 +1,5 @@ +import {GeoBoundary} from './../../../shared/Boundaries'; +import {Materials} from '../../../shared/Materials'; import {BuildingRegulation} from '../enums/BuildingRegulations'; import {DevelopmentType} from '../enums/DevelopmentTypes'; import {GLAHousingProvider} from '../enums/HousingProviders'; @@ -7,7 +9,7 @@ import {ProtectedSpaceDesignation} from '../enums/ProtectedSpaces'; import {GLAResidentialUnitType} from '../enums/ResidentialUnitTypes'; import {GLATenureType} from '../enums/TenureTypes'; import {Area, Date} from '../../../shared/utils'; -import {GeoBoundary, Materials, ResidentialUnits} from './shared'; +import {ResidentialUnits} from './shared'; /** * @id #Proposal diff --git a/types/schemas/application/data/shared.ts b/types/schemas/application/data/shared.ts index 31f20719..9b48c25d 100644 --- a/types/schemas/application/data/shared.ts +++ b/types/schemas/application/data/shared.ts @@ -1,23 +1,6 @@ -import {GeoJSON} from 'geojson'; +import {URL} from '../../../shared/utils'; import {UKResidentialUnitType} from '../enums/ResidentialUnitTypes'; import {UKTenureType} from '../enums/TenureTypes'; -import {Area, URL} from '../../../shared/utils'; - -export type Materials = { - boundary?: string; - door?: string; - lighting?: string; - roof?: string; - surface?: string; - wall?: string; - window?: string; - other?: string; -}; - -export type GeoBoundary = { - site: GeoJSON; - area: Area; -}; export type Entity = { name: string; diff --git a/types/schemas/preApplication/data/Property.ts b/types/schemas/preApplication/data/Property.ts index 36043a06..6dc9d5e6 100644 --- a/types/schemas/preApplication/data/Property.ts +++ b/types/schemas/preApplication/data/Property.ts @@ -1,16 +1,13 @@ -import { - OSAddress, - ProposedAddress, - UKRegion, -} from '../../application/data/Property'; -import {GeoBoundary} from '../../application/data/shared'; +import {OSAddress, ProposedAddress} from '../../../shared/Addresses'; +import {GeoBoundary} from './../../../shared/Boundaries'; +import {Region} from '../../../shared/Regions'; +import {URL} from '../../../shared/utils'; import {PlanningDesignation} from '../../application/enums/PlanningConstraints'; import {PropertyType} from '../../prototypeApplication/enums/PropertyTypes'; -import {URL} from '../../../shared/utils'; export interface Property { address: ProposedAddress | OSAddress; - region: UKRegion; + region: Region; /** * @description Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district */ diff --git a/types/schemas/preApplication/data/Proposal.ts b/types/schemas/preApplication/data/Proposal.ts index 37a8594f..b432d185 100644 --- a/types/schemas/preApplication/data/Proposal.ts +++ b/types/schemas/preApplication/data/Proposal.ts @@ -1,4 +1,4 @@ -import {GeoBoundary} from '../../application/data/shared'; +import {GeoBoundary} from './../../../shared/Boundaries'; export interface Proposal { description: string; diff --git a/types/schemas/prototypeApplication/data/Property.ts b/types/schemas/prototypeApplication/data/Property.ts index d3264562..950fe5f1 100644 --- a/types/schemas/prototypeApplication/data/Property.ts +++ b/types/schemas/prototypeApplication/data/Property.ts @@ -1,29 +1,17 @@ +import {OSAddress, ProposedAddress} from '../../../shared/Addresses'; +import {GeoBoundary} from './../../../shared/Boundaries'; +import {Materials} from '../../../shared/Materials'; +import {Region} from '../../../shared/Regions'; import {URL} from '../../../shared/utils'; -import {GeoBoundary} from '../../application/data/shared'; import {PrimaryApplicationType} from '../enums/ApplicationType'; import { PlanningConstraint, PlanningDesignation, } from '../enums/PlanningDesignation'; import {PropertyType} from '../enums/PropertyTypes'; -import {Materials} from './shared'; export type PropertyBase = EnglandProperty | LondonProperty; -/** - * @description The region in England that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area - */ -export type Region = - | 'North East' - | 'North West' - | 'Yorkshire and The Humber' - | 'East Midlands' - | 'West Midlands' - | 'East of England' - | 'London' - | 'South East' - | 'South West'; - /** * @description Property details for sites anywhere in England */ @@ -92,78 +80,6 @@ export interface LondonProperty extends EnglandProperty { type ExistingCount = {count: number}; -/** - * @description Address information available for any site, whether existing or proposed - */ -export interface SiteAddress { - title: string; - /** - * @description Easting coordinate in British National Grid (OSGB36) - */ - x: number; - /** - * @description Northing coordinate in British National Grid (OSGB36) - */ - y: number; - /** - * @description Latitude coordinate in EPSG:4326 (WGS84) - */ - latitude: number; - /** - * @description Longitude coordinate in EPSG:4326 (WGS84) - */ - longitude: number; -} - -/** - * @description Address information for sites without a known Unique Property Reference Number (UPRN) - */ -export interface ProposedAddress extends SiteAddress { - source: 'Proposed by applicant'; -} - -/** - * @description Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium (LPI) - */ -export interface OSAddress extends SiteAddress { - /** - * @title Unique Property Reference Number - * @maxLength 12 - */ - uprn: string; - /** - * @title Unique Street Reference Number - * @maxLength 8 - */ - usrn: string; - /** - * @title Primary Addressable Object start range and/or building description - * @description Combined `PAO_START_NUMBER`, `PAO_START_SUFFIX`, `PAO_TEXT` OS LPI properties - */ - pao: string; - /** - * @title Primary Addressable Object (PAO) end range - * @description Combined `PAO_END_NUMBER`, `PAO_END_SUFFIX` OS LPI properties - */ - paoEnd?: string; - /** - * @title Secondary Addressable Object (SAO) start range and/or building description - * @description Combined `SAO_START_NUMBER`, `SAO_START_SUFFIX`, `SAO_TEXT` OS LPI properties - */ - sao?: string; - /** - * @title Secondary Addressable Object (SAO) end range - * @description Combined `SAO_END_NUMBER`, `SAO_END_SUFFIX` OS LPI properties - */ - saoEnd?: string; - street: string; - town: string; - postcode: string; - organisation?: string; - singleLine: string; - source: 'Ordnance Survey'; -} - export type PPProperty = PropertyBase & { materials?: Materials; use?: { diff --git a/types/schemas/prototypeApplication/data/Proposal.ts b/types/schemas/prototypeApplication/data/Proposal.ts index e6d33e1b..edebb940 100644 --- a/types/schemas/prototypeApplication/data/Proposal.ts +++ b/types/schemas/prototypeApplication/data/Proposal.ts @@ -1,3 +1,5 @@ +import {GeoBoundary} from '../../../shared/Boundaries'; +import {Materials} from '../../../shared/Materials'; import {Area, Date, Integer} from '../../../shared/utils'; import {PrimaryApplicationType} from '../enums/ApplicationType'; import {BuildingRegulation} from '../enums/BuildingRegulation'; @@ -8,7 +10,7 @@ import {ProjectType} from '../enums/ProjectType'; import {ProtectedSpaceDesignation} from '../enums/ProtectedSpaceDesignation'; import {GLAResidentialUnitType} from '../enums/ResidentialUnitType'; import {GLATenureType} from '../enums/TenureType'; -import {GeoBoundaryPrototype, Materials, ResidentialUnits} from './shared'; +import {ResidentialUnits} from './shared'; /** * @description Information about the proposed works and any changes to the property @@ -22,7 +24,7 @@ export interface EnglandProposal { /** * @description Location plan boundary proposed by the user, commonly referred to as the red line boundary */ - boundary?: GeoBoundaryPrototype; + boundary?: GeoBoundary; /** * @description Proposed materials, if applicable to projectType */ diff --git a/types/schemas/prototypeApplication/data/shared.ts b/types/schemas/prototypeApplication/data/shared.ts index 0547fb1c..44f4b4aa 100644 --- a/types/schemas/prototypeApplication/data/shared.ts +++ b/types/schemas/prototypeApplication/data/shared.ts @@ -1,24 +1,6 @@ -import {GeoJSON} from 'geojson'; +import {URL} from '../../../shared/utils'; import {UKResidentialUnitType} from '../enums/ResidentialUnitType'; import {UKTenureType} from '../enums/TenureType'; -import {Area, URL} from '../../../shared/utils'; - -export type Materials = { - boundary?: string; - door?: string; - lighting?: string; - roof?: string; - surface?: string; - wall?: string; - window?: string; - other?: string; -}; - -// TODO - Rename when prototype application replaces application -export type GeoBoundaryPrototype = { - site: GeoJSON; - area: Area; -}; export type Entity = { name: string; diff --git a/types/shared/Addresses.ts b/types/shared/Addresses.ts new file mode 100644 index 00000000..e210056c --- /dev/null +++ b/types/shared/Addresses.ts @@ -0,0 +1,76 @@ +/** + * @description Address information available for any site, whether existing or proposed + */ +export interface SiteAddress { + /** + * @description Single line address description + */ + title: string; + /** + * @description Easting coordinate in British National Grid (OSGB36) + */ + x: number; + /** + * @description Northing coordinate in British National Grid (OSGB36) + */ + y: number; + /** + * @description Latitude coordinate in EPSG:4326 (WGS84) + */ + latitude: number; + /** + * @description Longitude coordinate in EPSG:4326 (WGS84) + */ + longitude: number; +} + +/** + * @title #ProposedAddress + * @description Address information for sites without a known Unique Property Reference Number (UPRN) + */ +export interface ProposedAddress extends SiteAddress { + source: 'Proposed by applicant'; +} + +/** + * @title #OSAddress + * @description Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium LPI source + */ +export interface OSAddress extends SiteAddress { + /** + * @title Unique Property Reference Number + * @maxLength 12 + */ + uprn: string; + /** + * @title Unique Street Reference Number + * @maxLength 8 + */ + usrn: string; + /** + * @title Primary Addressable Object start range and/or building description + * @description Combined `PAO_START_NUMBER`, `PAO_START_SUFFIX`, `PAO_TEXT` OS LPI properties + */ + pao: string; + /** + * @title Primary Addressable Object (PAO) end range + * @description Combined `PAO_END_NUMBER`, `PAO_END_SUFFIX` OS LPI properties + */ + paoEnd?: string; + /** + * @title Secondary Addressable Object (SAO) start range and/or building description + * @description Combined `SAO_START_NUMBER`, `SAO_START_SUFFIX`, `SAO_TEXT` OS LPI properties + */ + sao?: string; + /** + * @title Secondary Addressable Object (SAO) end range + * @description Combined `SAO_END_NUMBER`, `SAO_END_SUFFIX` OS LPI properties + */ + saoEnd?: string; + street: string; + town: string; + postcode: string; + organisation?: string; + singleLine: string; + source: 'Ordnance Survey'; +} diff --git a/types/shared/Boundaries.ts b/types/shared/Boundaries.ts new file mode 100644 index 00000000..5f1f83b2 --- /dev/null +++ b/types/shared/Boundaries.ts @@ -0,0 +1,7 @@ +import {GeoJSON} from 'geojson'; +import {Area} from './utils'; + +export type GeoBoundary = { + site: GeoJSON; + area: Area; +}; diff --git a/types/shared/Constraints.ts b/types/shared/Constraints.ts new file mode 100644 index 00000000..e69de29b diff --git a/types/shared/Materials.ts b/types/shared/Materials.ts new file mode 100644 index 00000000..f098961f --- /dev/null +++ b/types/shared/Materials.ts @@ -0,0 +1,10 @@ +export type Materials = { + boundary?: string; + door?: string; + lighting?: string; + roof?: string; + surface?: string; + wall?: string; + window?: string; + other?: string; +}; diff --git a/types/shared/Ownership.ts b/types/shared/Ownership.ts new file mode 100644 index 00000000..e69de29b diff --git a/types/shared/Regions.ts b/types/shared/Regions.ts new file mode 100644 index 00000000..13663d38 --- /dev/null +++ b/types/shared/Regions.ts @@ -0,0 +1,14 @@ +/** + * @title #Region + * @description The region in England that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area + */ +export type Region = + | 'North East' + | 'North West' + | 'Yorkshire and The Humber' + | 'East Midlands' + | 'West Midlands' + | 'East of England' + | 'London' + | 'South East' + | 'South West';