style: fix linting issues met ESLint

This commit is contained in:
Lint Action 2025-03-06 13:37:39 +00:00
parent 710adcaa34
commit b8aae0ab1b
17 changed files with 46 additions and 136 deletions

View file

@ -5,9 +5,7 @@ import { Student } from '../users/student.entity.js';
@Entity()
export class Group {
@ManyToOne({
entity: () => {
return Assignment;
},
entity: () => Assignment,
primary: true,
})
assignment!: Assignment;
@ -16,9 +14,7 @@ export class Group {
groupNumber!: number;
@ManyToMany({
entity: () => {
return Student;
},
entity: () => Student,
})
members!: Student[];
}

View file

@ -9,9 +9,7 @@ export class Submission {
learningObjectHruid!: string;
@Enum({
items: () => {
return Language;
},
items: () => Language,
primary: true,
})
learningObjectLanguage!: Language;
@ -23,9 +21,7 @@ export class Submission {
submissionNumber!: number;
@ManyToOne({
entity: () => {
return Student;
},
entity: () => Student,
})
submitter!: Student;
@ -33,9 +29,7 @@ export class Submission {
submissionTime!: Date;
@ManyToOne({
entity: () => {
return Group;
},
entity: () => Group,
nullable: true,
})
onBehalfOf?: Group;

View file

@ -5,24 +5,18 @@ import { Class } from './class.entity.js';
@Entity()
export class ClassJoinRequest {
@ManyToOne({
entity: () => {
return Student;
},
entity: () => Student,
primary: true,
})
requester!: Student;
@ManyToOne({
entity: () => {
return Class;
},
entity: () => Class,
primary: true,
})
class!: Class;
@Enum(() => {
return ClassJoinRequestStatus;
})
@Enum(() => ClassJoinRequestStatus)
status!: ClassJoinRequestStatus;
}

View file

@ -17,13 +17,9 @@ export class Class {
@Property({ type: 'string' })
displayName!: string;
@ManyToMany(() => {
return Teacher;
})
@ManyToMany(() => Teacher)
teachers!: Collection<Teacher>;
@ManyToMany(() => {
return Student;
})
@ManyToMany(() => Student)
students!: Collection<Student>;
}

View file

@ -8,25 +8,19 @@ import { Class } from './class.entity.js';
@Entity()
export class TeacherInvitation {
@ManyToOne({
entity: () => {
return Teacher;
},
entity: () => Teacher,
primary: true,
})
sender!: Teacher;
@ManyToOne({
entity: () => {
return Teacher;
},
entity: () => Teacher,
primary: true,
})
receiver!: Teacher;
@ManyToOne({
entity: () => {
return Class;
},
entity: () => Class,
primary: true,
})
class!: Class;

View file

@ -4,9 +4,7 @@ import { LearningObject } from './learning-object.entity.js';
@Entity()
export class Attachment {
@ManyToOne({
entity: () => {
return LearningObject;
},
entity: () => LearningObject,
primary: true,
})
learningObject!: LearningObject;

View file

@ -18,9 +18,7 @@ export class LearningObject {
hruid!: string;
@Enum({
items: () => {
return Language;
},
items: () => Language,
primary: true,
})
language!: Language;
@ -29,9 +27,7 @@ export class LearningObject {
version: string = '1';
@ManyToMany({
entity: () => {
return Teacher;
},
entity: () => Teacher,
})
admins!: Teacher[];
@ -57,9 +53,7 @@ export class LearningObject {
skosConcepts!: string[];
@Embedded({
entity: () => {
return EducationalGoal;
},
entity: () => EducationalGoal,
array: true,
})
educationalGoals: EducationalGoal[] = [];
@ -77,9 +71,7 @@ export class LearningObject {
estimatedTime!: number;
@Embedded({
entity: () => {
return ReturnValue;
},
entity: () => ReturnValue,
})
returnValue!: ReturnValue;
@ -90,9 +82,7 @@ export class LearningObject {
contentLocation?: string;
@OneToMany({
entity: () => {
return Attachment;
},
entity: () => Attachment,
mappedBy: 'learningObject',
})
attachments: Attachment[] = [];

View file

@ -17,17 +17,13 @@ export class LearningPath {
hruid!: string;
@Enum({
items: () => {
return Language;
},
items: () => Language,
primary: true,
})
language!: Language;
@ManyToMany({
entity: () => {
return Teacher;
},
entity: () => Teacher,
})
admins!: Teacher[];
@ -41,9 +37,7 @@ export class LearningPath {
image!: string;
@Embedded({
entity: () => {
return LearningPathNode;
},
entity: () => LearningPathNode,
array: true,
})
nodes: LearningPathNode[] = [];
@ -55,9 +49,7 @@ export class LearningPathNode {
learningObjectHruid!: string;
@Enum({
items: () => {
return Language;
},
items: () => Language,
})
language!: Language;
@ -71,9 +63,7 @@ export class LearningPathNode {
startNode!: boolean;
@Embedded({
entity: () => {
return LearningPathTransition;
},
entity: () => LearningPathTransition,
array: true,
})
transitions!: LearningPathTransition[];
@ -85,9 +75,7 @@ export class LearningPathTransition {
condition!: string;
@OneToOne({
entity: () => {
return LearningPathNode;
},
entity: () => LearningPathNode,
})
next!: LearningPathNode;
}

View file

@ -5,17 +5,13 @@ import { Teacher } from '../users/teacher.entity.js';
@Entity()
export class Answer {
@ManyToOne({
entity: () => {
return Teacher;
},
entity: () => Teacher,
primary: true,
})
author!: Teacher;
@ManyToOne({
entity: () => {
return Question;
},
entity: () => Question,
primary: true,
})
toQuestion!: Question;

View file

@ -8,9 +8,7 @@ export class Question {
learningObjectHruid!: string;
@Enum({
items: () => {
return Language;
},
items: () => Language,
primary: true,
})
learningObjectLanguage!: Language;
@ -22,9 +20,7 @@ export class Question {
sequenceNumber!: number;
@ManyToOne({
entity: () => {
return Student;
},
entity: () => Student,
})
author!: Student;

View file

@ -5,19 +5,13 @@ import { Group } from '../assignments/group.entity.js';
import { StudentRepository } from '../../data/users/student-repository.js';
@Entity({
repository: () => {
return StudentRepository;
},
repository: () => StudentRepository,
})
export class Student extends User {
@ManyToMany(() => {
return Class;
})
@ManyToMany(() => Class)
classes!: Collection<Class>;
@ManyToMany(() => {
return Group;
})
@ManyToMany(() => Group)
groups!: Collection<Group>;
constructor(

View file

@ -4,8 +4,6 @@ import { Class } from '../classes/class.entity.js';
@Entity()
export class Teacher extends User {
@ManyToMany(() => {
return Class;
})
@ManyToMany(() => Class)
classes!: Collection<Class>;
}