-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathmodels_types.py
More file actions
362 lines (294 loc) · 7.62 KB
/
models_types.py
File metadata and controls
362 lines (294 loc) · 7.62 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
import datetime
from typing import Any, NotRequired, TypedDict
from uuid import UUID
class SerializedUser(TypedDict):
id: UUID
name: str
email_address: str
created_at: str
auth_type: str
current_session_id: UUID | None
failed_login_count: int
email_access_validated_at: str
logged_in_at: str | None
mobile_number: str | None
organisations: list[UUID]
password_changed_at: str
permissions: dict[str, list[str]]
organisation_permissions: dict[str, list[str]]
platform_admin: bool
services: list[UUID] | list[dict]
can_use_webauthn: bool
state: str
take_part_in_research: bool
receives_new_features_email: bool
class SerializedUserForList(TypedDict):
id: UUID
name: str
email_address: str
mobile_number: str | None
class SerializedEmailBranding(TypedDict):
id: str
colour: str | None
logo: str | None
name: str
text: str | None
brand_type: str
alt_text: str | None
created_by: Any | None
created_at: str | None
updated_at: str | None
class SerializedLetterBranding(TypedDict):
id: str
name: str
filename: str
created_by: str | None
created_at: str | None
updated_at: str | None
class SerializedOrganisation(TypedDict):
id: str
name: str
active: bool
crown: bool | None
organisation_type: str | None
letter_branding_id: str | None
email_branding_id: str | None
agreement_signed: bool | None
agreement_signed_at: datetime.datetime | None
agreement_signed_by_id: str | None
agreement_signed_on_behalf_of_name: str | None
agreement_signed_on_behalf_of_email_address: str | None
agreement_signed_version: float | None
domains: list[str]
request_to_go_live_notes: str | None
count_of_live_services: int
notes: str | None
purchase_order_number: str | None
billing_contact_names: str | None
billing_contact_email_addresses: str | None
billing_reference: str | None
can_approve_own_go_live_requests: bool
permissions: list[str]
class SerializedOrganisationForList(TypedDict):
name: str
id: str
active: bool
count_of_live_services: int
domains: list[str]
organisation_type: str | None
class SerializedServiceOrgDashboard(TypedDict):
id: str
name: str
active: bool
restricted: bool
class SerializedFreeSmsItems(TypedDict):
free_sms_fragment_limit: int
financial_year_start: int
class SerializedService(TypedDict):
id: str
name: str
class SerializedAnnualBilling(TypedDict):
id: str
free_sms_fragment_limit: int
service_id: str
financial_year_start: int
created_at: str
updated_at: str | None
service: SerializedService | None
class SerializedInboundNumber(TypedDict):
id: str
number: str
provider: str
service: SerializedService | None
active: bool
created_at: str
updated_at: str | None
class SerializedServiceSmsSender(TypedDict):
id: str
sms_sender: str
service_id: str
is_default: bool
archived: bool
inbound_number_id: str | None
created_at: str
updated_at: str | None
class SerializedServiceCallbackApi(TypedDict):
id: str
service_id: str
url: str
updated_by_id: str
created_at: str
updated_at: str | None
class SerializedTemplateFolder(TypedDict):
id: UUID
name: str
parent_id: UUID
service_id: UUID
users_with_permission: list[str]
class SmsCostDetails(TypedDict):
billable_sms_fragments: int
international_rate_multiplier: float
sms_rate: float
class LetterCostDetails(TypedDict):
billable_sheets_of_paper: int
postage: str
class SerializedNotificationForCSV(TypedDict):
id: UUID
row_number: str
recipient: str
client_reference: str
template_name: str
template_type: str
job_name: str
status: str
created_at: str
created_by_name: str | None
created_by_email_address: str | None
api_key_name: str | None
class SerializedNotification(TypedDict):
id: UUID
reference: str | None
email_address: str | None
phone_number: str | None
line_1: str | None
line_2: str | None
line_3: str | None
line_4: str | None
line_5: str | None
line_6: str | None
postcode: str | None
type: str
status: str
template: dict
body: str
subject: str | None
created_at: str
created_by_name: str | None
sent_at: str | None
completed_at: str | None
scheduled_for: None # Currently hardcoded to None
postage: str | None
one_click_unsubscribe_url: str | None
estimated_delivery: NotRequired[str]
class SerializedNotificationWithCostData(SerializedNotification):
cost_details: SmsCostDetails | LetterCostDetails | dict
is_cost_data_ready: bool
cost_in_pounds: float
class SerializedInvitedOrganisationUser(TypedDict):
id: str
email_address: str
invited_by: str
organisation: str
created_at: str
permissions: list[str]
status: str
class SerializedRate(TypedDict):
rate: float
valid_from: str
class SerializedInboundSms(TypedDict):
id: str
created_at: str
service_id: str
notify_number: str
user_number: str
content: str
class SerializedLetterRate(TypedDict):
sheet_count: int
start_date: str
rate: float
post_class: str
class SerializedServiceEmailReplyTo(TypedDict):
id: str
service_id: str
email_address: str
is_default: bool
archived: bool
created_at: str
updated_at: str | None
class SerializedServiceLetterContact(TypedDict):
id: str
service_id: str
contact_block: str
is_default: bool
archived: bool
created_at: str
updated_at: str | None
class SerializedComplaint(TypedDict):
id: str
notification_id: str
service_id: str
service_name: str
ses_feedback_id: str | None
complaint_type: str | None
complaint_date: str | None
created_at: str
class SerializedServiceDataRetention(TypedDict):
id: str
service_id: str
service_name: str
notification_type: str
days_of_retention: int
created_at: str
updated_at: str | None
class SerializedServiceContactList(TypedDict):
id: str
original_file_name: str
row_count: int
recent_job_count: int
has_jobs: bool
template_type: str
service_id: str
created_by: str
created_at: str
class SerializedWebauthnCredential(TypedDict):
id: str
user_id: str
name: str
credential_data: str
created_at: str
updated_at: str | None
logged_in_at: str | None
class SerializedLetterAttachment(TypedDict):
id: str
created_at: str
created_by_id: str
archived_at: str | None
archived_by_id: str | None
original_filename: str
page_count: int
class SerializedUnsubscribeRequestReport(TypedDict):
batch_id: str | None
count: int
created_at: str | None
earliest_timestamp: str
latest_timestamp: str
processed_by_service_at: str | None
is_a_batched_report: bool
will_be_archived_at: str
service_id: str
class SerializedServiceJoinRequest(TypedDict):
id: str
service_id: str
created_at: str
status: str
status_changed_at: str | None
reason: str | None
contacted_service_users: list[str]
status_changed_by: Any
requester: Any
class SerializedReportRequest(TypedDict):
id: str
user_id: str
service_id: str
report_type: str
status: str
parameter: dict
created_at: str
updated_at: str | None
class SerializedTemplateEmailFile(TypedDict):
id: str
filename: str
link_text: str
retention_period: int
validate_users_email: bool
pending: bool