File tree Expand file tree Collapse file tree 8 files changed +86
-8
lines changed
backend/src/core/entities Expand file tree Collapse file tree 8 files changed +86
-8
lines changed Original file line number Diff line number Diff line change 1+ import { GroupInterface } from "./group_interface" ;
2+
3+ export interface AssignmentInterface {
4+ id : string ;
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 ] ;
15+
16+ }
Original file line number Diff line number Diff line change 1+ import { AssignmentInterface } from "./assignment_interface" ;
2+ import { GroupInterface } from "./group_interface" ;
3+ import { StudentInterface } from "./student_interface" ;
4+ import { TeacherInterface } from "./teacher_interface" ;
5+
6+ export interface ClassInterface {
7+ id : string ;
8+ name : string ;
9+ year : number ;
10+
11+ set_year : ( new_year : number ) => void ;
12+ set_name : ( new_name : string ) => void ;
13+
14+ get_teachers : ( ) => [ TeacherInterface ] ; // Get this class' teachers.
15+ 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+
23+ }
Original file line number Diff line number Diff line change 1+ import { ClassInterface } from "./class_interface" ;
2+
3+ export interface GroupInterface {
4+ id : string ;
5+ class : ClassInterface ;
6+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ import { AssignmentInterface } from "./assignment_interface" ;
2+ import { UserInterface } from "./user_interface" ;
3+
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 ;
7+ }
Original file line number Diff line number Diff line change 1- import { ITeacher } from "./teacher_interface" ;
1+ import { ClassInterface } from "./class_interface" ;
2+ import { TeacherInterface } from "./teacher_interface" ;
23
34export class Teacher implements ITeacher {
45
@@ -8,6 +9,8 @@ export class Teacher implements ITeacher {
89 first_name : string ; // Teacher's first name
910 family_name : string ; // Teacher's family name
1011 password_hash : string ; // Teacher's hashed password
12+ get_classes : ( ) => [ ClassInterface ] ;
13+ create_class : ( ) => ClassInterface ;
1114
1215 // Optional variables
1316 name_school ?: string ; // Teacher's school
@@ -18,12 +21,17 @@ export class Teacher implements ITeacher {
1821 first_name : string ,
1922 family_name : string ,
2023 password_hash : string ,
24+ get_classes : ( ) => [ ClassInterface ] ,
25+ create_class : ( ) => ClassInterface ,
2126 name_school ?: string ) {
2227 this . id = id ;
2328 this . email = email ;
2429 this . first_name = first_name ;
2530 this . family_name = family_name ;
2631 this . password_hash = password_hash ;
2732 this . name_school = name_school ;
33+ this . get_classes = get_classes ;
34+ this . create_class = create_class ;
2835 }
36+
2937}
Original file line number Diff line number Diff line change 1- export interface ITeacher {
2- // Necessary variables
3- id : string ; // Teacher id
4- email : string ; // Teacher's email
5- first_name : string ; // Teacher's first name
6- family_name : string ; // Teacher's family name
7- password_hash : string ; // Teacher's hashed password
1+ import { ClassInterface } from "./class_interface" ;
2+ import { UserInterface } from "./user_interface" ;
83
4+ export interface TeacherInterface extends UserInterface {
95 // Optional variables
106 name_school ?: string ; // Teacher's school
7+
8+ create_class : ( ) => ClassInterface ;
119}
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments