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:
parent
62a278a6e0
commit
d5101737ef
14 changed files with 289 additions and 7 deletions
50
backend/src/entities/content/learning-path.entity.ts
Normal file
50
backend/src/entities/content/learning-path.entity.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue