feat: service en controller laag voor getStudent geimplementeerd

This commit is contained in:
Adriaan Jacquet 2025-03-04 12:31:12 +01:00
parent 8c22b72b22
commit f5b6a5a604
5 changed files with 459 additions and 2917 deletions

View file

@ -0,0 +1,18 @@
import { getStudentRepository } from "../data/repositories";
import { StudentDTO } from "../interfaces/students";
export async function getStudentById(username: string): Promise<StudentDTO | null> {
const studentRepository = getStudentRepository();
const student = await studentRepository.findByUsername(username);
if (!student) return null;
else {
return {
id: student.username,
username: student.username,
firstName: student.firstName,
lastName: student.lastName,
}
}
}