-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApplicant.ts
150 lines (141 loc) · 3.62 KB
/
Applicant.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import {Date, Email} from '../../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;
interest?:
| 'owner'
| 'owner.sole'
| 'owner.co'
| 'tenant'
| 'occupier'
| 'other';
ownership?: Ownership;
siteContact: SiteContact;
}
/**
* @id #Ownership
* @description Information about the ownership certificate and property owners, if different than the applicant
*/
export interface Ownership {
certificate: 'a' | 'b' | 'c' | 'd';
/**
* @description Does the land have any agricultural tenants?
*/
agriculturalTenants?: boolean;
/**
* @description Do you know the names and addresses of all owners and agricultural tenants?
*/
ownerKnown?: 'all' | 'some' | 'none';
/**
* @description Has requisite notice been given to all the known owners and agricultural tenants?
*/
noticeGiven?: boolean;
/**
* @descrpition Reason requisite notice has not been given, if applicable
*/
noticeReason?: string;
/**
* @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 Names and addresses of all known owners and agricultural tenants
*/
owners?: {
name: string;
address: Address | string;
noticeDate?: Date;
}[];
/**
* @description Declaration of the accuracy of the ownership certificate, including reasonable steps taken to find all owners and publish notice
*/
declaration?: {
accurate: boolean;
};
}
/**
* @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;
}