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
|
@ -11,9 +11,18 @@ import { Group } from './group.entity.js';
|
|||
import { Language } from '../content/language.js';
|
||||
import { AssignmentRepository } from '../../data/assignments/assignment-repository.js';
|
||||
|
||||
@Entity({ repository: () => AssignmentRepository })
|
||||
@Entity({
|
||||
repository: () => {
|
||||
return AssignmentRepository;
|
||||
},
|
||||
})
|
||||
export class Assignment {
|
||||
@ManyToOne({ entity: () => Class, primary: true })
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return Class;
|
||||
},
|
||||
primary: true,
|
||||
})
|
||||
within!: Class;
|
||||
|
||||
@PrimaryKey({ type: 'number' })
|
||||
|
@ -28,9 +37,18 @@ export class Assignment {
|
|||
@Property({ type: 'string' })
|
||||
learningPathHruid!: string;
|
||||
|
||||
@Enum({ items: () => Language })
|
||||
@Enum({
|
||||
items: () => {
|
||||
return Language;
|
||||
},
|
||||
})
|
||||
learningPathLanguage!: Language;
|
||||
|
||||
@OneToMany({ entity: () => Group, mappedBy: 'assignment' })
|
||||
@OneToMany({
|
||||
entity: () => {
|
||||
return Group;
|
||||
},
|
||||
mappedBy: 'assignment',
|
||||
})
|
||||
groups!: Group[];
|
||||
}
|
||||
|
|
|
@ -3,14 +3,27 @@ import { Assignment } from './assignment.entity.js';
|
|||
import { Student } from '../users/student.entity.js';
|
||||
import { GroupRepository } from '../../data/assignments/group-repository.js';
|
||||
|
||||
@Entity({ repository: () => GroupRepository })
|
||||
@Entity({
|
||||
repository: () => {
|
||||
return GroupRepository;
|
||||
},
|
||||
})
|
||||
export class Group {
|
||||
@ManyToOne({ entity: () => Assignment, primary: true })
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return Assignment;
|
||||
},
|
||||
primary: true,
|
||||
})
|
||||
assignment!: Assignment;
|
||||
|
||||
@PrimaryKey({ type: 'integer' })
|
||||
groupNumber!: number;
|
||||
|
||||
@ManyToMany({ entity: () => Student })
|
||||
@ManyToMany({
|
||||
entity: () => {
|
||||
return Student;
|
||||
},
|
||||
})
|
||||
members!: Student[];
|
||||
}
|
||||
|
|
|
@ -4,12 +4,21 @@ import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
|||
import { Language } from '../content/language.js';
|
||||
import { SubmissionRepository } from '../../data/assignments/submission-repository.js';
|
||||
|
||||
@Entity({ repository: () => SubmissionRepository })
|
||||
@Entity({
|
||||
repository: () => {
|
||||
return SubmissionRepository;
|
||||
},
|
||||
})
|
||||
export class Submission {
|
||||
@PrimaryKey({ type: 'string' })
|
||||
learningObjectHruid!: string;
|
||||
|
||||
@Enum({ items: () => Language, primary: true })
|
||||
@Enum({
|
||||
items: () => {
|
||||
return Language;
|
||||
},
|
||||
primary: true,
|
||||
})
|
||||
learningObjectLanguage!: Language;
|
||||
|
||||
@PrimaryKey({ type: 'string' })
|
||||
|
@ -18,13 +27,22 @@ export class Submission {
|
|||
@PrimaryKey({ type: 'integer' })
|
||||
submissionNumber!: number;
|
||||
|
||||
@ManyToOne({ entity: () => Student })
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return Student;
|
||||
},
|
||||
})
|
||||
submitter!: Student;
|
||||
|
||||
@Property({ type: 'datetime' })
|
||||
submissionTime!: Date;
|
||||
|
||||
@ManyToOne({ entity: () => Group, nullable: true })
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return Group;
|
||||
},
|
||||
nullable: true,
|
||||
})
|
||||
onBehalfOf?: Group;
|
||||
|
||||
@Property({ type: 'json' })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue