fix(backend): Fouten in LearningObject entity verbeterd.

This commit is contained in:
Gerald Schmittinger 2025-02-26 00:41:36 +01:00
parent 71843dad65
commit cf97a3af84

View file

@ -4,7 +4,7 @@ import {Attachment} from "./attachment.entity";
import {Teacher} from "../users/teacher.entity"; import {Teacher} from "../users/teacher.entity";
@Entity() @Entity()
export class LearningObject<R> { export class LearningObject {
@PrimaryKey({type: "string"}) @PrimaryKey({type: "string"})
hruid!: string; hruid!: string;
@ -12,7 +12,7 @@ export class LearningObject<R> {
language!: Language; language!: Language;
@PrimaryKey({type: "string"}) @PrimaryKey({type: "string"})
version: number = "1"; version: string = "1";
@ManyToMany({entity: () => Teacher}) @ManyToMany({entity: () => Teacher})
admins!: Teacher[]; admins!: Teacher[];
@ -54,7 +54,7 @@ export class LearningObject<R> {
estimatedTime!: number; estimatedTime!: number;
@Embedded({entity: () => ReturnValue}) @Embedded({entity: () => ReturnValue})
returnValue: ReturnValue<R>; returnValue!: ReturnValue;
@Property({type: "bool"}) @Property({type: "bool"})
available: boolean = true; available: boolean = true;
@ -66,25 +66,25 @@ export class LearningObject<R> {
attachments: Attachment[] = []; attachments: Attachment[] = [];
@Property({type: "blob"}) @Property({type: "blob"})
content: Buffer; content!: Buffer;
} }
@Embeddable() @Embeddable()
export class EducationalGoal { export class EducationalGoal {
@Property({type: "string"}) @Property({type: "string"})
source: string; source!: string;
@Property({type: "string"}) @Property({type: "string"})
id: string; id!: string;
} }
@Embeddable() @Embeddable()
export class ReturnValue<R> { export class ReturnValue {
@Property({type: "string"}) @Property({type: "string"})
callbackUrl: string; callbackUrl!: string;
@Property({type: "json"}) @Property({type: "json"})
callbackSchema: R; callbackSchema!: string;
} }
export enum ContentType { export enum ContentType {