fix: integratie user + errors gefixt zodat het runt + format
This commit is contained in:
parent
6c4ea0eefb
commit
1b096b411b
55 changed files with 858 additions and 594 deletions
|
@ -2,9 +2,18 @@ import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
|||
import { LearningObject } from './learning-object.entity.js';
|
||||
import { AttachmentRepository } from '../../data/content/attachment-repository.js';
|
||||
|
||||
@Entity({ repository: () => AttachmentRepository })
|
||||
@Entity({
|
||||
repository: () => {
|
||||
return AttachmentRepository;
|
||||
},
|
||||
})
|
||||
export class Attachment {
|
||||
@ManyToOne({ entity: () => LearningObject, primary: true })
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return LearningObject;
|
||||
},
|
||||
primary: true,
|
||||
})
|
||||
learningObject!: LearningObject;
|
||||
|
||||
@PrimaryKey({ type: 'integer' })
|
||||
|
|
|
@ -22,18 +22,31 @@ export class ReturnValue {
|
|||
callbackSchema!: string;
|
||||
}
|
||||
|
||||
@Entity({ repository: () => LearningObjectRepository })
|
||||
@Entity({
|
||||
repository: () => {
|
||||
return LearningObjectRepository;
|
||||
},
|
||||
})
|
||||
export class LearningObject {
|
||||
@PrimaryKey({ type: 'string' })
|
||||
hruid!: string;
|
||||
|
||||
@Enum({ items: () => Language, primary: true })
|
||||
@Enum({
|
||||
items: () => {
|
||||
return Language;
|
||||
},
|
||||
primary: true,
|
||||
})
|
||||
language!: Language;
|
||||
|
||||
@PrimaryKey({ type: 'string' })
|
||||
version: string = '1';
|
||||
|
||||
@ManyToMany({ entity: () => Teacher })
|
||||
@ManyToMany({
|
||||
entity: () => {
|
||||
return Teacher;
|
||||
},
|
||||
})
|
||||
admins!: Teacher[];
|
||||
|
||||
@Property({ type: 'string' })
|
||||
|
@ -57,7 +70,12 @@ export class LearningObject {
|
|||
@Property({ type: 'array' })
|
||||
skosConcepts!: string[];
|
||||
|
||||
@Embedded({ entity: () => EducationalGoal, array: true })
|
||||
@Embedded({
|
||||
entity: () => {
|
||||
return EducationalGoal;
|
||||
},
|
||||
array: true,
|
||||
})
|
||||
educationalGoals: EducationalGoal[] = [];
|
||||
|
||||
@Property({ type: 'string' })
|
||||
|
@ -72,7 +90,11 @@ export class LearningObject {
|
|||
@Property({ type: 'integer' })
|
||||
estimatedTime!: number;
|
||||
|
||||
@Embedded({ entity: () => ReturnValue })
|
||||
@Embedded({
|
||||
entity: () => {
|
||||
return ReturnValue;
|
||||
},
|
||||
})
|
||||
returnValue!: ReturnValue;
|
||||
|
||||
@Property({ type: 'bool' })
|
||||
|
@ -81,7 +103,12 @@ export class LearningObject {
|
|||
@Property({ type: 'string', nullable: true })
|
||||
contentLocation?: string;
|
||||
|
||||
@OneToMany({ entity: () => Attachment, mappedBy: 'learningObject' })
|
||||
@OneToMany({
|
||||
entity: () => {
|
||||
return Attachment;
|
||||
},
|
||||
mappedBy: 'learningObject',
|
||||
})
|
||||
attachments: Attachment[] = [];
|
||||
|
||||
@Property({ type: 'blob' })
|
||||
|
|
|
@ -12,15 +12,28 @@ import { Language } from './language.js';
|
|||
import { Teacher } from '../users/teacher.entity.js';
|
||||
import { LearningPathRepository } from '../../data/content/learning-path-repository.js';
|
||||
|
||||
@Entity({ repository: () => LearningPathRepository })
|
||||
@Entity({
|
||||
repository: () => {
|
||||
return LearningPathRepository;
|
||||
},
|
||||
})
|
||||
export class LearningPath {
|
||||
@PrimaryKey({ type: 'string' })
|
||||
hruid!: string;
|
||||
|
||||
@Enum({ items: () => Language, primary: true })
|
||||
@Enum({
|
||||
items: () => {
|
||||
return Language;
|
||||
},
|
||||
primary: true,
|
||||
})
|
||||
language!: Language;
|
||||
|
||||
@ManyToMany({ entity: () => Teacher })
|
||||
@ManyToMany({
|
||||
entity: () => {
|
||||
return Teacher;
|
||||
},
|
||||
})
|
||||
admins!: Teacher[];
|
||||
|
||||
@Property({ type: 'string' })
|
||||
|
@ -32,7 +45,12 @@ export class LearningPath {
|
|||
@Property({ type: 'blob' })
|
||||
image!: string;
|
||||
|
||||
@Embedded({ entity: () => LearningPathNode, array: true })
|
||||
@Embedded({
|
||||
entity: () => {
|
||||
return LearningPathNode;
|
||||
},
|
||||
array: true,
|
||||
})
|
||||
nodes: LearningPathNode[] = [];
|
||||
}
|
||||
|
||||
|
@ -41,7 +59,11 @@ export class LearningPathNode {
|
|||
@Property({ type: 'string' })
|
||||
learningObjectHruid!: string;
|
||||
|
||||
@Enum({ items: () => Language })
|
||||
@Enum({
|
||||
items: () => {
|
||||
return Language;
|
||||
},
|
||||
})
|
||||
language!: Language;
|
||||
|
||||
@Property({ type: 'string' })
|
||||
|
@ -53,7 +75,12 @@ export class LearningPathNode {
|
|||
@Property({ type: 'bool' })
|
||||
startNode!: boolean;
|
||||
|
||||
@Embedded({ entity: () => LearningPathTransition, array: true })
|
||||
@Embedded({
|
||||
entity: () => {
|
||||
return LearningPathTransition;
|
||||
},
|
||||
array: true,
|
||||
})
|
||||
transitions!: LearningPathTransition[];
|
||||
}
|
||||
|
||||
|
@ -62,6 +89,10 @@ export class LearningPathTransition {
|
|||
@Property({ type: 'string' })
|
||||
condition!: string;
|
||||
|
||||
@OneToOne({ entity: () => LearningPathNode })
|
||||
@OneToOne({
|
||||
entity: () => {
|
||||
return LearningPathNode;
|
||||
},
|
||||
})
|
||||
next!: LearningPathNode;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue