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

chore: improve JSDoc annotations #60

Merged
merged 6 commits into from
Oct 25, 2023
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
269 changes: 128 additions & 141 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,54 +72,7 @@
"type": "string"
},
"ownership": {
"additionalProperties": false,
"properties": {
"certificate": {
"enum": [
"a",
"b",
"c",
"d"
],
"type": "string"
},
"noticeGiven": {
"type": "boolean"
},
"owners": {
"items": {
"additionalProperties": false,
"properties": {
"address": {
"anyOf": [
{
"$ref": "#/definitions/AddressInput"
},
{
"type": "string"
}
]
},
"name": {
"type": "string"
},
"noticeDate": {
"$ref": "#/definitions/Date"
}
},
"required": [
"name",
"address"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"certificate"
],
"type": "object"
"$ref": "#/definitions/Ownership"
},
"siteContact": {
"$ref": "#/definitions/SiteContact"
Expand Down Expand Up @@ -162,39 +115,7 @@
"description": "Information about this planning application",
"properties": {
"declaration": {
"additionalProperties": false,
"properties": {
"accurate": {
"type": "boolean"
},
"connection": {
"additionalProperties": false,
"properties": {
"description": {
"type": "string"
},
"value": {
"enum": [
"employee",
"relation.employee",
"electedMember",
"relation.electedMember",
"none"
],
"type": "string"
}
},
"required": [
"value"
],
"type": "object"
}
},
"required": [
"accurate",
"connection"
],
"type": "object"
"$ref": "#/definitions/ApplicationDeclaration"
},
"fee": {
"$ref": "#/definitions/ApplicationFee"
Expand All @@ -213,6 +134,43 @@
],
"type": "object"
},
"ApplicationDeclaration": {
"$id": "#ApplicationDeclaration",
"additionalProperties": false,
"description": "Declarations about the accuracy of this application and any personal connections to the receiving authority",
"properties": {
"accurate": {
"type": "boolean"
},
"connection": {
"additionalProperties": false,
"properties": {
"description": {
"type": "string"
},
"value": {
"enum": [
"employee",
"relation.employee",
"electedMember",
"relation.electedMember",
"none"
],
"type": "string"
}
},
"required": [
"value"
],
"type": "object"
}
},
"required": [
"accurate",
"connection"
],
"type": "object"
},
"ApplicationFee": {
"$id": "#ApplicationFee",
"additionalProperties": false,
Expand Down Expand Up @@ -940,54 +898,7 @@
"type": "string"
},
"ownership": {
"additionalProperties": false,
"properties": {
"certificate": {
"enum": [
"a",
"b",
"c",
"d"
],
"type": "string"
},
"noticeGiven": {
"type": "boolean"
},
"owners": {
"items": {
"additionalProperties": false,
"properties": {
"address": {
"anyOf": [
{
"$ref": "#/definitions/AddressInput"
},
{
"type": "string"
}
]
},
"name": {
"type": "string"
},
"noticeDate": {
"$ref": "#/definitions/Date"
}
},
"required": [
"name",
"address"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"certificate"
],
"type": "object"
"$ref": "#/definitions/Ownership"
},
"siteContact": {
"$ref": "#/definitions/SiteContact"
Expand Down Expand Up @@ -1965,7 +1876,9 @@
"type": "object"
},
"LondonDetails": {
"$id": "#LondonDetails",
"additionalProperties": false,
"description": "Proposal details for project sites within the Greater London Authority (GLA) area",
"properties": {
"extend": {
"additionalProperties": false,
Expand Down Expand Up @@ -2605,7 +2518,7 @@
"LondonProperty": {
"$id": "#LondonProperty",
"additionalProperties": false,
"description": "Property details for sites within London",
"description": "Property details for sites within the Greater London Authority (GLA) area",
"properties": {
"EPC": {
"additionalProperties": false,
Expand Down Expand Up @@ -2676,6 +2589,7 @@
"type": "array"
},
"region": {
"const": "London",
"type": "string"
},
"titleNumber": {
Expand Down Expand Up @@ -2952,6 +2866,58 @@
],
"type": "object"
},
"Ownership": {
"$id": "#Ownership",
"additionalProperties": false,
"description": "Information about the ownership certificate and owners, if different than the applicant",
"properties": {
"certificate": {
"enum": [
"a",
"b",
"c",
"d"
],
"type": "string"
},
"noticeGiven": {
"type": "boolean"
},
"owners": {
"items": {
"additionalProperties": false,
"properties": {
"address": {
"anyOf": [
{
"$ref": "#/definitions/AddressInput"
},
{
"type": "string"
}
]
},
"name": {
"type": "string"
},
"noticeDate": {
"$ref": "#/definitions/Date"
}
},
"required": [
"name",
"address"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"certificate"
],
"type": "object"
},
"PlanningConstraint": {
"$id": "#PlanningConstraint",
"anyOf": [
Expand Down Expand Up @@ -17193,16 +17159,7 @@
"type": "object"
},
"date": {
"additionalProperties": false,
"properties": {
"completion": {
"$ref": "#/definitions/Date"
},
"start": {
"$ref": "#/definitions/Date"
}
},
"type": "object"
"$ref": "#/definitions/ProposalDates"
},
"description": {
"type": "string"
Expand All @@ -17223,6 +17180,20 @@
],
"type": "object"
},
"ProposalDates": {
"$id": "#ProposalDates",
"additionalProperties": false,
"description": "When the proposed works will start and be completed by, not required for all application types",
"properties": {
"completion": {
"$ref": "#/definitions/Date"
},
"start": {
"$ref": "#/definitions/Date"
}
},
"type": "object"
},
"ProposalDetails": {
"$id": "#ProposalDetails",
"anyOf": [
Expand Down Expand Up @@ -18037,7 +18008,7 @@
"type": "array"
},
"region": {
"type": "string"
"$ref": "#/definitions/UKRegion"
},
"type": {
"$ref": "#/definitions/PropertyType"
Expand All @@ -18051,6 +18022,22 @@
],
"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",
"enum": [
"North East",
"North West",
"Yorkshire and The Humber",
"East Midlands",
"West Midlands",
"East of England",
"London",
"South East",
"South West"
],
"type": "string"
},
"URL": {
"format": "uri",
"pattern": "^https?://",
Expand Down
2 changes: 1 addition & 1 deletion types/enums/PropertyTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Values of `data.property.type`
* Values of `data.property.type`, derived from Basic Land and Property Unit (BLPU) classification codes
*/
export const PropertyTypes = {
commercial: 'Commercial',
Expand Down
24 changes: 15 additions & 9 deletions types/schema/data/Applicant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,26 @@ export type Applicant = BaseApplicant | Agent;
export interface BaseApplicant {
type: 'individual' | 'company' | 'charity' | 'public' | 'parishCouncil';
interest?: 'owner.sole' | 'owner.co' | 'tenant' | 'occupier' | 'other';
ownership?: {
certificate: 'a' | 'b' | 'c' | 'd';
noticeGiven?: boolean;
owners?: {
name: string;
address: AddressInput | string;
noticeDate?: Date;
}[];
};
ownership?: Ownership;
contact: UserContact;
address: UserAddress;
siteContact: SiteContact;
}

/**
* @id #Ownership
* @description Information about the ownership certificate and owners, if different than the applicant
*/
export interface Ownership {
certificate: 'a' | 'b' | 'c' | 'd';
noticeGiven?: boolean;
owners?: {
name: string;
address: AddressInput | string;
noticeDate?: Date;
}[];
}

/**
* @id #Agent
* @description Information about the user who completed the application on behalf of someone else
Expand Down
Loading
Loading