Merge branch 'dev' into refactor/common
This commit is contained in:
commit
a4408b5bc0
145 changed files with 3437 additions and 2822 deletions
|
@ -1,28 +1,12 @@
|
|||
import { Embeddable, Embedded, Entity, Enum, ManyToMany, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Embedded, Entity, Enum, ManyToMany, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Language } from 'dwengo-1-common/src/util/language.js';
|
||||
import { Attachment } from './attachment.entity.js';
|
||||
import { Teacher } from '../users/teacher.entity.js';
|
||||
import { DwengoContentType } from '../../services/learning-objects/processing/content-type.js';
|
||||
import { v4 } from 'uuid';
|
||||
import { LearningObjectRepository } from '../../data/content/learning-object-repository.js';
|
||||
import { Language } from 'dwengo-1-common/src/util/language.js';
|
||||
|
||||
@Embeddable()
|
||||
export class EducationalGoal {
|
||||
@Property({ type: 'string' })
|
||||
source!: string;
|
||||
|
||||
@Property({ type: 'string' })
|
||||
id!: string;
|
||||
}
|
||||
|
||||
@Embeddable()
|
||||
export class ReturnValue {
|
||||
@Property({ type: 'string' })
|
||||
callbackUrl!: string;
|
||||
|
||||
@Property({ type: 'json' })
|
||||
callbackSchema!: string;
|
||||
}
|
||||
import { EducationalGoal } from './educational-goal.entity.js';
|
||||
import { ReturnValue } from './return-value.entity.js';
|
||||
|
||||
@Entity({ repository: () => LearningObjectRepository })
|
||||
export class LearningObject {
|
||||
|
@ -36,7 +20,7 @@ export class LearningObject {
|
|||
language!: Language;
|
||||
|
||||
@PrimaryKey({ type: 'number' })
|
||||
version: number = 1;
|
||||
version = 1;
|
||||
|
||||
@Property({ type: 'uuid', unique: true })
|
||||
uuid = v4();
|
||||
|
@ -62,7 +46,7 @@ export class LearningObject {
|
|||
targetAges?: number[] = [];
|
||||
|
||||
@Property({ type: 'bool' })
|
||||
teacherExclusive: boolean = false;
|
||||
teacherExclusive = false;
|
||||
|
||||
@Property({ type: 'array' })
|
||||
skosConcepts: string[] = [];
|
||||
|
@ -74,10 +58,10 @@ export class LearningObject {
|
|||
educationalGoals: EducationalGoal[] = [];
|
||||
|
||||
@Property({ type: 'string' })
|
||||
copyright: string = '';
|
||||
copyright = '';
|
||||
|
||||
@Property({ type: 'string' })
|
||||
license: string = '';
|
||||
license = '';
|
||||
|
||||
@Property({ type: 'smallint', nullable: true })
|
||||
difficulty?: number;
|
||||
|
@ -91,7 +75,7 @@ export class LearningObject {
|
|||
returnValue!: ReturnValue;
|
||||
|
||||
@Property({ type: 'bool' })
|
||||
available: boolean = true;
|
||||
available = true;
|
||||
|
||||
@Property({ type: 'string', nullable: true })
|
||||
contentLocation?: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue