Merge branch 'feat/service-layer' into feat/service-layer-adriaan

# Conflicts:
#	backend/src/controllers/classes.ts
#	backend/src/controllers/students.ts
#	backend/src/data/users/teacher-repository.ts
#	backend/src/interfaces/assignment.ts
#	backend/src/interfaces/teacher.ts
#	backend/src/routes/classes.ts
#	backend/src/services/assignments.ts
#	backend/src/services/class.ts
#	backend/src/services/students.ts
#	backend/src/util/translation-helper.ts
This commit is contained in:
Gabriellvl 2025-03-09 22:30:15 +01:00
commit 6c4ea0eefb
33 changed files with 454 additions and 137 deletions

View file

@ -0,0 +1,32 @@
import { Student } from "../entities/users/student.entity.js";
export interface StudentDTO {
id: string;
username: string;
firstName: string;
lastName: string;
endpoints?: {
classes: string;
questions: string;
invitations: string;
groups: string;
};
}
export function mapToStudentDTO(student: Student): StudentDTO {
return {
id: student.username,
username: student.username,
firstName: student.firstName,
lastName: student.lastName,
};
}
export function mapToStudent(studentData: StudentDTO): Student {
const student = new Student();
student.username = studentData.username;
student.firstName = studentData.firstName;
student.lastName = studentData.lastName;
return student;
}