-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {FileType} from './enums/FileTypes'; | ||
|
||
/** | ||
* @id #File | ||
* @description File uploaded and labeled by the user to support the application | ||
*/ | ||
export interface File { | ||
name: string; | ||
type: FileType[]; | ||
description?: string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import {FileType} from './enums/FileTypes'; | ||
import {DateTime, URL, UUID} from '../../shared/utils'; | ||
import {QuestionMetaData} from './Responses'; | ||
|
||
/** | ||
* @id #DigitalPlanningMetadata | ||
* @description Details of the digital planning service which sent this application | ||
*/ | ||
export type Metadata = AnyProviderMetadata | PlanXMetadata; | ||
|
||
/** | ||
* @id #BaseMetadata | ||
* @description Minimum metadata expected for any application | ||
*/ | ||
export interface BaseMetadata { | ||
/** | ||
* @description The reference code for the organisation responsible for processing this planning application, sourced from planning.data.gov.uk/dataset/local-authority | ||
* @maxLength 4 | ||
*/ | ||
organisation: string; | ||
/** | ||
* @description Unique identifier for this application | ||
*/ | ||
id: UUID; // @todo align to DLUHC Planning Application API reference | ||
submittedAt: DateTime; | ||
schema: URL; | ||
} | ||
|
||
/** | ||
* @id #AnyProviderMetadata | ||
* @description Base metadata associated with applications submitted via any provider | ||
*/ | ||
export interface AnyProviderMetadata extends BaseMetadata { | ||
source: 'Any'; | ||
} | ||
|
||
/** | ||
* @id #RequestedFiles | ||
* @description File types requested by this service. Schema["files"] will be a subset of this list based on the user's journey through the service | ||
*/ | ||
export interface RequestedFiles { | ||
required: FileType[]; | ||
recommended: FileType[]; | ||
optional: FileType[]; | ||
} | ||
|
||
/** | ||
* @id #CalculateMetadata | ||
* @description Metadata associated with PlanX Calculate components used to determine fees throughout a service | ||
*/ | ||
export interface CalculateMetadata { | ||
description?: string; | ||
policyRefs?: QuestionMetaData['policyRefs']; | ||
} | ||
|
||
/** | ||
* @id #FeeExplanationNotApplicable | ||
* @description An indicator that an application fee does not apply to this application type or journey, therefore there is not an explanation of how it was calculated | ||
*/ | ||
export interface FeeExplanationNotApplicable { | ||
notApplicable: true; | ||
} | ||
|
||
/** | ||
* @id #FeeExplanation | ||
* @description An explanation, including policy references, of the fees associated with this application | ||
*/ | ||
export interface FeeExplanation { | ||
calculated: CalculateMetadata[]; | ||
payable: CalculateMetadata[]; | ||
/** | ||
* @description Breakdown of calculated fee by category of development, based on the scales defined in The Town and Country Planning Regulations https://www.legislation.gov.uk/uksi/2012/2920/schedule/1/part/2 | ||
*/ | ||
category?: { | ||
one?: CalculateMetadata[]; | ||
two?: CalculateMetadata[]; | ||
three?: CalculateMetadata[]; | ||
four?: CalculateMetadata[]; | ||
five?: CalculateMetadata[]; | ||
sixAndSeven?: CalculateMetadata[]; | ||
eight?: CalculateMetadata[]; | ||
nine?: CalculateMetadata[]; | ||
ten?: CalculateMetadata[]; | ||
eleven?: { | ||
one: CalculateMetadata[]; | ||
}; | ||
twelve?: { | ||
one?: CalculateMetadata[]; | ||
two?: CalculateMetadata[]; | ||
}; | ||
thirteen?: CalculateMetadata[]; | ||
fourteen?: CalculateMetadata[]; | ||
}; | ||
} | ||
|
||
/** | ||
* @id #PlanXMetadata | ||
* @description Additional metadata associated with applications submitted via PlanX | ||
*/ | ||
export interface PlanXMetadata extends BaseMetadata { | ||
source: 'PlanX'; | ||
service: { | ||
flowId: UUID; | ||
url: URL; | ||
files: RequestedFiles; | ||
fee: FeeExplanation | FeeExplanationNotApplicable; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {ResultFlag} from './enums/Flags'; | ||
|
||
/** | ||
* @id #PreAssessment | ||
* @description The result of the application based on information provided by the applicant, prior to assessment by a planning officer. Results are determined by flags corresponding to responses; each application can have up to one result per flagset | ||
*/ | ||
export type PreAssessment = ResultFlag[]; // @todo validate/restrict array to one result per flagset |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {URL} from '../../shared/utils'; | ||
|
||
/** | ||
* @id #Responses | ||
* @description The ordered list of questions, answers, and their metadata for the application | ||
*/ | ||
export type Responses = QuestionAndResponses[]; | ||
|
||
export interface QuestionMetaData { | ||
autoAnswered?: boolean; | ||
policyRefs?: Array<{ | ||
text: string; | ||
url?: URL; | ||
}>; | ||
sectionName?: string; | ||
} | ||
|
||
export interface ResponseMetaData { | ||
flags?: Array<string>; // @todo connect to result/flags enum, is this actually a list? | ||
options?: Array<string> | Array<Response>; | ||
} | ||
|
||
export interface Response { | ||
value: string; | ||
metadata?: ResponseMetaData; | ||
} | ||
|
||
export interface QuestionAndResponses { | ||
question: string; | ||
responses: Array<Response> | string; | ||
metadata?: QuestionMetaData; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
import {Date, Email} from '../../../shared/utils'; | ||
import {User} from './User'; | ||
|
||
/** | ||
* @id #Applicant | ||
* @description The user who completed the application either for themself or on behalf of someone else | ||
*/ | ||
export type Applicant = BaseApplicant | Agent; | ||
|
||
/** | ||
* @id #BaseApplicant | ||
* @description Information about the user who completed the application for themself, or information about the person who the user applied on behalf of | ||
*/ | ||
export interface BaseApplicant { | ||
type: 'individual' | 'company' | 'charity' | 'public' | 'parishCouncil'; | ||
name: { | ||
title?: string; | ||
first: string; | ||
last: string; | ||
}; | ||
email: Email; | ||
phone: { | ||
primary: string; | ||
}; | ||
company?: { | ||
name: string; | ||
}; | ||
address: UserAddress; | ||
ownership?: Ownership; | ||
siteContact: SiteContact; | ||
maintenanceContact?: MaintenanceContact; | ||
} | ||
|
||
/** | ||
* @id #Ownership | ||
* @description Information about the ownership certificate and property owners, if different than the applicant | ||
*/ | ||
export interface Ownership { | ||
interest?: | ||
| 'owner' | ||
| 'owner.sole' | ||
| 'owner.co' | ||
| 'tenant' | ||
| 'occupier' | ||
| 'other'; | ||
certificate?: 'a' | 'b' | 'c' | 'd'; | ||
/** | ||
* @description Does the land have any agricultural tenants? | ||
*/ | ||
agriculturalTenants?: boolean; | ||
/** | ||
* @description Has requisite notice been given to all the known owners and agricultural tenants? | ||
*/ | ||
noticeGiven?: boolean; | ||
/** | ||
* @description Has a notice of the application been published in a newspaper circulating in the area where the land is situated? | ||
*/ | ||
noticePublished?: { | ||
status: boolean; | ||
date?: Date; | ||
newspaperName?: string; | ||
}; | ||
/** | ||
* @description Do you know the names and addresses of all owners and agricultural tenants? | ||
*/ | ||
ownersKnown?: 'all' | 'some' | 'none'; | ||
owners?: Owners[]; | ||
/** | ||
* @description Declaration of the accuracy of the ownership certificate, including reasonable steps taken to find all owners and publish notice | ||
*/ | ||
declaration?: { | ||
accurate: true; | ||
}; | ||
} | ||
|
||
/** | ||
* @id #Owners | ||
* @description Names and addresses of all known owners and agricultural tenants, including confirmation or date of notice, or reason requisite notice has not been given if applicable | ||
*/ | ||
export type Owners = OwnersNoticeGiven | OwnersNoNoticeGiven | OwnersNoticeDate; | ||
|
||
export interface BaseOwners { | ||
name: string; | ||
address: Address | string; | ||
interest?: 'owner' | 'tenant' | 'occupier' | 'other'; | ||
} | ||
|
||
// LDC requires `noticeGiven`, and `noNoticeReason` if false | ||
export interface OwnersNoticeGiven extends BaseOwners { | ||
noticeGiven: true; | ||
} | ||
|
||
export interface OwnersNoNoticeGiven extends BaseOwners { | ||
noticeGiven: false; | ||
noNoticeReason: string; | ||
} | ||
|
||
// PP & LBC require `noticeDate` | ||
export interface OwnersNoticeDate extends BaseOwners { | ||
noticeDate: Date; | ||
} | ||
|
||
/** | ||
* @id #Agent | ||
* @description Information about the agent or proxy who completed the application on behalf of someone else | ||
*/ | ||
export interface Agent extends BaseApplicant { | ||
agent: { | ||
name: { | ||
title?: string; | ||
first: string; | ||
last: string; | ||
}; | ||
email: Email; | ||
phone: { | ||
primary: string; | ||
}; | ||
company?: { | ||
name: string; | ||
}; | ||
address: Address; | ||
}; | ||
} | ||
|
||
/** | ||
* @id #Address | ||
* @description Address information for a person associated with this application not at the property address | ||
*/ | ||
export interface Address { | ||
line1: string; | ||
line2?: string; | ||
town: string; | ||
county?: string; | ||
postcode: string; | ||
country?: string; | ||
} | ||
|
||
/** | ||
* @id #UserAddress | ||
* @description Address information for the applicant | ||
*/ | ||
export type UserAddress = {sameAsSiteAddress: true} | UserAddressNotSameSite; | ||
|
||
/** | ||
* @id #UserAddressNotSameSite | ||
* @description Address information for an applicant with contact information that differs from the property address | ||
*/ | ||
export interface UserAddressNotSameSite extends Address { | ||
sameAsSiteAddress: false; | ||
} | ||
|
||
/** | ||
* @id #SiteContact | ||
* @description Contact information for the site visit | ||
*/ | ||
export type SiteContact = {role: User['role']} | SiteContactOther; | ||
|
||
/** | ||
* @id #SiteContactOther | ||
* @description Contact information for the site visit when the SiteContact's role is 'other' | ||
*/ | ||
export interface SiteContactOther { | ||
role: 'other'; | ||
name: string; | ||
email: string; | ||
phone: string; | ||
} | ||
|
||
/** | ||
* @id #MaintenanceContact | ||
* @description Contact information for the person(s) responsible for maintenance while the works are carried out | ||
*/ | ||
export type MaintenanceContact = { | ||
when: | ||
| 'duringConstruction' | ||
| 'afterConstruction' | ||
| 'duringAndAfterConstruction'; | ||
address: Address; | ||
contact: { | ||
name: { | ||
title?: string; | ||
first: string; | ||
last: string; | ||
}; | ||
email: string; | ||
phone: string; | ||
company?: { | ||
name: string; | ||
}; | ||
}; | ||
}[]; |