forked from expertiza/reimplementation-front-end
/
interfaces.ts
202 lines (176 loc) · 4.2 KB
/
interfaces.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
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
/**
* @author Ankur Mundra on June, 2023
*/
export interface IEditor {
mode: "create" | "update";
}
export interface IRole {
id?: number;
name: string;
parent_id: number;
}
export interface IInstitution {
id?: number;
name: string;
}
export interface IInstructor {
id?: number;
name: string;
}
export interface ITA {
id?: number;
name: string;
}
export interface IUserResponse {
id: number;
name: string;
email: string;
full_name: string;
email_on_review: boolean;
email_on_submission: boolean;
email_on_review_of_review: boolean;
role: { id: number; name: string };
parent: { id: number | null; name: string | null };
institution: { id: number | null; name: string | null };
}
export interface IParticipantResponse {
id: number;
name: string;
email: string;
full_name: string;
email_on_review: boolean;
email_on_submission: boolean;
email_on_review_of_review: boolean;
role: { id: number; name: string };
parent: { id: number | null; name: string | null };
institution: { id: number | null; name: string | null };
}
export interface IUserRequest {
name: string;
email: string;
full_name: string;
role_id: number;
parent_id?: number | null;
institution_id: number;
email_on_review?: boolean;
email_on_submission?: boolean;
email_on_review_of_review?: boolean;
}
export interface IParticipantRequest {
name: string;
email: string;
full_name: string;
role_id: number;
parent_id?: number | null;
institution_id: number;
email_on_review?: boolean;
email_on_submission?: boolean;
email_on_review_of_review?: boolean;
}
export interface IAssignmentRequest {
name: string,
directory_path: string,
spec_location:string,
private:boolean,
show_template_review: boolean,
require_quiz:boolean,
has_badge:boolean,
staggered_deadline:boolean,
is_calibrated:boolean,
}
export interface ITAResponse {
id: number;
name: string;
email: string;
full_name: string;
email_on_review: boolean;
email_on_submission: boolean;
email_on_review_of_review: boolean;
role: { id: number; name: string };
parent: { id: number | null; name: string | null };
institution: { id: number | null; name: string | null };
}
export interface ITARequest {
name: string;
}
export interface ILoggedInUser {
id: number;
name: string;
full_name: string;
role: string;
institution_id: number;
}
export interface ICourseResponse{
id: number;
name: string;
directory_path: string;
info: string;
private: boolean;
created_at: Date;
updated_at: Date;
institution_id: number;
instructor_id: number;
institution: { id: number | null; name: string | null };
instructor: { id: number | null; name: string | null };
}
export interface ICourseRequest{
name: string;
directory_path: string;
info: string;
private: boolean;
institution_id: number;
instructor_id: number;
}
export interface IInstitutionResponse {
id: number;
name: string;
}
export enum ROLE {
SUPER_ADMIN = "Super Administrator",
ADMIN = "Administrator",
INSTRUCTOR = "Instructor",
TA = "Teaching Assistant",
STUDENT = "Student",
}
export interface IAssignmentResponse {
id: number;
name: string;
course_id: number;
courseName: string;
created_at: Date;
updated_at: Date;
directory_path: string;
spec_location:string;
private:boolean;
show_template_review: boolean;
require_quiz:boolean;
has_badge:boolean;
staggered_deadline:boolean;
is_calibrated:boolean;
}
export interface StudentTeamsProps { }
// Define the structure of a team member object
export interface TeamMember {
username: string;
fullName: string;
email: string;
}
// Define the structure of the team details object
export interface TeamDetails {
id: string;
projectName: string;
teamName: string;
teamMembers: TeamMember[];
}
export interface Invitation {
username: string;
fullName: string;
email: string;
status: string;
}
// Assuming that your transformation function for assignment responses might look like this
export const transformAssignmentResponse = (assignmentResponse: string): IAssignmentResponse => {
const assignment: IAssignmentResponse = JSON.parse(assignmentResponse);
// Transform response as needed
return assignment;
};