feat(backend): Entities toegevoegd

Entites Class, Class Join Request, Class Invitation, Assignment, Group en entities om de Dwengo-leerinhoud te modelleren, toegevoegd.
This commit is contained in:
Gerald Schmittinger 2025-02-23 10:02:19 +01:00
parent 62a278a6e0
commit d5101737ef
14 changed files with 289 additions and 7 deletions

View file

@ -0,0 +1,50 @@
import {Embeddable, Embedded, Entity, Enum, OneToOne, Property} from "@mikro-orm/core";
import {Language} from "./language";
@Entity()
export class LearningPath {
@Enum({items: () => Language})
language!: Language;
@Property({type: "string"})
title!: string;
@Property({type: "longtext"})
description!: string;
@Property({type: "blob"})
image!: string;
@Embedded({entity: () => LearningPathNode, array: true})
nodes: LearningPathNode[];
}
@Embeddable()
export class LearningPathNode {
@Property({type: "string"})
learningObjectHruid!: string;
@Enum({items: () => Language})
language!: Language;
@Property({type: "string"})
version!: string;
@Property({type: "longtext"})
instruction!: string;
@Property({type: "bool"})
startNode!: boolean;
@Embedded({entity: () => LearningPathTransition, array: true})
transitions!: LearningPathTransition[];
}
@Embeddable()
export class LearningPathTransition {
@Property({type: "string"})
condition!: string;
@OneToOne({entity: () => LearningPathNode})
next!: LearningPathNode;
}