Skip to content

Commit

Permalink
update region enum
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Oct 25, 2023
1 parent e492828 commit efd0cbb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
18 changes: 17 additions & 1 deletion schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18008,7 +18008,7 @@
"type": "array"
},
"region": {
"type": "string"
"$ref": "#/definitions/UKRegion"
},
"type": {
"$ref": "#/definitions/PropertyType"
Expand All @@ -18022,6 +18022,22 @@
],
"type": "object"
},
"UKRegion": {
"$id": "#UKRegion",
"description": "UK regions sourced from planning.data.gov.uk/dataset/region, where \"London\" is a proxy for the Greater London Authority (GLA) area",
"enum": [
"North East",
"North West",
"Yorkshire and The Humber",
"East Midlands",
"West Midlands",
"East of England",
"London",
"South East",
"South West"
],
"type": "string"
},
"URL": {
"format": "uri",
"pattern": "^https?://",
Expand Down
19 changes: 17 additions & 2 deletions types/schema/data/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,28 @@ import {Area, URL} from '../../utils';
*/
export type Property = UKProperty | LondonProperty;

/**
* @id #UKRegion
* @description UK regions 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: string;
region: UKRegion;
localAuthorityDistrict: string[];
type: PropertyType;
boundary?: {
Expand All @@ -32,7 +47,7 @@ export interface UKProperty {
* @description Property details for sites within the Greater London Authority (GLA) area
*/
export interface LondonProperty extends UKProperty {
region: 'London';
region: Extract<UKRegion, 'London'>;
titleNumber: {
known: 'Yes' | 'No';
number?: string;
Expand Down

0 comments on commit efd0cbb

Please sign in to comment.