|
| 1 | +import {Date, Email} from '../../../shared/utils'; |
| 2 | +import {User} from './User'; |
| 3 | + |
| 4 | +/** |
| 5 | + * @id #Applicant |
| 6 | + * @description The user who completed the application either for themself or on behalf of someone else |
| 7 | + */ |
| 8 | +export type Applicant = BaseApplicant | Agent; |
| 9 | + |
| 10 | +/** |
| 11 | + * @id #BaseApplicant |
| 12 | + * @description Information about the user who completed the application for themself, or information about the person who the user applied on behalf of |
| 13 | + */ |
| 14 | +export interface BaseApplicant { |
| 15 | + type: 'individual' | 'company' | 'charity' | 'public' | 'parishCouncil'; |
| 16 | + name: { |
| 17 | + title?: string; |
| 18 | + first: string; |
| 19 | + last: string; |
| 20 | + }; |
| 21 | + email: Email; |
| 22 | + phone: { |
| 23 | + primary: string; |
| 24 | + }; |
| 25 | + company?: { |
| 26 | + name: string; |
| 27 | + }; |
| 28 | + address: UserAddress; |
| 29 | + ownership?: Ownership; |
| 30 | + siteContact: SiteContact; |
| 31 | + maintenanceContact?: MaintenanceContact; |
| 32 | +} |
| 33 | + |
| 34 | +/** |
| 35 | + * @id #Ownership |
| 36 | + * @description Information about the ownership certificate and property owners, if different than the applicant |
| 37 | + */ |
| 38 | +export interface Ownership { |
| 39 | + interest?: |
| 40 | + | 'owner' |
| 41 | + | 'owner.sole' |
| 42 | + | 'owner.co' |
| 43 | + | 'lessee' |
| 44 | + | 'occupier' |
| 45 | + | 'other'; |
| 46 | + certificate?: 'a' | 'b' | 'c' | 'd'; |
| 47 | + /** |
| 48 | + * @description Does the land have any agricultural tenants? |
| 49 | + */ |
| 50 | + agriculturalTenants?: boolean; |
| 51 | + /** |
| 52 | + * @description Has requisite notice been given to all the known owners and agricultural tenants? |
| 53 | + */ |
| 54 | + noticeGiven?: boolean; |
| 55 | + /** |
| 56 | + * @description Has a notice of the application been published in a newspaper circulating in the area where the land is situated? |
| 57 | + */ |
| 58 | + noticePublished?: { |
| 59 | + status: boolean; |
| 60 | + date?: Date; |
| 61 | + newspaperName?: string; |
| 62 | + }; |
| 63 | + /** |
| 64 | + * @description Do you know the names and addresses of all owners and agricultural tenants? |
| 65 | + */ |
| 66 | + ownersKnown?: 'all' | 'some' | 'none'; |
| 67 | + owners?: Owners[]; |
| 68 | + /** |
| 69 | + * @description Declaration of the accuracy of the ownership certificate, including reasonable steps taken to find all owners and publish notice |
| 70 | + */ |
| 71 | + declaration?: { |
| 72 | + accurate: true; |
| 73 | + }; |
| 74 | +} |
| 75 | + |
| 76 | +/** |
| 77 | + * @id #Owners |
| 78 | + * @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 |
| 79 | + */ |
| 80 | +export type Owners = OwnersNoticeGiven | OwnersNoNoticeGiven | OwnersNoticeDate; |
| 81 | + |
| 82 | +export interface BaseOwners { |
| 83 | + name: string; |
| 84 | + address: Address | string; |
| 85 | + interest?: 'owner' | 'lessee' | 'occupier' | 'other'; |
| 86 | +} |
| 87 | + |
| 88 | +// LDC requires `noticeGiven`, and `noNoticeReason` if false |
| 89 | +export interface OwnersNoticeGiven extends BaseOwners { |
| 90 | + noticeGiven: true; |
| 91 | +} |
| 92 | + |
| 93 | +export interface OwnersNoNoticeGiven extends BaseOwners { |
| 94 | + noticeGiven: false; |
| 95 | + noNoticeReason: string; |
| 96 | +} |
| 97 | + |
| 98 | +// PP & LBC require `noticeDate` |
| 99 | +export interface OwnersNoticeDate extends BaseOwners { |
| 100 | + noticeDate: Date; |
| 101 | +} |
| 102 | + |
| 103 | +/** |
| 104 | + * @id #Agent |
| 105 | + * @description Information about the agent or proxy who completed the application on behalf of someone else |
| 106 | + */ |
| 107 | +export interface Agent extends BaseApplicant { |
| 108 | + agent: { |
| 109 | + name: { |
| 110 | + title?: string; |
| 111 | + first: string; |
| 112 | + last: string; |
| 113 | + }; |
| 114 | + email: Email; |
| 115 | + phone: { |
| 116 | + primary: string; |
| 117 | + }; |
| 118 | + company?: { |
| 119 | + name: string; |
| 120 | + }; |
| 121 | + address: Address; |
| 122 | + }; |
| 123 | +} |
| 124 | + |
| 125 | +/** |
| 126 | + * @id #Address |
| 127 | + * @description Address information for a person associated with this application not at the property address |
| 128 | + */ |
| 129 | +export interface Address { |
| 130 | + line1: string; |
| 131 | + line2?: string; |
| 132 | + town: string; |
| 133 | + county?: string; |
| 134 | + postcode: string; |
| 135 | + country?: string; |
| 136 | +} |
| 137 | + |
| 138 | +/** |
| 139 | + * @id #UserAddress |
| 140 | + * @description Address information for the applicant |
| 141 | + */ |
| 142 | +export type UserAddress = {sameAsSiteAddress: true} | UserAddressNotSameSite; |
| 143 | + |
| 144 | +/** |
| 145 | + * @id #UserAddressNotSameSite |
| 146 | + * @description Address information for an applicant with contact information that differs from the property address |
| 147 | + */ |
| 148 | +export interface UserAddressNotSameSite extends Address { |
| 149 | + sameAsSiteAddress: false; |
| 150 | +} |
| 151 | + |
| 152 | +/** |
| 153 | + * @id #SiteContact |
| 154 | + * @description Contact information for the site visit |
| 155 | + */ |
| 156 | +export type SiteContact = {role: User['role']} | SiteContactOther; |
| 157 | + |
| 158 | +/** |
| 159 | + * @id #SiteContactOther |
| 160 | + * @description Contact information for the site visit when the SiteContact's role is 'other' |
| 161 | + */ |
| 162 | +export interface SiteContactOther { |
| 163 | + role: 'other'; |
| 164 | + name: string; |
| 165 | + email: string; |
| 166 | + phone: string; |
| 167 | +} |
| 168 | + |
| 169 | +/** |
| 170 | + * @id #MaintenanceContact |
| 171 | + * @description Contact information for the person(s) responsible for maintenance while the works are carried out |
| 172 | + */ |
| 173 | +export type MaintenanceContact = { |
| 174 | + when: |
| 175 | + | 'duringConstruction' |
| 176 | + | 'afterConstruction' |
| 177 | + | 'duringAndAfterConstruction'; |
| 178 | + address: Address; |
| 179 | + contact: { |
| 180 | + name: { |
| 181 | + title?: string; |
| 182 | + first: string; |
| 183 | + last: string; |
| 184 | + }; |
| 185 | + email: string; |
| 186 | + phone: string; |
| 187 | + company?: { |
| 188 | + name: string; |
| 189 | + }; |
| 190 | + }; |
| 191 | +}[]; |
0 commit comments