diff --git a/schemas/prototypeApplication.json b/schemas/prototypeApplication.json index ceec3738..2d33b06a 100644 --- a/schemas/prototypeApplication.json +++ b/schemas/prototypeApplication.json @@ -3,13 +3,13 @@ "$schema": "http://json-schema.org/draft-07/schema#", "anyOf": [ { - "$ref": "#/definitions/PlanningPermissionApplication" + "$ref": "#/definitions/PPApplication" }, { - "$ref": "#/definitions/PriorApprovalApplication" + "$ref": "#/definitions/PAApplication" }, { - "$ref": "#/definitions/WorksToTreesApplications" + "$ref": "#/definitions/WTTApplication" } ], "definitions": { @@ -26,59 +26,20 @@ ], "type": "object" }, - "PPApplicationData": { - "additionalProperties": false, - "description": "Specific ApplicationData required for \"Planning Permission\" applications", - "properties": { - "ppSpecificProperty": { - "type": "number" - }, - "somethingShared": { - "type": "string" - } - }, - "required": [ - "ppSpecificProperty", - "somethingShared" - ], - "type": "object" - }, - "PPUser": { - "additionalProperties": false, - "properties": { - "ppSpecificProperty": { - "type": "boolean" - }, - "role": { - "enum": [ - "applicant", - "agent", - "proxy" - ], - "type": "string" - } - }, - "required": [ - "ppSpecificProperty", - "role" - ], - "type": "object" - }, - "PlanningPermissionApplication": { + "PAApplication": { "additionalProperties": false, "properties": { "applicationType": { - "const": "pp", - "type": "string" + "$ref": "#/definitions/PAApplicationType" }, "data": { "additionalProperties": false, "properties": { "application": { - "$ref": "#/definitions/PPApplicationData" + "$ref": "#/definitions/ApplicationDataBase" }, "user": { - "$ref": "#/definitions/PPUser" + "$ref": "#/definitions/UserBase" } }, "required": [ @@ -94,21 +55,234 @@ ], "type": "object" }, - "PriorApprovalApplication": { + "PAApplicationType": { + "anyOf": [ + { + "const": "pa", + "description": "Prior Approval", + "type": "string" + }, + { + "const": "pa.part1.classA", + "description": "Prior Approval - Larger extension to a house", + "type": "string" + }, + { + "const": "pa.part1.classAA", + "description": "Prior Approval - Adding storeys to a house", + "type": "string" + }, + { + "const": "pa.part3.classG", + "description": "Prior Approval - Convert a commercial building to mixed use", + "type": "string" + }, + { + "const": "pa.part3.classM", + "description": "Prior Approval - Convert a mixed use building into a home", + "type": "string" + }, + { + "const": "pa.part3.classMA", + "description": "Prior Approval - Convert a commercial building into a home or homes", + "type": "string" + }, + { + "const": "pa.part3.classN", + "description": "Prior Approval - Convert a casino or amusement arcade into a home or homes", + "type": "string" + }, + { + "const": "pa.part3.classQ", + "description": "Prior Approval - Convert an agricultural building into a home", + "type": "string" + }, + { + "const": "pa.part3.classR", + "description": "Prior Approval - Convert an agricultural building to a commercial use", + "type": "string" + }, + { + "const": "pa.part3.classS", + "description": "Prior Approval - Convert an agricultural building to a school", + "type": "string" + }, + { + "const": "pa.part3.classT", + "description": "Prior Approval - Convert a commercial building to a school", + "type": "string" + }, + { + "const": "pa.part3.classV", + "description": "Prior Approval - Changes of use permitted under a permission granted on an application", + "type": "string" + }, + { + "const": "pa.part4.classBB", + "description": "Prior Approval - Put up a temporary structure", + "type": "string" + }, + { + "const": "pa.part4.classBC", + "description": "Prior Approval - Develop a temporary campsite", + "type": "string" + }, + { + "const": "pa.part4.classCA", + "description": "Prior Approval - Put temporary school buildings on vacant commercial land", + "type": "string" + }, + { + "const": "pa.part4.classE", + "description": "Prior Approval - Use a building or land to shoot a film", + "type": "string" + }, + { + "const": "pa.part6", + "description": "Prior Approval - Alter or add new buildings to agricultural or forestry sites", + "type": "string" + }, + { + "const": "pa.part6.classA", + "description": "Prior Approval - Build new agricultural buildings on a unit of 5 hectares or more", + "type": "string" + }, + { + "const": "pa.part6.classB", + "description": "Prior Approval - Build new agricultural buildings on a unit of less than 5 hectares", + "type": "string" + }, + { + "const": "pa.part6.classE", + "description": "Prior Approval - Build new forestry buildings", + "type": "string" + }, + { + "const": "pa.part7.classC", + "description": "Prior Approval - Install click and collect facilities", + "type": "string" + }, + { + "const": "pa.part7.classM", + "description": "Prior Approval - Extend a school, college, university, prison or hospital", + "type": "string" + }, + { + "const": "pa.part9.classD", + "description": "Prior Approval - Development of toll facilities", + "type": "string" + }, + { + "const": "pa.part11.classB", + "description": "Prior Approval - Demolish a building", + "type": "string" + }, + { + "const": "pa.part14.classA", + "description": "Prior Approval - Install or change solar equipment on domestic premises", + "type": "string" + }, + { + "const": "pa.part14.classB", + "description": "Prior Approval - Install or change stand-alone solar equipment on domestic premises", + "type": "string" + }, + { + "const": "pa.part14.classJ", + "description": "Prior Approval - Install or change solar panels", + "type": "string" + }, + { + "const": "pa.part14.classK", + "description": "Prior Approval - Install or change stand-alone solar equipment on non-domestic premises", + "type": "string" + }, + { + "const": "pa.part14.classOA", + "description": "Prior Approval - Installation of a solar canopy on non-domestic, off-street parking", + "type": "string" + }, + { + "const": "pa.part16.classA", + "description": "Prior Approval - Install telecommunications equipment", + "type": "string" + }, + { + "const": "pa.part17", + "description": "Prior Approval - Coal mining", + "type": "string" + }, + { + "const": "pa.part17.classB", + "description": "Prior Approval - Other developments ancillary to mining operations", + "type": "string" + }, + { + "const": "pa.part17.classC", + "description": "Prior Approval - Developments for maintenance or safety", + "type": "string" + }, + { + "const": "pa.part17.classG", + "description": "Prior Approval - Coal mining development by the Coal Authority for maintenance or safety", + "type": "string" + }, + { + "const": "pa.part18.classA", + "description": "Prior Approval - Development under private acts or orders", + "type": "string" + }, + { + "const": "pa.part19.classTA", + "description": "Prior Approval - Development on a closed defence site", + "type": "string" + }, + { + "const": "pa.part20.classA", + "description": "Prior Approval - Build homes on a detached blocks of flats", + "type": "string" + }, + { + "const": "pa.part20.classAA", + "description": "Prior Approval - Build homes on a detached commercial building", + "type": "string" + }, + { + "const": "pa.part20.classAB", + "description": "Prior Approval - Build homes on an adjoining commercial or mixed use building", + "type": "string" + }, + { + "const": "pa.part20.classAC", + "description": "Prior Approval - Build homes on adjoining houses", + "type": "string" + }, + { + "const": "pa.part20.classAD", + "description": "Prior Approval - Build homes on detached houses", + "type": "string" + }, + { + "const": "pa.part20.classZA", + "description": "Prior Approval - Demolish buildings and build homes in their place", + "type": "string" + } + ] + }, + "PPApplication": { "additionalProperties": false, "properties": { "applicationType": { - "const": "pa", - "type": "string" + "$ref": "#/definitions/PPApplicationType" }, "data": { "additionalProperties": false, "properties": { "application": { - "$ref": "#/definitions/ApplicationDataBase" + "$ref": "#/definitions/PPApplicationData" }, "user": { - "$ref": "#/definitions/UserBase" + "$ref": "#/definitions/PPUser" } }, "required": [ @@ -124,41 +298,189 @@ ], "type": "object" }, - "UserBase": { + "PPApplicationData": { "additionalProperties": false, + "description": "Specific ApplicationData required for \"Planning Permission\" applications", "properties": { - "role": { - "enum": [ - "applicant", - "agent", - "proxy" - ], + "ppSpecificProperty": { + "type": "number" + }, + "somethingShared": { "type": "string" } }, "required": [ - "role" + "ppSpecificProperty", + "somethingShared" ], "type": "object" }, - "WTTApplicationData": { + "PPApplicationType": { + "anyOf": [ + { + "const": "pp", + "description": "Planning Permission", + "type": "string" + }, + { + "const": "pp.full", + "description": "Planning Permission for development, including all householder, minor, and major applications", + "type": "string" + }, + { + "const": "pp.full.advertConsent", + "description": "Full Planning Permission and consent to display an advert", + "type": "string" + }, + { + "const": "pp.full.demolition", + "description": "Full Planning Permission including demolition in a Conservation Area", + "type": "string" + }, + { + "const": "pp.full.fastTrack.affordable", + "description": "Full Planning Permission - Fast track for the purposes of Affordable Housing", + "type": "string" + }, + { + "const": "pp.full.householder", + "description": "Planning Permission - Full householder", + "type": "string" + }, + { + "const": "pp.full.householder.listed", + "description": "Planning Permission - Full householder with consent to do works to a Listed Building", + "type": "string" + }, + { + "const": "pp.full.householder.retro", + "description": "Planning Permission - Full householder retrospective", + "type": "string" + }, + { + "const": "pp.full.major", + "description": "Planning Permission - Major application", + "type": "string" + }, + { + "const": "pp.full.major.technicalDetails", + "description": "Planning Permission - Technical details consent for major development", + "type": "string" + }, + { + "const": "pp.full.major.technicalDetails.waste", + "description": "Planning Permission - Technical details consent for waste development", + "type": "string" + }, + { + "const": "pp.full.major.waste", + "description": "Planning Permission - Full planning permission for waste development", + "type": "string" + }, + { + "const": "pp.full.minor", + "description": "Planning Permission - Minor application", + "type": "string" + }, + { + "const": "pp.full.minor.listed", + "description": "Planning Permission - Minor application and consent to do works to a Listed Building", + "type": "string" + }, + { + "const": "pp.full.minor.technicalDetails", + "description": "Planning Permission - Technical details consent for minor development", + "type": "string" + }, + { + "const": "pp.mineralExtraction", + "description": "Planning Permission - Consent to extract minerals and related development, such as temporary buildings and roads", + "type": "string" + }, + { + "const": "pp.outline", + "description": "Planning permission - Outline for proposed development", + "type": "string" + }, + { + "const": "pp.outline.all", + "description": "Outline Planning Permission - Consent for the principle of a project witholding all details", + "type": "string" + }, + { + "const": "pp.outline.some", + "description": "Outline Planning Permission - Consent for the principle of a project specifying some details", + "type": "string" + }, + { + "const": "pp.outline.minor", + "description": "Planning permission - Outline for proposed development (minor)", + "type": "string" + }, + { + "const": "pp.outline.minor.all", + "description": "Outline Planning Permission - Consent for the principle of a project witholding all details (minor)", + "type": "string" + }, + { + "const": "pp.outline.minor.some", + "description": "Outline Planning Permission - Consent for the principle of a project specifying some details (minor)", + "type": "string" + }, + { + "const": "pp.outline.major", + "description": "Planning permission - Outline for proposed development (major)", + "type": "string" + }, + { + "const": "pp.outline.major.all", + "description": "Outline Planning Permission - Consent for the principle of a project witholding all details (major)", + "type": "string" + }, + { + "const": "pp.outline.major.all.waste", + "description": "Outline Planning Permission - Consent for the principle of waste development witholding all details", + "type": "string" + }, + { + "const": "pp.outline.major.some", + "description": "Outline Planning Permission - Consent for the principle of a project specifying some details (major)", + "type": "string" + }, + { + "const": "pp.outline.major.some.waste", + "description": "Outline Planning Permission - Consent for the principle of waste development witholding all details", + "type": "string" + }, + { + "const": "pp.pip", + "description": "Planning Permission in Principle - Consent for the principle of a project with less than 1000 square metres floor area on a site of less than 1 hectare", + "type": "string" + } + ] + }, + "PPUser": { "additionalProperties": false, - "description": "Specific ApplicationData required for \"Works to trees\" applications", "properties": { - "somethingShared": { - "type": "string" + "ppSpecificProperty": { + "type": "boolean" }, - "wttSpecificProperty": { - "type": "number" + "role": { + "enum": [ + "applicant", + "agent", + "proxy" + ], + "type": "string" } }, "required": [ - "somethingShared", - "wttSpecificProperty" + "ppSpecificProperty", + "role" ], "type": "object" }, - "WTTUser": { + "UserBase": { "additionalProperties": false, "properties": { "role": { @@ -168,27 +490,18 @@ "proxy" ], "type": "string" - }, - "wttSpecificProperty": { - "type": "boolean" } }, "required": [ - "role", - "wttSpecificProperty" + "role" ], "type": "object" }, - "WorksToTreesApplications": { + "WTTApplication": { "additionalProperties": false, "properties": { "applicationType": { - "enum": [ - "wtt", - "wtt.consent", - "wtt.notice" - ], - "type": "string" + "$ref": "#/definitions/WTTApplicationType" }, "data": { "additionalProperties": false, @@ -212,6 +525,63 @@ "data" ], "type": "object" + }, + "WTTApplicationData": { + "additionalProperties": false, + "description": "Specific ApplicationData required for \"Works to trees\" applications", + "properties": { + "somethingShared": { + "type": "string" + }, + "wttSpecificProperty": { + "type": "number" + } + }, + "required": [ + "somethingShared", + "wttSpecificProperty" + ], + "type": "object" + }, + "WTTApplicationType": { + "anyOf": [ + { + "const": "wtt", + "description": "Works to trees", + "type": "string" + }, + { + "const": "wtt.consent", + "description": "Consent to carry out works to a tree with a Tree Preservation Order", + "type": "string" + }, + { + "const": "wtt.notice", + "description": "Notification of proposed works to a tree in a Conservation Area", + "type": "string" + } + ] + }, + "WTTUser": { + "additionalProperties": false, + "properties": { + "role": { + "enum": [ + "applicant", + "agent", + "proxy" + ], + "type": "string" + }, + "wttSpecificProperty": { + "type": "boolean" + } + }, + "required": [ + "role", + "wttSpecificProperty" + ], + "type": "object" } }, "description": "The root specification for a planning application in England generated by a digital planning service (prototype)", diff --git a/types/schemas/application/enums/ApplicationTypes.ts b/types/schemas/application/enums/ApplicationTypes.ts index 2de754ec..612da11b 100644 --- a/types/schemas/application/enums/ApplicationTypes.ts +++ b/types/schemas/application/enums/ApplicationTypes.ts @@ -180,10 +180,6 @@ type GenericApplicationType = { description: (typeof ApplicationTypes)[TKey]; }; -type ExtractPrimaryKeys = T extends `${infer K}.${string}` ? K : T; - -export type PrimaryApplicationType = ExtractPrimaryKeys; - type ApplicationTypeMap = { [K in ApplicationTypeKeys]: GenericApplicationType; }; diff --git a/types/schemas/prototypeApplication/ApplicationData.ts b/types/schemas/prototypeApplication/data/ApplicationData.ts similarity index 93% rename from types/schemas/prototypeApplication/ApplicationData.ts rename to types/schemas/prototypeApplication/data/ApplicationData.ts index bd1eac9a..ead5bf82 100644 --- a/types/schemas/prototypeApplication/ApplicationData.ts +++ b/types/schemas/prototypeApplication/data/ApplicationData.ts @@ -1,4 +1,4 @@ -import {PrimaryApplicationType} from '../application/enums/ApplicationTypes'; +import {PrimaryApplicationType} from '../enums/ApplicationType'; /** * Base type for ApplicationData. Contains all shared properties across all application types diff --git a/types/schemas/prototypeApplication/User.ts b/types/schemas/prototypeApplication/data/User.ts similarity index 88% rename from types/schemas/prototypeApplication/User.ts rename to types/schemas/prototypeApplication/data/User.ts index da248014..681ee1f7 100644 --- a/types/schemas/prototypeApplication/User.ts +++ b/types/schemas/prototypeApplication/data/User.ts @@ -1,4 +1,4 @@ -import {PrimaryApplicationType} from '../application/enums/ApplicationTypes'; +import {PrimaryApplicationType} from '../enums/ApplicationType'; export interface UserBase { role: 'applicant' | 'agent' | 'proxy'; diff --git a/types/schemas/prototypeApplication/enums/ApplicationType.ts b/types/schemas/prototypeApplication/enums/ApplicationType.ts new file mode 100644 index 00000000..9c6036fa --- /dev/null +++ b/types/schemas/prototypeApplication/enums/ApplicationType.ts @@ -0,0 +1,673 @@ +/** + * @description Consent to display an advertisement + */ +export type AdvertConsentApplicationType = 'advertConsent'; + +/** + * @description Consent to make small changes to a project with Planning Permission + */ +type Amendment = 'amendment'; + +/** + * @description Consent to make small (minor material) changes to a project with Planning Permission + */ +type AmendmentMinorMaterial = 'amendment.minorMaterial'; + +/** + * @description Consent to make small (non-material) changes to a project with Planning Permission + */ +type AmendmentNonMaterial = 'amendment.nonMaterial'; + +export type AmendmentApplicationType = + | Amendment + | AmendmentMinorMaterial + | AmendmentNonMaterial; + +/** + * @description Planning approval + */ +type Approval = 'approval'; + +/** + * @description Approval of details reserved by condition + */ +type ApprovalConditions = 'approval.conditions'; + +/** + * @description Approval of reserved matters + */ +type ApprovalReservedMatters = 'approval.reservedMatters'; + +export type ApprovalApplicationType = + | Approval + | ApprovalConditions + | ApprovalReservedMatters; + +/** + * @description Written confirmation of compliance with a planning condition + */ +export type ComplianceConfirmationApplicationType = 'complianceConfirmation'; + +/** + * @description Environmental Impact Decision + */ +type EnvironmentalImpact = 'environmentalImpact'; + +/** + * @description Environmental Impact Decision - Scoping + */ +type EnvironmentalImpactScoping = 'environmentalImpact.scoping'; + +/** + * @description Environmental Impact Decision - Screening + */ +type EnvironmentalImpactScreening = 'environmentalImpact.screening'; + +export type EnvironmentalImpactApplicationType = + | EnvironmentalImpact + | EnvironmentalImpactScoping + | EnvironmentalImpactScreening; + +/** + * @description Consent to move and dispose of hazardous substances + */ +export type HazardousSubstanceConsentApplicationType = + 'hazardousSubstanceConsent'; + +/** + * @description Notice to remove a hedge + */ +export type HedgerowRemovalNoticeApplicationType = 'hedgerowRemovalNotice'; + +/** + * @description Consent to do works affecting ordinary watercourses or land drainage + */ +export type LandDrainageConsentApplicationType = 'landDrainageConsent'; + +/** + * @description Lawful Development Certificate + */ +type LDC = 'ldc'; + +/** + * @description Lawful Development Certificate - Existing use lawful not to comply with a condition (S191C) + */ +type LDCBreachOfCondition = 'ldc.breachOfCondition'; + +/** + * @description Lawful Development Certificate - Existing use + */ +type LDCExisting = 'ldc.existing'; + +/** + * @description Lawful Development Certificate - Works to a Listed Building (S26H) + */ +type LDCListedBuildingWorks = 'ldc.listedBuildingWorks'; + +/** + * @description Lawful Development Certificate - Proposed use + */ +type LDCProposed = 'ldc.proposed'; + +export type LDCApplicationType = + | LDC + | LDCBreachOfCondition + | LDCExisting + | LDCListedBuildingWorks + | LDCProposed; + +/** + * @description Consent to do works to a Listed Building + */ +export type ListedApplicationType = 'listed'; + +/** + * @description Notification of completion + */ +export type NotifyCompletionApplicationType = 'notifyCompletion'; + +/** + * @description Planning obligation + */ +type Obligation = 'obligation'; + +/** + * @description Discharge a planning obligation + */ +type ObligationDischarge = 'obligation.discharge'; + +/** + * @description Modify a planning obligation + */ +type ObligationModify = 'obligation.modify'; + +export type ObligationApplicationType = + | Obligation + | ObligationDischarge + | ObligationModify; + +/** + * @description Onshore extraction of oil and gas + */ +type OnshoreExtractionOilAndGas = 'onshoreExtractionOilAndGas'; + +/** + * @description Onshore extraction of oil and gas - Other + */ +type OnshoreExtractionOilAndGasOther = 'onshoreExtractionOilAndGas.other'; + +/** + * @description Onshore extraction of oil and gas - Full planning permission for an extension to an existing site including associated development + */ +type OnshoreExtractionOilAndGasPPExtension = + 'onshoreExtractionOilAndGas.pp.extension'; + +/** + * @description Onshore extraction of oil and gas - Full planning permission for waste development + */ +type OnshoreExtractionOilAndGasPPWaste = 'onshoreExtractionOilAndGas.pp.waste'; + +/** + * @description Onshore extraction of oil and gas - Full planning permission for oil and gas working including exploratory, appraisal and production phases + */ +type OnshoreExtractionOilAndGasPPWorking = + 'onshoreExtractionOilAndGas.pp.working'; + +/** + * @description Onshore extraction of oil and gas - Review of conditions applying to Mineral Permissions (ROMPs) + */ +type OnshoreExtractionOilAndGasReview = 'onshoreExtractionOilAndGas.review'; + +/** + * @description Onshore extraction of oil and gas - Variation of conditions + */ +type OnshoreExtractionOilAndGasVariation = + 'onshoreExtractionOilAndGas.variation'; + +export type OnshoreExtractionOilAndGasApplicationType = + | OnshoreExtractionOilAndGas + | OnshoreExtractionOilAndGasOther + | OnshoreExtractionOilAndGasPPExtension + | OnshoreExtractionOilAndGasPPWaste + | OnshoreExtractionOilAndGasPPWorking + | OnshoreExtractionOilAndGasReview + | OnshoreExtractionOilAndGasVariation; + +/** + * @description Prior Approval + */ +type PA = 'pa'; + +/** + * @description Prior Approval - Larger extension to a house + */ +type PAPart1ClassA = 'pa.part1.classA'; + +/** + * @description Prior Approval - Adding storeys to a house + */ +type PAPart1ClassAA = 'pa.part1.classAA'; + +/** + * @description Prior Approval - Convert a commercial building to mixed use + */ +type PAPart3ClassG = 'pa.part3.classG'; + +/** + * @description Prior Approval - Convert a mixed use building into a home + */ +type PAPart3ClassM = 'pa.part3.classM'; + +/** + * @description Prior Approval - Convert a commercial building into a home or homes + */ +type PAPart3ClassMA = 'pa.part3.classMA'; + +/** + * @description Prior Approval - Convert a casino or amusement arcade into a home or homes + */ +type PAPart3ClassN = 'pa.part3.classN'; + +/** + * @description Prior Approval - Convert an agricultural building into a home + */ +type PAPart3ClassQ = 'pa.part3.classQ'; + +/** + * @description Prior Approval - Convert an agricultural building to a commercial use + */ +type PAPart3ClassR = 'pa.part3.classR'; + +/** + * @description Prior Approval - Convert an agricultural building to a school + */ +type PAPart3ClassS = 'pa.part3.classS'; + +/** + * @description Prior Approval - Convert a commercial building to a school + */ +type PAPart3ClassT = 'pa.part3.classT'; + +/** + * @description Prior Approval - Changes of use permitted under a permission granted on an application + */ +type PAPart3ClassV = 'pa.part3.classV'; + +/** + * @description Prior Approval - Put up a temporary structure + */ +type PAPart4ClassBB = 'pa.part4.classBB'; + +/** + * @description Prior Approval - Develop a temporary campsite + */ +type PAPart4ClassBC = 'pa.part4.classBC'; + +/** + * @description Prior Approval - Put temporary school buildings on vacant commercial land + */ +type PAPart4ClassCA = 'pa.part4.classCA'; + +/** + * @description Prior Approval - Use a building or land to shoot a film + */ +type PAPart4ClassE = 'pa.part4.classE'; + +/** + * @description Prior Approval - Alter or add new buildings to agricultural or forestry sites + */ +type PAPart6 = 'pa.part6'; + +/** + * @description Prior Approval - Build new agricultural buildings on a unit of 5 hectares or more + */ +type PAPart6ClassA = 'pa.part6.classA'; + +/** + * @description Prior Approval - Build new agricultural buildings on a unit of less than 5 hectares + */ +type PAPart6ClassB = 'pa.part6.classB'; + +/** + * @description Prior Approval - Build new forestry buildings + */ +type PAPart6ClassE = 'pa.part6.classE'; + +/** + * @description Prior Approval - Install click and collect facilities + */ +type PAPart7ClassC = 'pa.part7.classC'; + +/** + * @description Prior Approval - Extend a school, college, university, prison or hospital + */ +type PAPart7ClassM = 'pa.part7.classM'; + +/** + * @description Prior Approval - Development of toll facilities + */ +type PAPart9ClassD = 'pa.part9.classD'; + +/** + * @description Prior Approval - Demolish a building + */ +type PAPart11ClassB = 'pa.part11.classB'; + +/** + * @description Prior Approval - Install or change solar equipment on domestic premises + */ +type PAPart14ClassA = 'pa.part14.classA'; + +/** + * @description Prior Approval - Install or change stand-alone solar equipment on domestic premises + */ +type PAPart14ClassB = 'pa.part14.classB'; + +/** + * @description Prior Approval - Install or change solar panels + */ +type PAPart14ClassJ = 'pa.part14.classJ'; + +/** + * @description Prior Approval - Install or change stand-alone solar equipment on non-domestic premises + */ +type PAPart14ClassK = 'pa.part14.classK'; + +/** + * @description Prior Approval - Installation of a solar canopy on non-domestic, off-street parking + */ +type PAPart14ClassOA = 'pa.part14.classOA'; + +/** + * @description Prior Approval - Install telecommunications equipment + */ +type PAPart16ClassA = 'pa.part16.classA'; + +/** + * @description Prior Approval - Coal mining + */ +type PAPart17 = 'pa.part17'; + +/** + * @description Prior Approval - Other developments ancillary to mining operations + */ +type PAPart17ClassB = 'pa.part17.classB'; + +/** + * @description Prior Approval - Developments for maintenance or safety + */ +type PAPart17ClassC = 'pa.part17.classC'; + +/** + * @description Prior Approval - Coal mining development by the Coal Authority for maintenance or safety + */ +type PAPart17ClassG = 'pa.part17.classG'; + +/** + * @description Prior Approval - Development under private acts or orders + */ +type PAPart18ClassA = 'pa.part18.classA'; + +/** + * @description Prior Approval - Development on a closed defence site + */ +type PAPart19ClassTA = 'pa.part19.classTA'; + +/** + * @description Prior Approval - Build homes on a detached blocks of flats + */ +type PAPart20ClassA = 'pa.part20.classA'; + +/** + * @description Prior Approval - Build homes on a detached commercial building + */ +type PAPart20ClassAA = 'pa.part20.classAA'; + +/** + * @description Prior Approval - Build homes on an adjoining commercial or mixed use building + */ +type PAPart20ClassAB = 'pa.part20.classAB'; + +/** + * @description Prior Approval - Build homes on adjoining houses + */ +type PAPart20ClassAC = 'pa.part20.classAC'; + +/** + * @description Prior Approval - Build homes on detached houses + */ +type PAPart20ClassAD = 'pa.part20.classAD'; + +/** + * @description Prior Approval - Demolish buildings and build homes in their place + */ +type PAPart20ClassZA = 'pa.part20.classZA'; + +export type PAApplicationType = + | PA + | PAPart1ClassA + | PAPart1ClassAA + | PAPart3ClassG + | PAPart3ClassM + | PAPart3ClassMA + | PAPart3ClassN + | PAPart3ClassQ + | PAPart3ClassR + | PAPart3ClassS + | PAPart3ClassT + | PAPart3ClassV + | PAPart4ClassBB + | PAPart4ClassBC + | PAPart4ClassCA + | PAPart4ClassE + | PAPart6 + | PAPart6ClassA + | PAPart6ClassB + | PAPart6ClassE + | PAPart7ClassC + | PAPart7ClassM + | PAPart9ClassD + | PAPart11ClassB + | PAPart14ClassA + | PAPart14ClassB + | PAPart14ClassJ + | PAPart14ClassK + | PAPart14ClassOA + | PAPart16ClassA + | PAPart17 + | PAPart17ClassB + | PAPart17ClassC + | PAPart17ClassG + | PAPart18ClassA + | PAPart19ClassTA + | PAPart20ClassA + | PAPart20ClassAA + | PAPart20ClassAB + | PAPart20ClassAC + | PAPart20ClassAD + | PAPart20ClassZA; + +/** + * @description Planning Permission + */ +type PP = 'pp'; + +/** + * @description Planning Permission for development, including all householder, minor, and major applications + */ +type PPFull = 'pp.full'; + +/** + * @description Full Planning Permission and consent to display an advert + */ +type PPFullAdvertConsent = 'pp.full.advertConsent'; + +/** + * @description Full Planning Permission including demolition in a Conservation Area + */ +type PPFullDemolition = 'pp.full.demolition'; + +/** + * @description Full Planning Permission - Fast track for the purposes of Affordable Housing + */ +type PPFullFastTrackAffordable = 'pp.full.fastTrack.affordable'; + +/** + * @description Planning Permission - Full householder + */ +type PPFullHouseholder = 'pp.full.householder'; + +/** + * @description Planning Permission - Full householder with consent to do works to a Listed Building + */ +type PPFullHouseholderListed = 'pp.full.householder.listed'; + +/** + * @description Planning Permission - Full householder retrospective + */ +type PPFullHouseholderRetro = 'pp.full.householder.retro'; + +/** + * @description Planning Permission - Major application + */ +type PPFullMajor = 'pp.full.major'; + +/** + * @description Planning Permission - Technical details consent for major development + */ +type PPFullMajorTechnicalDetails = 'pp.full.major.technicalDetails'; + +/** + * @description Planning Permission - Technical details consent for waste development + */ +type PPFullMajorTechnicalDetailsWaste = 'pp.full.major.technicalDetails.waste'; + +/** + * @description Planning Permission - Full planning permission for waste development + */ +type PPFullMajorWaste = 'pp.full.major.waste'; + +/** + * @description Planning Permission - Minor application + */ +type PPFullMinor = 'pp.full.minor'; + +/** + * @description Planning Permission - Minor application and consent to do works to a Listed Building + */ +type PPFullMinorListed = 'pp.full.minor.listed'; + +/** + * @description Planning Permission - Technical details consent for minor development + */ +type PPFullMinorTechnicalDetails = 'pp.full.minor.technicalDetails'; + +/** + * @description Planning Permission - Consent to extract minerals and related development, such as temporary buildings and roads + */ +type PPMineralExtraction = 'pp.mineralExtraction'; + +/** + * @description Planning permission - Outline for proposed development + */ +type PPOutline = 'pp.outline'; + +/** + * @description Outline Planning Permission - Consent for the principle of a project witholding all details + */ +type PPOutlineAll = 'pp.outline.all'; + +/** + * @description Outline Planning Permission - Consent for the principle of a project specifying some details + */ +type PPOutlineSome = 'pp.outline.some'; + +/** + * @description Planning permission - Outline for proposed development (minor) + */ +type PPOutlineMinor = 'pp.outline.minor'; + +/** + * @description Outline Planning Permission - Consent for the principle of a project witholding all details (minor) + */ +type PPOutlineMinorAll = 'pp.outline.minor.all'; + +/** + * @description Outline Planning Permission - Consent for the principle of a project specifying some details (minor) + */ +type PPOutlineMinorSome = 'pp.outline.minor.some'; + +/** + * @description Planning permission - Outline for proposed development (major) + */ +type PPOutlineMajor = 'pp.outline.major'; + +/** + * @description Outline Planning Permission - Consent for the principle of a project witholding all details (major) + */ +type PPOutlineMajorAll = 'pp.outline.major.all'; + +/** + * @description Outline Planning Permission - Consent for the principle of waste development witholding all details + */ +type PPOutlineMajorAllWaste = 'pp.outline.major.all.waste'; + +/** + * @description Outline Planning Permission - Consent for the principle of a project specifying some details (major) + */ +type PPOutlineMajorSome = 'pp.outline.major.some'; + +/** + * @description Outline Planning Permission - Consent for the principle of waste development witholding all details + */ +type PPOutlineMajorSomeWaste = 'pp.outline.major.some.waste'; + +/** + * @description Planning Permission in Principle - Consent for the principle of a project with less than 1000 square metres floor area on a site of less than 1 hectare + */ +type PPPip = 'pp.pip'; + +export type PPApplicationType = + | PP + | PPFull + | PPFullAdvertConsent + | PPFullDemolition + | PPFullFastTrackAffordable + | PPFullHouseholder + | PPFullHouseholderListed + | PPFullHouseholderRetro + | PPFullMajor + | PPFullMajorTechnicalDetails + | PPFullMajorTechnicalDetailsWaste + | PPFullMajorWaste + | PPFullMinor + | PPFullMinorListed + | PPFullMinorTechnicalDetails + | PPMineralExtraction + | PPOutline + | PPOutlineAll + | PPOutlineSome + | PPOutlineMinor + | PPOutlineMinorAll + | PPOutlineMinorSome + | PPOutlineMajor + | PPOutlineMajorAll + | PPOutlineMajorAllWaste + | PPOutlineMajorSome + | PPOutlineMajorSomeWaste + | PPPip; + +/** + * @description Rights of Way Order - Apply to move or close a path + */ +export type RightsOfWayOrderApplicationType = 'rightsOfWayOrder'; + +/** + * @description Works to trees + */ +type WTT = 'wtt'; + +/** + * @description Consent to carry out works to a tree with a Tree Preservation Order + */ +type WTTConstent = 'wtt.consent'; + +/** + * @description Notification of proposed works to a tree in a Conservation Area + */ +type WTTNotice = 'wtt.notice'; + +export type WTTApplicationType = WTT | WTTConstent | WTTNotice; + +/** + * @id #ApplicationType + * @description Planning application types + */ +export type ApplicationType = + | AdvertConsentApplicationType + | AmendmentApplicationType + | ApprovalApplicationType + | ComplianceConfirmationApplicationType + | EnvironmentalImpactApplicationType + | HazardousSubstanceConsentApplicationType + | HedgerowRemovalNoticeApplicationType + | LandDrainageConsentApplicationType + | LDCApplicationType + | ListedApplicationType + | NotifyCompletionApplicationType + | ObligationApplicationType + | OnshoreExtractionOilAndGasApplicationType + | PAApplicationType + | PPApplicationType + | RightsOfWayOrderApplicationType + | WTTApplicationType; + +/** + * @internal + */ +type ExtractPrimaryKeys = T extends `${infer K}.${string}` ? K : T; + +/** + * @internal + */ +export type PrimaryApplicationType = ExtractPrimaryKeys; diff --git a/types/schemas/prototypeApplication/index.ts b/types/schemas/prototypeApplication/index.ts index 065254e4..3db357bc 100644 --- a/types/schemas/prototypeApplication/index.ts +++ b/types/schemas/prototypeApplication/index.ts @@ -1,9 +1,12 @@ +import {ApplicationData} from './data/ApplicationData'; +import {User} from './data/User'; import { - ApplicationTypeKeys, + ApplicationType, + PAApplicationType, + PPApplicationType, PrimaryApplicationType, -} from '../application/enums/ApplicationTypes'; -import {ApplicationData} from './ApplicationData'; -import {User} from './User'; + WTTApplicationType, +} from './enums/ApplicationType'; /** * @internal @@ -13,7 +16,7 @@ import {User} from './User'; */ interface ApplicationSpecification< TPrimary extends PrimaryApplicationType, - TGranular extends ApplicationTypeKeys, + TGranular extends ApplicationType, > { applicationType: TGranular; data: { @@ -22,18 +25,13 @@ interface ApplicationSpecification< }; } -export type PlanningPermissionApplication = ApplicationSpecification< - 'pp', - 'pp' ->; -// TODO: All granular types +export type PPApplication = ApplicationSpecification<'pp', PPApplicationType>; -export type PriorApprovalApplication = ApplicationSpecification<'pa', 'pa'>; -// TODO: All granular types +export type PAApplication = ApplicationSpecification<'pa', PAApplicationType>; -export type WorksToTreesApplications = ApplicationSpecification< +export type WTTApplication = ApplicationSpecification< 'wtt', - Extract + WTTApplicationType >; /** @@ -42,13 +40,13 @@ export type WorksToTreesApplications = ApplicationSpecification< * The root specification for a planning application in England generated by a digital planning service (prototype) */ export type PrototypeApplication = - | PlanningPermissionApplication - | PriorApprovalApplication - | WorksToTreesApplications; + | PPApplication + | PAApplication + | WTTApplication; // TODO: All the rest! // const test: App = { -// applicationType: 'wtt.consent', +// applicationType: 'wtt', // data: { // user: { // role: 'agent',