Skip to content

Commit

Permalink
feat: Minor Planning Permission example payload (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Jul 3, 2024
1 parent f635944 commit fa321b6
Show file tree
Hide file tree
Showing 9 changed files with 3,487 additions and 126 deletions.
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;
}[];
};
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 fa321b6

Please sign in to comment.