Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Minor Planning Permission example payload #193

Merged
merged 4 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,708 changes: 1,708 additions & 0 deletions examples/data/planningPermission/minor.ts

Large diffs are not rendered by default.

1,697 changes: 1,697 additions & 0 deletions examples/planningPermission/minor.json

Large diffs are not rendered by default.

159 changes: 57 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 @@ -3845,6 +3812,24 @@
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"description": {
"const": "Information the authority considers necessary for the application",
"type": "string"
},
"value": {
"const": "necessaryInformation",
"type": "string"
}
},
"required": [
"value",
"description"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -5945,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 @@ -23756,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 @@ -24500,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
5 changes: 5 additions & 0 deletions scripts/build-json-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {priorApprovalConvertCommercialToHome} from '../examples/data/priorApprov
import {priorApprovalExtendUniversity} from '../examples/data/priorApproval/extendUniversity';
import {priorApprovalSolarPanels} from '../examples/data/priorApproval/solarPanels';
import {Schema} from '../types/Schema';
import {planningPermissionMinor} from '../examples/data/planningPermission/minor';

interface Example {
filename: string;
Expand Down Expand Up @@ -45,6 +46,10 @@ const examplesToConvert: Example[] = [
filename: 'planningPermission/fullHouseholder',
data: planningPermissionFullHouseholder,
},
{
filename: 'planningPermission/minor',
data: planningPermissionMinor,
},
{
filename: 'listedBuildingConsent',
data: listedBuildingConsent,
Expand Down
2 changes: 2 additions & 0 deletions tests/usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {lawfulDevelopmentCertificateExisting} from '../examples/data/lawfulDevel
import {lawfulDevelopmentCertificateProposed} from '../examples/data/lawfulDevelopmentCertificate/proposed';
import {listedBuildingConsent} from '../examples/data/listedBuildingConsent';
import {planningPermissionFullHouseholder} from '../examples/data/planningPermission/fullHouseholder';
import {planningPermissionMinor} from '../examples/data/planningPermission/minor';
import {priorApprovalBuildHomes} from '../examples/data/priorApproval/buildHomes';
import {priorApprovalConvertCommercialToHome} from '../examples/data/priorApproval/convertCommercialToHome';
import {priorApprovalExtendUniversity} from '../examples/data/priorApproval/extendUniversity';
Expand All @@ -18,6 +19,7 @@ const examplesToTest = [
lawfulDevelopmentCertificateProposed,
listedBuildingConsent,
planningPermissionFullHouseholder,
planningPermissionMinor,
priorApprovalExtendUniversity,
priorApprovalSolarPanels,
priorApprovalBuildHomes,
Expand Down
2 changes: 2 additions & 0 deletions types/enums/FileTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export const FileTypes = {
'Details of litter, vermin and bird control',
locationPlan: 'Location plan',
mineralsAndWasteAssessment: 'Minerals and waste assessment',
necessaryInformation:
'Information the authority considers necessary for the application',
newDwellingsSchedule: 'New dwellings schedule',
noiseAssessment: 'Noise assessment',
openSpaceAssessment: 'Open space assessment',
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;
}[];
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I incorrectly had development rather than tenure here - which means we can actually share the same "UK Residential Unit" definition between property & proposal - hence moving this definition to shared.ts now.

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;
}[];
};