diff --git a/types/schemas/prototypeApplication/data/shared.ts b/types/schemas/prototypeApplication/data/shared.ts new file mode 100644 index 00000000..666a4d0c --- /dev/null +++ b/types/schemas/prototypeApplication/data/shared.ts @@ -0,0 +1,45 @@ +import {GeoJSON} from 'geojson'; +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; +}; + +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'; +}; + +export type ResidentialUnits = { + total: number; + residential: { + type: UKResidentialUnitType; + tenure: UKTenureType; + bedrooms: number; + identicalUnits: number; + }[]; +}; diff --git a/types/schemas/prototypeApplication/enums/PlanningDesignation.ts b/types/schemas/prototypeApplication/enums/PlanningDesignation.ts new file mode 100644 index 00000000..3ab486b1 --- /dev/null +++ b/types/schemas/prototypeApplication/enums/PlanningDesignation.ts @@ -0,0 +1,193 @@ +import {Entity} from '../data/shared'; +/** + * @description Article 4 Direction area + */ +type Article4 = 'article4'; + +/** + * @description Central Activities Zone (CAZ) + */ +type Article4CAZ = 'article4.caz'; + +/** + * @description Brownfield site + */ +type BrownfieldSite = 'brownfieldSite'; + +/** + * @description Designated land + */ +type Designated = 'designated'; + +/** + * @description Area of Outstanding Natural Beauty (AONB) + */ +type DesignatedAONB = 'designated.AONB'; + +/** + * @description Conservation Area + */ +type DesignatedConservationArea = 'designated.conservationArea'; + +/** + * @description National Park + */ +type DesignatedNationalPark = 'designated.nationalPark'; + +/** + * @description National Park - Broads + */ +type DesignatedNationalParkBroads = 'designated.nationalPark.broads'; + +/** + * @description UNESCO World Heritage Site or buffer zone + */ +type DesignatedWHS = 'designated.WHS'; + +/** + * @description Flood Risk Zone + */ +type Flood = 'flood'; + +/** + * @description Flood Risk Zone 1 - Low risk + */ +type FloodZone1 = 'flood.zone.1'; + +/** + * @description Flood Risk Zone 2 - Medium risk + */ +type FloodZone2 = 'flood.zone.2'; + +/** + * @description Flood Risk Zone 3 - High risk + */ +type FloodZone3 = 'flood.zone.3'; + +/** + * @description Green Belt + */ +type GreenBelt = 'greenBelt'; + +/** + * @description Listed Building + */ +type Listed = 'listed'; + +/** + * @description Listed Building - Grade I + */ +type ListedGradeI = 'listed.grade.I'; + +/** + * @description Listed Building - Grade II + */ +type ListedGradeII = 'listed.grade.II'; + +/** + * @description Listed Building - Grade II* + */ +type ListedGradeIIStar = 'listed.grade.II*'; + +/** + * @description Locally Listed Building + */ +type LocallyListed = 'locallyListed'; + +/** + * @description Site of a Scheduled Monument + */ +type Monument = 'monument'; + +/** + * @description Ancient Semi-Natural Woodland (ASNW) + */ +type NatureASNW = 'nature.ASNW'; + +/** + * @description Ramsar site + */ +type NatureRamsarSite = 'nature.ramsarSite'; + +/** + * @description Special Area of Conservation (SAC) + */ +type NatureSAC = 'nature.SAC'; + +/** + * @description Special Protection Area (SPA) + */ +type NatureSPA = 'nature.SPA'; + +/** + * @description Site of Special Scientific Interest (SSSI) + */ +type NatureSSSI = 'nature.SSSI'; + +/** + * @description Historic Park or Garden + */ +type RegisteredPark = 'registeredPark'; + +/** + * @description Classified Road + */ +type RoadClassified = 'road.classified'; + +/** + * @description Tree Preservation Order (TPO) or zone + */ +type TPO = 'tpo'; + +type BasePlanningDesignation = + | Article4 + | Article4CAZ + | BrownfieldSite + | Designated + | DesignatedAONB + | DesignatedConservationArea + | DesignatedNationalPark + | DesignatedNationalParkBroads + | DesignatedWHS + | Flood + | FloodZone1 + | FloodZone2 + | FloodZone3 + | GreenBelt + | Listed + | ListedGradeI + | ListedGradeII + | ListedGradeIIStar + | LocallyListed + | Monument + | NatureASNW + | NatureRamsarSite + | NatureSAC + | NatureSPA + | NatureSSSI + | RegisteredPark + | RoadClassified + | TPO; + +/** + * @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;