fix: integratie user + errors gefixt zodat het runt + format

This commit is contained in:
Gabriellvl 2025-03-09 23:59:31 +01:00
parent 6c4ea0eefb
commit 1b096b411b
55 changed files with 858 additions and 594 deletions

View file

@ -3,15 +3,31 @@ import { Student } from '../users/student.entity.js';
import { Class } from './class.entity.js';
import { ClassJoinRequestRepository } from '../../data/classes/class-join-request-repository.js';
@Entity({ repository: () => ClassJoinRequestRepository })
@Entity({
repository: () => {
return ClassJoinRequestRepository;
},
})
export class ClassJoinRequest {
@ManyToOne({ entity: () => Student, primary: true })
@ManyToOne({
entity: () => {
return Student;
},
primary: true,
})
requester!: Student;
@ManyToOne({ entity: () => Class, primary: true })
@ManyToOne({
entity: () => {
return Class;
},
primary: true,
})
class!: Class;
@Enum(() => ClassJoinRequestStatus)
@Enum(() => {
return ClassJoinRequestStatus;
})
status!: ClassJoinRequestStatus;
}

View file

@ -10,7 +10,11 @@ import { Teacher } from '../users/teacher.entity.js';
import { Student } from '../users/student.entity.js';
import { ClassRepository } from '../../data/classes/class-repository.js';
@Entity({ repository: () => ClassRepository })
@Entity({
repository: () => {
return ClassRepository;
},
})
export class Class {
@PrimaryKey()
classId = v4();
@ -18,9 +22,13 @@ export class Class {
@Property({ type: 'string' })
displayName!: string;
@ManyToMany(() => Teacher)
@ManyToMany(() => {
return Teacher;
})
teachers!: Collection<Teacher>;
@ManyToMany(() => Student)
@ManyToMany(() => {
return Student;
})
students!: Collection<Student>;
}

View file

@ -6,14 +6,33 @@ import { TeacherInvitationRepository } from '../../data/classes/teacher-invitati
/**
* Invitation of a teacher into a class (in order to teach it).
*/
@Entity({ repository: () => TeacherInvitationRepository })
@Entity({
repository: () => {
return TeacherInvitationRepository;
},
})
export class TeacherInvitation {
@ManyToOne({ entity: () => Teacher, primary: true })
@ManyToOne({
entity: () => {
return Teacher;
},
primary: true,
})
sender!: Teacher;
@ManyToOne({ entity: () => Teacher, primary: true })
@ManyToOne({
entity: () => {
return Teacher;
},
primary: true,
})
receiver!: Teacher;
@ManyToOne({ entity: () => Class, primary: true })
@ManyToOne({
entity: () => {
return Class;
},
primary: true,
})
class!: Class;
}