feat: gestart met implementeren van assignment service en controller laag
This commit is contained in:
parent
241fe0103f
commit
cfd0cce2df
8 changed files with 92 additions and 25 deletions
25
backend/src/interfaces/assignments.ts
Normal file
25
backend/src/interfaces/assignments.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { Assignment } from "../entities/assignments/assignment.entity";
|
||||
import { Class } from "../entities/classes/class.entity";
|
||||
import { GroupDTO } from "./groups";
|
||||
|
||||
export interface AssignmentDTO {
|
||||
id: number,
|
||||
class: string, // id of class 'within'
|
||||
title: string,
|
||||
description: string,
|
||||
learningPath: string,
|
||||
language: string,
|
||||
groups?: GroupDTO[], // TODO
|
||||
}
|
||||
|
||||
export function mapToAssignmentDTO(assignment: Assignment, cls: Class): AssignmentDTO {
|
||||
return {
|
||||
id: assignment.id,
|
||||
class: cls.classId,
|
||||
title: assignment.title,
|
||||
description: assignment.description,
|
||||
learningPath: assignment.learningPathHruid,
|
||||
language: assignment.learningPathLanguage,
|
||||
//groups: assignment.groups.map(mapToGroupDTO),
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue