feat(backend): Question + Answer entities toegevoegd; kleine verbeteringen.

This commit is contained in:
Gerald Schmittinger 2025-02-23 16:48:06 +01:00
parent cdfe48d8c5
commit 2657e49ad6
6 changed files with 79 additions and 19 deletions

View 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;
}