Skip to content

Commit

Permalink
feat: Prior Approval example payloads (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Jul 1, 2024
1 parent 8719b8b commit a759441
Show file tree
Hide file tree
Showing 15 changed files with 12,756 additions and 754 deletions.
1,843 changes: 1,843 additions & 0 deletions examples/data/priorApproval/buildHomes.ts

Large diffs are not rendered by default.

1,592 changes: 1,592 additions & 0 deletions examples/data/priorApproval/convertCommercialToHome.ts

Large diffs are not rendered by default.

1,803 changes: 1,803 additions & 0 deletions examples/data/priorApproval/extendUniversity.ts

Large diffs are not rendered by default.

1,272 changes: 894 additions & 378 deletions examples/data/priorApproval/solarPanels.ts

Large diffs are not rendered by default.

1,910 changes: 1,910 additions & 0 deletions examples/priorApproval/buildHomes.json

Large diffs are not rendered by default.

1,641 changes: 1,641 additions & 0 deletions examples/priorApproval/convertCommercialToHome.json

Large diffs are not rendered by default.

1,820 changes: 1,820 additions & 0 deletions examples/priorApproval/extendUniversity.json

Large diffs are not rendered by default.

1,084 changes: 725 additions & 359 deletions examples/priorApproval/solarPanels.json

Large diffs are not rendered by default.

440 changes: 430 additions & 10 deletions schema/schema.json

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions scripts/build-json-examples.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import * as fs from 'fs';
import * as path from 'path';

import {lawfulDevelopmentCertificateExisting} from '../examples/data/lawfulDevelopmentCertificate/existing';
import {lawfulDevelopmentCertificateProposed} from '../examples/data/lawfulDevelopmentCertificate/proposed';
import {listedBuildingConsent} from '../examples/data/listedBuildingConsent';
import {planningPermissionFullHouseholder} from '../examples/data/planningPermission/fullHouseholder';
import {priorApprovalBuildHomes} from '../examples/data/priorApproval/buildHomes';
import {priorApprovalConvertCommercialToHome} from '../examples/data/priorApproval/convertCommercialToHome';
import {priorApprovalExtendUniversity} from '../examples/data/priorApproval/extendUniversity';
import {priorApprovalSolarPanels} from '../examples/data/priorApproval/solarPanels';
import {Schema} from '../types/Schema';

Expand All @@ -21,10 +25,22 @@ const examplesToConvert: Example[] = [
filename: 'lawfulDevelopmentCertificate/proposed',
data: lawfulDevelopmentCertificateProposed,
},
{
filename: 'priorApproval/extendUniversity',
data: priorApprovalExtendUniversity,
},
{
filename: 'priorApproval/solarPanels',
data: priorApprovalSolarPanels,
},
{
filename: 'priorApproval/buildHomes',
data: priorApprovalBuildHomes,
},
{
filename: 'priorApproval/convertCommercialToHome',
data: priorApprovalConvertCommercialToHome,
},
{
filename: 'planningPermission/fullHouseholder',
data: planningPermissionFullHouseholder,
Expand Down
6 changes: 6 additions & 0 deletions tests/usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ 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 {priorApprovalBuildHomes} from '../examples/data/priorApproval/buildHomes';
import {priorApprovalConvertCommercialToHome} from '../examples/data/priorApproval/convertCommercialToHome';
import {priorApprovalExtendUniversity} from '../examples/data/priorApproval/extendUniversity';
import {priorApprovalSolarPanels} from '../examples/data/priorApproval/solarPanels';
import generatedSchema from '../schema/schema.json';

Expand All @@ -15,7 +18,10 @@ const examplesToTest = [
lawfulDevelopmentCertificateProposed,
listedBuildingConsent,
planningPermissionFullHouseholder,
priorApprovalExtendUniversity,
priorApprovalSolarPanels,
priorApprovalBuildHomes,
priorApprovalConvertCommercialToHome,
];

describe("parsing using the 'jsonschema' library", () => {
Expand Down
11 changes: 7 additions & 4 deletions types/enums/ApplicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ export const ApplicationTypes = {
'Prior Approval - Convert a commercial building to a school',
'pa.part3.classV': 'Prior Approval - Part 3 Class V',
'pa.part4.classBB': 'Prior Approval - Put up a temporary structure',
'pa.part4.classBC': 'Prior Approval - Part 4 Class BC',
'pa.part4.classCA': 'Prior Approval - Part 4 Class CA',
'pa.part4.classBC': 'Prior Approval - Develop a temporary campsite',
'pa.part4.classCA':
'Prior Approval - Put temporary school buildings on vacant commercial land',
'pa.part4.classE': 'Prior Approval - Use a building or land to shoot a film',
'pa.part6':
'Prior Approval - Alter or add new buildings to agricultural or forestry sites',
Expand All @@ -58,15 +59,17 @@ export const ApplicationTypes = {
'pa.part7.classC': 'Prior Approval - Install click and collect facilities',
'pa.part7.classM':
'Prior Approval - Extend a school, college, university, prison or hospital',
'pa.part9.classD': 'Prior Approval - Development of toll facilities',
'pa.part11.classB': 'Prior Approval - Demolish a building',
'pa.part14.classJ': 'Prior Approval - Install or change solar panels',
'pa.part16.classA': 'Prior Approval - Install telecommunications equipment',
'pa.part17': 'Prior Approval - Coal mining',
'pa.part17.classB': 'Prior Approval - Part 17 Class B',
'pa.part17.classC': 'Prior Approval - Part 17 Class C',
'pa.part17.classG': 'Prior Approval - Part 17 Class G',
'pa.part18.classA':
'Prior Approval - Specific Acts of Parliament or Local Orders',
'pa.part19.classTA': 'Prior Approval - Part 19 Class TA',
'Prior Approval - Development under private acts or orders',
'pa.part19.classTA': 'Prior Approval - Development on a closed defence site',
'pa.part20.classA':
'Prior Approval - Build homes on a detached blocks of flats',
'pa.part20.classAA':
Expand Down
5 changes: 4 additions & 1 deletion types/schema/data/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ export interface CommunityInfrastructureLevy {

export interface LeadDeveloper {
type: 'ukCompany' | 'overseasCompany' | 'none';
companyRegistrationNumber?: string;
company?: {
name: string;
registrationNumber: string;
};
}

type ApplicationTypeKeys = keyof typeof ApplicationTypes;
Expand Down
6 changes: 6 additions & 0 deletions types/schema/data/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ export interface LondonProperty extends UKProperty {
ownership?: {
status: 'public' | 'private' | 'mixed';
};
/**
* @description Current occupation status of the property
*/
occupation?: {
status: 'occupied' | 'partVacant' | 'vacant';
};
parking?: {
cars?: ExistingCount;
vans?: ExistingCount;
Expand Down
61 changes: 59 additions & 2 deletions types/schema/data/Proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,25 @@ export interface BaseProposal {
* @description Proposed utilities, if applicable to application.type
*/
utilities?: {
/** @description Type of proposed foul sewage disposal */
foulSewageDisposal?: 'sewer' | 'tank' | 'plant' | 'pit' | 'other';
/** @description Count of new full fibre Internet connections */
internet?: {
commercialUnits: {count: number};
residentialUnits: {count: number};
};
/** @description Whether the proposal introduces a fire suppression system */
fire?: {
suppression: boolean;
};
/** @description Count of new gas connections */
gas?: {
connections: {count: number};
};
/** @description Count of new water connections */
water?: {
connections: {count: number};
};
};
/**
* @description Assessment of flood risk, if applicable to application.type
Expand Down Expand Up @@ -83,6 +101,9 @@ export interface BaseProposal {
dwellings?: number;
};
};
newDwellings?: {
newBuild?: {count: number};
};
}

/**
Expand Down Expand Up @@ -123,8 +144,8 @@ export interface LondonProposal extends BaseProposal {
* @description Electric vehicle charing points
*/
charging?: {
active: {count: number};
passive: {count: number};
active?: {count: number};
passive?: {count: number};
};
/**
* @description Changes that result in the loss, gain, or change of use of natural spaces
Expand Down Expand Up @@ -167,6 +188,42 @@ export interface LondonProposal extends BaseProposal {
*/
grey: boolean;
};
/**
* @description Proposed energy sources
*/
energy?: {
type: Array<'communityOwned' | 'heatPump' | 'solar'>;
communityOwned?: {
/** @description Proposed total capacity of any on-site community-owned energy generation in megawatts (mW) */
capacity: {megawatts: number};
};
heatPumps?: {
/** @description Proposed total capacity of any heat pumps in megawatts (mV) */
capacity: {megawatts: number};
};
solar?: {
/** @description Proposed total capacity of any solar energy generation in megawatts (mV) */
capacity: {megawatts: number};
};
};
/**
* @description Urban Greening Factor Score
*/
urbanGreeningFactor?: {
score: number;
};
/**
* @description Green roof
*/
greenRoof?: {
area: Area;
};
/**
* @description Waste management of demolition and construction materials
*/
waste?: {
reuseRecycle: {percent: number};
};
}

type ProposedCount = {
Expand Down

0 comments on commit a759441

Please sign in to comment.