feat(backend): Assignment-, Group- en SubmissionRepository aangemaakt
This commit is contained in:
parent
bd93e5fae3
commit
2837618fd5
8 changed files with 75 additions and 4 deletions
28
backend/src/entities/assignments/assignment.entity.ts
Normal file
28
backend/src/entities/assignments/assignment.entity.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import {Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property} from "@mikro-orm/core";
|
||||
import {Class} from "../classes/class.entity";
|
||||
import {Group} from "./group.entity"
|
||||
import {Language} from "../content/language";
|
||||
|
||||
@Entity()
|
||||
export class Assignment {
|
||||
@ManyToOne({entity: () => Class, primary: true})
|
||||
within!: Class;
|
||||
|
||||
@PrimaryKey({type: "number"})
|
||||
id!: number;
|
||||
|
||||
@Property({type: "string"})
|
||||
title!: string;
|
||||
|
||||
@Property({type: "text"})
|
||||
description!: string;
|
||||
|
||||
@Property({type: "string"})
|
||||
learningPathHruid!: string;
|
||||
|
||||
@Enum({items: () => Language})
|
||||
learningPathLanguage!: Language;
|
||||
|
||||
@OneToMany({entity: () => Group, mappedBy: "assignment"})
|
||||
groups!: Group[];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue