merge: fixed merge conflicts
This commit is contained in:
commit
90f43e74ba
101 changed files with 2156 additions and 1470 deletions
|
@ -6,6 +6,9 @@ import { Language } from '@dwengo-1/common/util/language';
|
|||
|
||||
@Entity({ repository: () => SubmissionRepository })
|
||||
export class Submission {
|
||||
@PrimaryKey({ type: 'integer', autoincrement: true })
|
||||
submissionNumber?: number;
|
||||
|
||||
@PrimaryKey({ type: 'string' })
|
||||
learningObjectHruid!: string;
|
||||
|
||||
|
@ -15,12 +18,9 @@ export class Submission {
|
|||
})
|
||||
learningObjectLanguage!: Language;
|
||||
|
||||
@PrimaryKey({ type: 'numeric' })
|
||||
@PrimaryKey({ type: 'numeric', autoincrement: false })
|
||||
learningObjectVersion = 1;
|
||||
|
||||
@PrimaryKey({ type: 'integer', autoincrement: true })
|
||||
submissionNumber?: number;
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => Group,
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Embedded, Entity, Enum, ManyToMany, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { ArrayType, Embedded, Entity, Enum, ManyToMany, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Attachment } from './attachment.entity.js';
|
||||
import { Teacher } from '../users/teacher.entity.js';
|
||||
import { DwengoContentType } from '../../services/learning-objects/processing/content-type.js';
|
||||
|
@ -42,7 +42,7 @@ export class LearningObject {
|
|||
@Property({ type: 'array' })
|
||||
keywords: string[] = [];
|
||||
|
||||
@Property({ type: 'array', nullable: true })
|
||||
@Property({ type: new ArrayType((i) => Number(i)), nullable: true })
|
||||
targetAges?: number[] = [];
|
||||
|
||||
@Property({ type: 'bool' })
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property, Rel } from '@mikro-orm/core';
|
||||
import { Collection, Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property, Rel } from '@mikro-orm/core';
|
||||
import { LearningPath } from './learning-path.entity.js';
|
||||
import { LearningPathTransition } from './learning-path-transition.entity.js';
|
||||
import { Language } from '@dwengo-1/common/util/language';
|
||||
|
||||
@Entity()
|
||||
export class LearningPathNode {
|
||||
@PrimaryKey({ type: 'integer', autoincrement: true })
|
||||
nodeNumber?: number;
|
||||
|
||||
@ManyToOne({ entity: () => LearningPath, primary: true })
|
||||
learningPath!: Rel<LearningPath>;
|
||||
|
||||
@PrimaryKey({ type: 'integer', autoincrement: true })
|
||||
nodeNumber!: number;
|
||||
|
||||
@Property({ type: 'string' })
|
||||
learningObjectHruid!: string;
|
||||
|
||||
|
@ -27,7 +27,7 @@ export class LearningPathNode {
|
|||
startNode!: boolean;
|
||||
|
||||
@OneToMany({ entity: () => LearningPathTransition, mappedBy: 'node' })
|
||||
transitions: LearningPathTransition[] = [];
|
||||
transitions!: Collection<LearningPathTransition>;
|
||||
|
||||
@Property({ length: 3 })
|
||||
createdAt: Date = new Date();
|
||||
|
|
|
@ -3,12 +3,12 @@ import { LearningPathNode } from './learning-path-node.entity.js';
|
|||
|
||||
@Entity()
|
||||
export class LearningPathTransition {
|
||||
@ManyToOne({ entity: () => LearningPathNode, primary: true })
|
||||
node!: Rel<LearningPathNode>;
|
||||
|
||||
@PrimaryKey({ type: 'numeric' })
|
||||
transitionNumber!: number;
|
||||
|
||||
@ManyToOne({ entity: () => LearningPathNode, primary: true })
|
||||
node!: Rel<LearningPathNode>;
|
||||
|
||||
@Property({ type: 'string' })
|
||||
condition!: string;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Entity, Enum, ManyToMany, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Collection, Entity, Enum, ManyToMany, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Teacher } from '../users/teacher.entity.js';
|
||||
import { LearningPathRepository } from '../../data/content/learning-path-repository.js';
|
||||
import { LearningPathNode } from './learning-path-node.entity.js';
|
||||
|
@ -25,5 +25,5 @@ export class LearningPath {
|
|||
image: Buffer | null = null;
|
||||
|
||||
@OneToMany({ entity: () => LearningPathNode, mappedBy: 'learningPath' })
|
||||
nodes: LearningPathNode[] = [];
|
||||
nodes: Collection<LearningPathNode> = new Collection<LearningPathNode>(this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue