Skip to content

Commit 3d57893

Browse files
committed
verder gewerkt aan implementatie entiteiten
1 parent 3616779 commit 3d57893

File tree

7 files changed

+54
-21
lines changed

7 files changed

+54
-21
lines changed

backend/src/core/entities/assignment_interface.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ import { GroupInterface } from "./group_interface";
22

33
export interface AssignmentInterface {
44
id: string;
5-
get_groups: () => [GroupInterface]
5+
uuid: string;
6+
start_date: Date;
7+
deadline: Date;
8+
extra_instructions: string;
9+
10+
set_start_date: (new_start_date: Date) => void;
11+
set_deadline: (new_deadline: Date) => void;
12+
set_extra_instructions: (new_instructions: string) => void;
13+
14+
get_groups: () => [GroupInterface];
615

716
}

backend/src/core/entities/class_interface.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@ export interface ClassInterface {
77
id: string;
88
name: string;
99
year: number;
10-
get_assignments: () => [AssignmentInterface]; // Get the assignments for this class.
11-
get_all_groups: () => [GroupInterface]; // Get all existing groups that consist exclusively of students from this class.
10+
11+
set_year: (new_year: number) => void;
12+
set_name: (new_name: string) => void;
13+
1214
get_teachers: () => [TeacherInterface]; // Get this class' teachers.
1315
get_students: () => [StudentInterface]; // Get this class' students.
16+
create_invite_link: () => string; // Create an invite link for teachers and students to join the class.
17+
18+
get_assignments: () => [AssignmentInterface]; // Get the assignments for this class.
19+
create_assignment: () => AssignmentInterface; // Create a new assignment.
20+
21+
get_all_groups: () => [GroupInterface]; // Get all existing groups that consist exclusively of students from this class.
22+
1423
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ClassInterface } from "./class_interface"
2+
import { UserInterface } from "./user_interface";
3+
4+
export interface JoinRequestsInterface {
5+
get_class: () => ClassInterface; // Get the class that the users request to join.
6+
get_join_requests: () => [UserInterface]; // Get one list with both all students wanting to join and all teachers wanting to join.
7+
accept: (student_or_teacher: UserInterface) => void; // Accept a teacher or student (from the join request list) to enter the class.
8+
deny: (student_or_teacher: UserInterface) => void; // Deny a teacher or student (from the join request list) to enter the class.
9+
}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import { ClassInterface } from "./class_interface";
1+
import { AssignmentInterface } from "./assignment_interface";
2+
import { UserInterface } from "./user_interface";
23

3-
export interface StudentInterface {
4-
// Necessary variables
5-
id: string; // User id
6-
email: string; // User's email
7-
first_name: string; // User's first name
8-
family_name: string; // User's family name
9-
password_hash: string; // User's hashed password
10-
get_classes: () => [ClassInterface];
4+
export interface StudentInterface extends UserInterface {
5+
ask_question_for_assignment: (assignment: AssignmentInterface) => void; // TODO: correct arguments.
6+
send_submission_for_assignment: (assignment: AssignmentInterface) => void;
117
}

backend/src/core/entities/teacher.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export class Teacher implements TeacherInterface {
1010
family_name: string; // Teacher's family name
1111
password_hash: string; // Teacher's hashed password
1212
get_classes: () => [ClassInterface];
13+
create_class: () => ClassInterface;
1314

1415
// Optional variables
1516
name_school?: string; // Teacher's school
@@ -21,6 +22,7 @@ export class Teacher implements TeacherInterface {
2122
family_name: string,
2223
password_hash: string,
2324
get_classes: () => [ClassInterface],
25+
create_class: () => ClassInterface,
2426
name_school?: string) {
2527
this.id = id;
2628
this.email = email;
@@ -29,5 +31,7 @@ export class Teacher implements TeacherInterface {
2931
this.password_hash = password_hash;
3032
this.name_school = name_school;
3133
this.get_classes = get_classes;
34+
this.create_class = create_class;
3235
}
36+
3337
}
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { ClassInterface } from "./class_interface";
2+
import { UserInterface } from "./user_interface";
23

3-
export interface TeacherInterface {
4-
// Necessary variables
5-
id: string; // Teacher id
6-
email: string; // Teacher's email
7-
first_name: string; // Teacher's first name
8-
family_name: string; // Teacher's family name
9-
password_hash: string; // Teacher's hashed password
10-
get_classes: () => [ClassInterface]
11-
4+
export interface TeacherInterface extends UserInterface{
125
// Optional variables
136
name_school?: string; // Teacher's school
7+
8+
create_class: () => ClassInterface;
149
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ClassInterface } from "./class_interface";
2+
3+
export interface UserInterface {
4+
// Necessary variables
5+
id: string; // User's id
6+
email: string; // User's email
7+
first_name: string; // User's first name
8+
family_name: string; // User's family name
9+
password_hash: string; // User's hashed password
10+
get_classes: () => [ClassInterface];
11+
}

0 commit comments

Comments
 (0)