fix(backend): Foute entity-structuur van leerpaden verbeterd.

Ook testen geschreven voor LearningPathRepository en LearningObjectRepository.
This commit is contained in:
Gerald Schmittinger 2025-03-09 08:50:39 +01:00
parent 4d999c78ba
commit 1417907933
24 changed files with 474 additions and 64 deletions

View file

@ -0,0 +1,24 @@
import {Language} from "../../../src/entities/content/language";
import {LearningPathTransition} from "../../../src/entities/content/learning-path-transition.entity";
import {LearningPathNode} from "../../../src/entities/content/learning-path-node.entity";
export function createLearningPathTransition(condition: string | null, to: LearningPathNode) {
let trans = new LearningPathTransition();
trans.condition = condition || "true";
trans.next = to;
return trans;
}
export function createLearningPathNode(
learningObjectHruid: string,
version: number,
language: Language,
startNode: boolean
) {
let node = new LearningPathNode();
node.learningObjectHruid = learningObjectHruid;
node.version = version;
node.language = language;
node.startNode = startNode;
return node;
}