-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbapv.d.ts
More file actions
187 lines (167 loc) · 4.39 KB
/
Copy pathbapv.d.ts
File metadata and controls
187 lines (167 loc) · 4.39 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
import {
Alert,
ApplicationMethodType,
NotificationType,
OffenderRestriction,
PrisonDto,
PrisonerProfileDto,
Visit,
VisitorSupport,
VisitSummary,
} from '../data/orchestrationApiTypes'
import type { CalendarVisitSession } from '../services/visitSessionsService'
import type { Restriction } from '../data/prisonerContactRegistryApiTypes'
import { DAYS_OF_WEEK } from '../constants/daysOfWeek'
export type TextOrHtml = { text: string; html?: never } | { text?: never; html: string }
export type FlashFormValues = Record<string, unknown>
export type PrisonerDetailsItem = {
html?: string
text?: string
classes?: string
attributes?: {
'data-test': string
}
}
export type VisitorListItem = {
personId: number
name: string
dateOfBirth?: string
adult: boolean
relationshipDescription: string
address?: string
restrictions: Restriction[]
banned: boolean
}
export type PrisonerProfilePage = {
alerts: Alert[]
flaggedAlerts: Alert[]
restrictions: OffenderRestriction[]
prisonerDetails: {
prisonerId: string
firstName: string
lastName: string
dateOfBirth: string
cellLocation: string
prisonName: string
convictedStatus: PrisonerProfileDto['convictedStatus']
category: string
incentiveLevel: string
visitBalances: PrisonerProfileDto['visitBalances']
}
visitsByMonth: Map<string, { upcomingCount: number; pastCount: number; visits: VisitSummary[] }>
}
export type VisitSessionData = {
allowOverBooking: boolean
prisoner: {
firstName: string
lastName: string
offenderNo: string
location: string
alerts?: Alert[]
restrictions?: OffenderRestriction[]
}
prisonId: string
allVisitSessions?: CalendarVisitSession[]
selectedVisitSession?: {
date: string
sessionTemplateReference: string
startTime: string
endTime: string
availableTables: number
capacity: number
}
originalVisitSession?: {
date: string
sessionTemplateReference: string
startTime: string
endTime: string
visitRestriction: 'OPEN' | 'CLOSED' | undefined // 'undefined' for migrated visits
}
visitRestriction?: 'OPEN' | 'CLOSED'
visitorIds?: number[]
visitors?: VisitorListItem[]
visitorSupport?: VisitorSupport
mainContact?: {
contactId?: number
relationshipDescription?: string
phoneNumber?: string
email?: string
contactName?: string
languagePreference?: Visit['visitContact']['languagePreference']
}
applicationReference?: string
visitReference?: string // only set during an update journey; during initial booking it's unknown
visitStatus?: Visit['visitStatus']
requestMethod?: ApplicationMethodType
daysUntilBanExpiry?: number
overrideBookingWindow?: boolean
publicBooker?: boolean // true if booking originally made in public service
}
export type MoJAlert = {
variant: 'information' | 'success' | 'warning' | 'error'
title: string
showTitleAsHeading?: boolean
dismissible?: boolean
classes?: string
} & TextOrHtml
export type VisitInformation = {
reference: string
prisonNumber: string
prisonerName: string
mainContact: string
visitDate: string
visitTime: string
visitStatus: Visit['visitStatus']
visitSubStatus: Visit['visitSubStatus']
}
export type VisitsPageSideNavItem = {
reference: string
times: string
queryParams: string
active: boolean
}
export type VisitsPageSideNav = Map<string, VisitsPageSideNavItem[]>
export type VisitsReviewListItem = {
actionUrl: string
bookedByNames: string[]
prisonerNumbers: string[]
reference: string
type: NotificationType
visitDates: string[]
}
export interface Prison extends Omit<PrisonDto, 'code'> {
prisonId: string
}
export type PrisonRemandConfig = {
weekStartDay: DAYS_OF_WEEK
remandVisitLimitPerWeek: PrisonDto['remandVisitLimitPerWeek']
}
export type FilterField = {
id: string
label: string
items: {
label: string
value: string
checked: boolean
}[]
}
export type BookOrUpdate = 'book' | 'update'
export type CancelledVisitInfo = {
prisonerId: string
startTimestamp: string
endTimestamp: string
hasEmailAddress: boolean
hasMobileNumber: boolean
}
export type GOVUKInsetText = TextOrHtml & {
classes?: string
attributes?: { 'data-test': string }
}
export type GOVUKTag = TextOrHtml & {
classes?: string
}
export type GOVUKTableRow = GOVUKTableRowItem[]
type GOVUKTableRowItem = TextOrHtml & {
classes?: string
attributes?: { 'data-test': string }
}