MERGE: dev ino feat/service-layer
This commit is contained in:
commit
6404335040
220 changed files with 12582 additions and 10400 deletions
|
@ -1,7 +1,6 @@
|
|||
import { Collection, Entity, ManyToMany, ManyToOne, PrimaryKey } from '@mikro-orm/core';
|
||||
import { Assignment } from './assignment.entity.js';
|
||||
import { Student } from '../users/student.entity.js';
|
||||
import { GroupRepository } from '../../data/assignments/group-repository.js';
|
||||
|
||||
@Entity({
|
||||
repository: () => {
|
||||
|
@ -10,9 +9,7 @@ import { GroupRepository } from '../../data/assignments/group-repository.js';
|
|||
})
|
||||
export class Group {
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return Assignment;
|
||||
},
|
||||
entity: () => Assignment,
|
||||
primary: true,
|
||||
})
|
||||
assignment!: Assignment;
|
||||
|
@ -20,8 +17,8 @@ export class Group {
|
|||
@PrimaryKey({ type: 'integer', autoincrement: true })
|
||||
groupNumber?: number;
|
||||
|
||||
@ManyToMany(() => {
|
||||
return Student;
|
||||
@ManyToMany({
|
||||
entity: () => Student,
|
||||
})
|
||||
members!: Collection<Student>;
|
||||
members!: Student[];
|
||||
}
|
||||
|
|
|
@ -4,33 +4,25 @@ 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: () => {
|
||||
return SubmissionRepository;
|
||||
},
|
||||
})
|
||||
@Entity({ repository: () => SubmissionRepository })
|
||||
export class Submission {
|
||||
@PrimaryKey({ type: 'string' })
|
||||
learningObjectHruid!: string;
|
||||
|
||||
@Enum({
|
||||
items: () => {
|
||||
return Language;
|
||||
},
|
||||
items: () => Language,
|
||||
primary: true,
|
||||
})
|
||||
learningObjectLanguage!: Language;
|
||||
|
||||
@PrimaryKey({ type: 'string' })
|
||||
learningObjectVersion: string = '1';
|
||||
@PrimaryKey({ type: 'numeric' })
|
||||
learningObjectVersion: number = 1;
|
||||
|
||||
@PrimaryKey({ type: 'integer' })
|
||||
submissionNumber!: number;
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return Student;
|
||||
},
|
||||
entity: () => Student,
|
||||
})
|
||||
submitter!: Student;
|
||||
|
||||
|
@ -38,9 +30,7 @@ export class Submission {
|
|||
submissionTime!: Date;
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => {
|
||||
return Group;
|
||||
},
|
||||
entity: () => Group,
|
||||
nullable: true,
|
||||
})
|
||||
onBehalfOf?: Group;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue