-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
69 lines (61 loc) · 1.41 KB
/
types.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
import { QueryResponse } from "@rockset/client/dist/codegen/api";
import { Request, Response } from "express";
export interface googleUser {
iss: string;
aud: string;
sub: string;
email?: string;
email_verified?: boolean;
azp?: string;
name?: string;
picture?: string;
given_name?: string; // snake case because of API
family_name?: string;
}
export interface User {
_id: number;
email: string;
name: string;
picture: string;
given_name: string;
family_name: string;
_event_time: string;
role?: string;
}
export interface Teacher extends User {
teacher: any;
slots: Slot[];
role?: string;
}
export interface Student extends User {
slots: Slot[];
teacher: false;
teachers: string[];
teacher_slots: Slot[];
role?: string;
}
export interface DatabaseItem {
_id: string;
_event_time: string;
}
export interface Slot extends DatabaseItem {
date: string;
startTime: string;
endTime: string;
reason: string;
teacher_id: string;
student_email: string;
}
export interface Email {
to: string;
from: string;
subject: string;
text: string;
html?: string;
cc?: string;
bcc?: string;
attachments?: any;
}
export type QueryCallback = (value: QueryResponse) => void;
export type Req = Request<{}, any, any, Record<string, any>>;
export type Res = Response<any, Record<string, any>>;