feat(backend): Question + Answer entities toegevoegd; kleine verbeteringen.
This commit is contained in:
parent
cdfe48d8c5
commit
2657e49ad6
6 changed files with 79 additions and 19 deletions
24
backend/src/entities/questions/question.entity.ts
Normal file
24
backend/src/entities/questions/question.entity.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import {Entity, Enum, ManyToOne, PrimaryKey, Property} from "@mikro-orm/core";
|
||||
import {Language} from "../content/language";
|
||||
import {Student} from "../users/student.entity";
|
||||
|
||||
@Entity()
|
||||
export class Question {
|
||||
@ManyToOne({entity: () => Student, primary: true})
|
||||
author!: Student;
|
||||
|
||||
@PrimaryKey({type: "string"})
|
||||
learningObjectHruid!: string;
|
||||
|
||||
@Enum({items: () => Language, primary: true})
|
||||
learningObjectLanguage!: Language;
|
||||
|
||||
@PrimaryKey({type: "string"})
|
||||
learningObjectVersion!: number = "1";
|
||||
|
||||
@PrimaryKey({type: "datetime"})
|
||||
timestamp!: Date;
|
||||
|
||||
@Property({type: "text"})
|
||||
content!: string;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue