fix: import errors van gabe gefixt, teacher en student abstractie weggedaan
This commit is contained in:
parent
6404335040
commit
b5390258e3
36 changed files with 9754 additions and 180 deletions
33
backend/src/interfaces/teacher.ts
Normal file
33
backend/src/interfaces/teacher.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { Teacher } from '../entities/users/teacher.entity.js';
|
||||
|
||||
export interface TeacherDTO {
|
||||
id: string;
|
||||
username: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
endpoints?: {
|
||||
classes: string;
|
||||
questions: string;
|
||||
invitations: string;
|
||||
groups: string;
|
||||
};
|
||||
}
|
||||
|
||||
export function mapToTeacherDTO(teacher: Teacher): TeacherDTO {
|
||||
return {
|
||||
id: teacher.username,
|
||||
username: teacher.username,
|
||||
firstName: teacher.firstName,
|
||||
lastName: teacher.lastName,
|
||||
};
|
||||
}
|
||||
|
||||
export function mapToTeacher(TeacherData: TeacherDTO): Teacher {
|
||||
const teacher = new Teacher(
|
||||
TeacherData.username,
|
||||
TeacherData.firstName,
|
||||
TeacherData.lastName,
|
||||
);
|
||||
|
||||
return teacher;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue