Skip to content

Commit

Permalink
add proposed residential unit
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Jul 3, 2024
1 parent 5e59d8e commit 0d80aa7
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 126 deletions.
14 changes: 14 additions & 0 deletions examples/data/planningPermission/minor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Schema} from '../../../types/Schema';
import {BaseProposal} from '../../../types/schema/data/Proposal';

const version = process.env['VERSION'] || '@next';

Expand Down Expand Up @@ -267,6 +268,19 @@ export const planningPermissionMinor: Schema = {
materials: {
boundary: 'white painted timber',
},
units: {
residential: [
{
type: {value: 'house', description: 'House'},
tenure: {
value: 'selfCustomBuild',
description: 'Self-build and custom build',
},
bedrooms: 4,
identicalUnits: 1,
},
],
} as BaseProposal['units'],
},
},
responses: [
Expand Down
16 changes: 16 additions & 0 deletions examples/planningPermission/minor.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,22 @@
},
"materials": {
"boundary": "white painted timber"
},
"units": {
"residential": [
{
"type": {
"value": "house",
"description": "House"
},
"tenure": {
"value": "selfCustomBuild",
"description": "Self-build and custom build"
},
"bedrooms": 4,
"identicalUnits": 1
}
]
}
}
},
Expand Down
141 changes: 39 additions & 102 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2240,40 +2240,7 @@
"type": "array"
},
"units": {
"additionalProperties": false,
"properties": {
"residential": {
"items": {
"additionalProperties": false,
"properties": {
"bedrooms": {
"type": "number"
},
"development": {
"$ref": "#/definitions/DevelopmentType"
},
"identicalUnits": {
"type": "number"
},
"type": {
"$ref": "#/definitions/UKResidentialUnitType"
}
},
"required": [
"development",
"type",
"bedrooms",
"identicalUnits"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"residential"
],
"type": "object"
"$ref": "#/definitions/ResidentialUnits"
},
"use": {
"additionalProperties": false,
Expand Down Expand Up @@ -5963,40 +5930,7 @@
"$ref": "#/definitions/PropertyType"
},
"units": {
"additionalProperties": false,
"properties": {
"residential": {
"items": {
"additionalProperties": false,
"properties": {
"bedrooms": {
"type": "number"
},
"identicalUnits": {
"type": "number"
},
"tenure": {
"$ref": "#/definitions/UKTenureType"
},
"type": {
"$ref": "#/definitions/UKResidentialUnitType"
}
},
"required": [
"tenure",
"type",
"bedrooms",
"identicalUnits"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"residential"
],
"type": "object"
"$ref": "#/definitions/ResidentialUnits"
},
"use": {
"additionalProperties": false,
Expand Down Expand Up @@ -23774,6 +23708,42 @@
],
"type": "object"
},
"ResidentialUnits": {
"additionalProperties": false,
"properties": {
"residential": {
"items": {
"additionalProperties": false,
"properties": {
"bedrooms": {
"type": "number"
},
"identicalUnits": {
"type": "number"
},
"tenure": {
"$ref": "#/definitions/UKTenureType"
},
"type": {
"$ref": "#/definitions/UKResidentialUnitType"
}
},
"required": [
"type",
"tenure",
"bedrooms",
"identicalUnits"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"residential"
],
"type": "object"
},
"Response": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -24518,40 +24488,7 @@
"$ref": "#/definitions/PropertyType"
},
"units": {
"additionalProperties": false,
"properties": {
"residential": {
"items": {
"additionalProperties": false,
"properties": {
"bedrooms": {
"type": "number"
},
"identicalUnits": {
"type": "number"
},
"tenure": {
"$ref": "#/definitions/UKTenureType"
},
"type": {
"$ref": "#/definitions/UKResidentialUnitType"
}
},
"required": [
"tenure",
"type",
"bedrooms",
"identicalUnits"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"residential"
],
"type": "object"
"$ref": "#/definitions/ResidentialUnits"
},
"use": {
"additionalProperties": false,
Expand Down
13 changes: 2 additions & 11 deletions types/schema/data/Property.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
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 {Entity, GeoBoundary, Materials, ResidentialUnits} from './shared';

/**
* @id #Property
Expand Down Expand Up @@ -71,14 +69,7 @@ export interface UKProperty {
lastUseEndDate: Date;
};
};
units?: {
residential: {
tenure: UKTenureType;
type: UKResidentialUnitType;
bedrooms: number;
identicalUnits: number;
}[];
};
units?: ResidentialUnits;
}

/**
Expand Down
16 changes: 3 additions & 13 deletions types/schema/data/Proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ import {GLAHousingProvider} from '../../enums/HousingProviders';
import {OpenSpaceDesignation, OpenSpaceType} from '../../enums/OpenSpaces';
import {ProjectType} from '../../enums/ProjectTypes';
import {ProtectedSpaceDesignation} from '../../enums/ProtectedSpaces';
import {
GLAResidentialUnitType,
UKResidentialUnitType,
} from '../../enums/ResidentialUnitTypes';
import {GLAResidentialUnitType} from '../../enums/ResidentialUnitTypes';
import {GLATenureType} from '../../enums/TenureTypes';
import {Area, Date} from '../../utils';
import {GeoBoundary, Materials} from './shared';
import {GeoBoundary, Materials, ResidentialUnits} from './shared';

/**
* @id #Proposal
Expand Down Expand Up @@ -109,14 +106,7 @@ export interface BaseProposal {
newDwellings?: {
newBuild?: {count: number};
};
units?: {
residential: {
development: DevelopmentType;
type: UKResidentialUnitType;
bedrooms: number;
identicalUnits: number;
}[];
};
units?: ResidentialUnits;
}

/**
Expand Down
11 changes: 11 additions & 0 deletions types/schema/data/shared.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {GeoJSON} from 'geojson';
import {UKResidentialUnitType} from '../../enums/ResidentialUnitTypes';
import {UKTenureType} from '../../enums/TenureTypes';
import {Area, URL} from '../../utils';

export type Materials = {
Expand Down Expand Up @@ -31,3 +33,12 @@ type PlanningDataSource = {
type OSRoadsSource = {
text: 'Ordnance Survey MasterMap Highways';
};

export type ResidentialUnits = {
residential: {
type: UKResidentialUnitType;
tenure: UKTenureType;
bedrooms: number;
identicalUnits: number;
}[];
};

0 comments on commit 0d80aa7

Please sign in to comment.