Skip to content

Commit

Permalink
chore: more annotations (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Oct 26, 2023
1 parent 0c498ad commit af70822
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/data/ldcE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const validLDCE: Schema = {
application: {
type: {
value: 'ldc.existing',
description: 'Lawful Development Certificate - Existing',
description: 'Lawful Development Certificate - Existing use',
},
fee: {
calculated: 206,
Expand Down
2 changes: 1 addition & 1 deletion examples/data/ldcP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const validLDCP: Schema = {
application: {
type: {
value: 'ldc.proposed',
description: 'Lawful Development Certificate - Proposed',
description: 'Lawful Development Certificate - Proposed use',
},
fee: {
calculated: 103,
Expand Down
2 changes: 1 addition & 1 deletion examples/validLawfulDevelopmentCertificateExisting.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"application": {
"type": {
"value": "ldc.existing",
"description": "Lawful Development Certificate - Existing"
"description": "Lawful Development Certificate - Existing use"
},
"fee": {
"calculated": 206,
Expand Down
2 changes: 1 addition & 1 deletion examples/validLawfulDevelopmentCertificateProposed.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"application": {
"type": {
"value": "ldc.proposed",
"description": "Lawful Development Certificate - Proposed"
"description": "Lawful Development Certificate - Proposed use"
},
"fee": {
"calculated": 103,
Expand Down
82 changes: 77 additions & 5 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"additionalProperties": false,
"properties": {
"govPay": {
"description": "GOV.UK Pay payment reference number",
"type": "string"
}
},
Expand Down Expand Up @@ -264,7 +265,7 @@
"additionalProperties": false,
"properties": {
"description": {
"const": "Lawful Development Certificate - Proposed",
"const": "Lawful Development Certificate - Proposed use",
"type": "string"
},
"value": {
Expand All @@ -282,7 +283,7 @@
"additionalProperties": false,
"properties": {
"description": {
"const": "Lawful Development Certificate - Existing",
"const": "Lawful Development Certificate - Existing use",
"type": "string"
},
"value": {
Expand All @@ -296,6 +297,42 @@
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"description": {
"const": "Lawful Development Certificate - Continue an existing use",
"type": "string"
},
"value": {
"const": "ldc.existing.regularise",
"type": "string"
}
},
"required": [
"value",
"description"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"description": {
"const": "Lawful Development Certificate - Lawful not to comply with a condition or limitation",
"type": "string"
},
"value": {
"const": "ldc.condition",
"type": "string"
}
},
"required": [
"value",
"description"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -1104,6 +1141,24 @@
"FileType": {
"$id": "#FileType",
"anyOf": [
{
"additionalProperties": false,
"properties": {
"description": {
"const": "Evidence for application fee exemption - disability",
"type": "string"
},
"value": {
"const": "applicant.disability.evidence",
"type": "string"
}
},
"required": [
"value",
"description"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -2539,6 +2594,7 @@
"required": [
"known"
],
"title": "Energy Performance Certificate",
"type": "object"
},
"address": {
Expand Down Expand Up @@ -2583,6 +2639,7 @@
"type": "object"
},
"localAuthorityDistrict": {
"description": "Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district",
"items": {
"type": "string"
},
Expand Down Expand Up @@ -2618,6 +2675,7 @@
"required": [
"EPC",
"address",
"constraints",
"localAuthorityDistrict",
"region",
"titleNumber",
Expand Down Expand Up @@ -2806,9 +2864,11 @@
"description": "Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium",
"properties": {
"latitude": {
"description": "Latitude coordinate in EPSG:4326 (WGS84)",
"type": "number"
},
"longitude": {
"description": "Longitude coordinate in EPSG:4326 (WGS84)",
"type": "number"
},
"organisation": {
Expand Down Expand Up @@ -2837,15 +2897,21 @@
"type": "string"
},
"uprn": {
"maxLength": 12,
"title": "Unique Property Reference Number",
"type": "string"
},
"usrn": {
"maxLength": 8,
"title": "Unique Street Reference Number",
"type": "string"
},
"x": {
"description": "Easting coordinate in British National Grid (OSGB36)",
"type": "number"
},
"y": {
"description": "Northing coordinate in British National Grid (OSGB36)",
"type": "number"
}
},
Expand Down Expand Up @@ -17212,9 +17278,11 @@
"description": "Address information for sites without a known Unique Property Reference Number (UPRN)",
"properties": {
"latitude": {
"description": "Latitude coordinate in EPSG:4326 (WGS84)",
"type": "number"
},
"longitude": {
"description": "Longitude coordinate in EPSG:4326 (WGS84)",
"type": "number"
},
"source": {
Expand All @@ -17225,9 +17293,11 @@
"type": "string"
},
"x": {
"description": "Easting coordinate in British National Grid (OSGB36)",
"type": "number"
},
"y": {
"description": "Northing coordinate in British National Grid (OSGB36)",
"type": "number"
}
},
Expand Down Expand Up @@ -18002,6 +18072,7 @@
"type": "object"
},
"localAuthorityDistrict": {
"description": "Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district",
"items": {
"type": "string"
},
Expand All @@ -18018,13 +18089,14 @@
"address",
"region",
"localAuthorityDistrict",
"type"
"type",
"constraints"
],
"type": "object"
},
"UKRegion": {
"$id": "#UKRegion",
"description": "UK regions sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area",
"description": "The UK region that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area",
"enum": [
"North East",
"North West",
Expand Down Expand Up @@ -18619,7 +18691,7 @@
"description": "Vehicle parking types"
}
},
"description": "The root schema for an application generated by a digital planning service",
"description": "The root specification for a planning application in England generated by a digital planning service",
"properties": {
"data": {
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion types/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {File} from './schema/File';

/**
* @title Digital Planning Application
* @description The root schema for an application generated by a digital planning service
* @description The root specification for a planning application in England generated by a digital planning service
*/
export interface Schema {
data: {
Expand Down
12 changes: 8 additions & 4 deletions types/enums/ApplicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
*/
export const ApplicationTypes = {
ldc: 'Lawful Development Certificate',
'ldc.proposed': 'Lawful Development Certificate - Proposed',
'ldc.existing': 'Lawful Development Certificate - Existing',
'ldc.proposed': 'Lawful Development Certificate - Proposed use',
'ldc.existing': 'Lawful Development Certificate - Existing use',
'ldc.existing.regularise':
'Lawful Development Certificate - Continue an existing use',
'ldc.condition':
'Lawful Development Certificate - Lawful not to comply with a condition or limitation',
pa: 'Prior Approval',
'pa.part1.classA': 'Prior Approval - Larger extension to a house',
'pa.part1.classAA': 'Prior Approval - Adding storeys to a house',
Expand Down Expand Up @@ -48,7 +52,7 @@ export const ApplicationTypes = {
'pa.part20.classZA':
'Prior Approval - Demolish buildings and build homes in their place',
pp: 'Planning Permission',
'pp.full.householder': 'Planning Permission - Full householder',
'pp.full.householder': 'Planning Permission - Full householder', // "Planning permission for a home"
'pp.full.householder.retro':
'Planning Permission - Full householder retrospective',
'Planning Permission - Full householder retrospective', // "Retrospective planning permission for a home"
};
2 changes: 2 additions & 0 deletions types/enums/FileTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Values of `file.type`
*/
export const FileTypes = {
'applicant.disability.evidence':
'Evidence for application fee exemption - disability',
'property.drawing.elevation': 'Elevations - existing',
'property.drawing.floorPlan': 'Floor plan - existing',
'property.drawing.roofPlan': 'Roof plan - existing',
Expand Down
8 changes: 5 additions & 3 deletions types/schema/data/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface ApplicationFee {
calculated: number;
payable: number;
exemption: {
disability: boolean; // @todo add application.fee.exemption.disability.reason & applicant.disability.evidence (file)
disability: boolean; // @todo add application.fee.exemption.disability.reason
resubmission: boolean; // @todo add application.resubmission.original.applicationReference & application.resubmission.originalReference.appeal
};
reduction: {
Expand All @@ -29,8 +29,10 @@ export interface ApplicationFee {
sports: boolean;
};
reference?: {
// @todo require when payable > 0
govPay: string;
/**
* @description GOV.UK Pay payment reference number
*/
govPay: string; // @todo require when payable > 0
};
}

Expand Down
30 changes: 28 additions & 2 deletions types/schema/data/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type Property = UKProperty | LondonProperty;

/**
* @id #UKRegion
* @description UK regions sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area
* @description The UK region that contains this address sourced from planning.data.gov.uk/dataset/region, where London is a proxy for the Greater London Authority (GLA) area
*/
export type UKRegion =
| 'North East'
Expand All @@ -31,13 +31,16 @@ export type UKRegion =
export interface UKProperty {
address: ProposedAddress | OSAddress;
region: UKRegion;
/**
* @description Current and historic UK Local Authority Districts that contain this address sourced from planning.data.gov.uk/dataset/local-authority-district
*/
localAuthorityDistrict: string[];
type: PropertyType;
boundary?: {
site: GeoJSON;
area: Area;
};
constraints?: {
constraints: {
planning: PlanningConstraint[];
};
}
Expand All @@ -52,6 +55,9 @@ export interface LondonProperty extends UKProperty {
known: 'Yes' | 'No';
number?: string;
};
/**
* @title Energy Performance Certificate
*/
EPC: {
known:
| 'Yes'
Expand All @@ -68,9 +74,21 @@ export interface LondonProperty extends UKProperty {
*/
export interface SiteAddress {
title: string;
/**
* @description Easting coordinate in British National Grid (OSGB36)
*/
x: number;
/**
* @description Northing coordinate in British National Grid (OSGB36)
*/
y: number;
/**
* @description Latitude coordinate in EPSG:4326 (WGS84)
*/
latitude: number;
/**
* @description Longitude coordinate in EPSG:4326 (WGS84)
*/
longitude: number;
}

Expand All @@ -87,7 +105,15 @@ export interface ProposedAddress extends SiteAddress {
* @description Address information for sites with a known address sourced from Ordnance Survey AddressBase Premium
*/
export interface OSAddress extends SiteAddress {
/**
* @title Unique Property Reference Number
* @maxLength 12
*/
uprn: string;
/**
* @title Unique Street Reference Number
* @maxLength 8
*/
usrn: string;
pao: string;
street: string;
Expand Down

0 comments on commit af70822

Please sign in to comment.