feat: class/:id service en controller laag geimplementeerd (BEVAT NOG BUG)

This commit is contained in:
Adriaan Jacquet 2025-03-04 16:32:59 +01:00
parent ceef74f1af
commit e9d9e52f9d
5 changed files with 60 additions and 33 deletions

View file

@ -1,6 +1,4 @@
import { ClassJoinRequest } from "../entities/classes/class-join-request.entity";
import { Student } from "../entities/users/student.entity";
import { Teacher } from "../entities/users/teacher.entity";
import { Class } from "../entities/classes/class.entity";
export interface ClassDTO {
id: string;
@ -9,9 +7,19 @@ export interface ClassDTO {
students: string[];
joinRequests: string[];
endpoints?: {
classes: string;
questions: string;
self: string;
invitations: string;
groups: string;
assignments: string;
students: string;
};
}
export function mapToClassDTO(cls: Class): ClassDTO {
return {
id: cls.classId,
displayName: cls.displayName,
teachers: cls.teachers.map(teacher => teacher.username),
students: cls.students.map(student => student.username),
joinRequests: [], // TODO
}
};