style: fix linting issues met Prettier
This commit is contained in:
		
							parent
							
								
									74765577d5
								
							
						
					
					
						commit
						17893a6990
					
				
					 53 changed files with 1350 additions and 1314 deletions
				
			
		|  | @ -12,7 +12,12 @@ import { Language } from '../content/language.js'; | |||
| 
 | ||||
| @Entity() | ||||
| export class Assignment { | ||||
|     @ManyToOne({ entity: () => {return Class}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Class; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     within!: Class; | ||||
| 
 | ||||
|     @PrimaryKey({ type: 'number' }) | ||||
|  | @ -27,9 +32,18 @@ export class Assignment { | |||
|     @Property({ type: 'string' }) | ||||
|     learningPathHruid!: string; | ||||
| 
 | ||||
|     @Enum({ items: () => {return Language} }) | ||||
|     @Enum({ | ||||
|         items: () => { | ||||
|             return Language; | ||||
|         }, | ||||
|     }) | ||||
|     learningPathLanguage!: Language; | ||||
| 
 | ||||
|     @OneToMany({ entity: () => {return Group}, mappedBy: 'assignment' }) | ||||
|     @OneToMany({ | ||||
|         entity: () => { | ||||
|             return Group; | ||||
|         }, | ||||
|         mappedBy: 'assignment', | ||||
|     }) | ||||
|     groups!: Group[]; | ||||
| } | ||||
|  |  | |||
|  | @ -4,12 +4,21 @@ import { Student } from '../users/student.entity.js'; | |||
| 
 | ||||
| @Entity() | ||||
| export class Group { | ||||
|     @ManyToOne({ entity: () => {return Assignment}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Assignment; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     assignment!: Assignment; | ||||
| 
 | ||||
|     @PrimaryKey({ type: 'integer' }) | ||||
|     groupNumber!: number; | ||||
| 
 | ||||
|     @ManyToMany({ entity: () => {return Student} }) | ||||
|     @ManyToMany({ | ||||
|         entity: () => { | ||||
|             return Student; | ||||
|         }, | ||||
|     }) | ||||
|     members!: Student[]; | ||||
| } | ||||
|  |  | |||
|  | @ -8,7 +8,12 @@ export class Submission { | |||
|     @PrimaryKey({ type: 'string' }) | ||||
|     learningObjectHruid!: string; | ||||
| 
 | ||||
|     @Enum({ items: () => {return Language}, primary: true }) | ||||
|     @Enum({ | ||||
|         items: () => { | ||||
|             return Language; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     learningObjectLanguage!: Language; | ||||
| 
 | ||||
|     @PrimaryKey({ type: 'string' }) | ||||
|  | @ -17,13 +22,22 @@ export class Submission { | |||
|     @PrimaryKey({ type: 'integer' }) | ||||
|     submissionNumber!: number; | ||||
| 
 | ||||
|     @ManyToOne({ entity: () => {return Student} }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Student; | ||||
|         }, | ||||
|     }) | ||||
|     submitter!: Student; | ||||
| 
 | ||||
|     @Property({ type: 'datetime' }) | ||||
|     submissionTime!: Date; | ||||
| 
 | ||||
|     @ManyToOne({ entity: () => {return Group}, nullable: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Group; | ||||
|         }, | ||||
|         nullable: true, | ||||
|     }) | ||||
|     onBehalfOf?: Group; | ||||
| 
 | ||||
|     @Property({ type: 'json' }) | ||||
|  |  | |||
|  | @ -4,13 +4,25 @@ import { Class } from './class.entity'; | |||
| 
 | ||||
| @Entity() | ||||
| export class ClassJoinRequest { | ||||
|     @ManyToOne({ entity: () => {return Student}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Student; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     requester!: Student; | ||||
| 
 | ||||
|     @ManyToOne({ entity: () => {return Class}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Class; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     class!: Class; | ||||
| 
 | ||||
|     @Enum(() => {return ClassJoinRequestStatus}) | ||||
|     @Enum(() => { | ||||
|         return ClassJoinRequestStatus; | ||||
|     }) | ||||
|     status!: ClassJoinRequestStatus; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -17,9 +17,13 @@ export class Class { | |||
|     @Property({ type: 'string' }) | ||||
|     displayName!: string; | ||||
| 
 | ||||
|     @ManyToMany(() => {return Teacher}) | ||||
|     @ManyToMany(() => { | ||||
|         return Teacher; | ||||
|     }) | ||||
|     teachers!: Collection<Teacher>; | ||||
| 
 | ||||
|     @ManyToMany(() => {return Student}) | ||||
|     @ManyToMany(() => { | ||||
|         return Student; | ||||
|     }) | ||||
|     students!: Collection<Student>; | ||||
| } | ||||
|  |  | |||
|  | @ -7,12 +7,27 @@ import { Class } from './class.entity.js'; | |||
|  */ | ||||
| @Entity() | ||||
| export class TeacherInvitation { | ||||
|     @ManyToOne({ entity: () => {return Teacher}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Teacher; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     sender!: Teacher; | ||||
| 
 | ||||
|     @ManyToOne({ entity: () => {return Teacher}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Teacher; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     receiver!: Teacher; | ||||
| 
 | ||||
|     @ManyToOne({ entity: () => {return Class}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Class; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     class!: Class; | ||||
| } | ||||
|  |  | |||
|  | @ -3,7 +3,12 @@ import { LearningObject } from './learning-object.entity.js'; | |||
| 
 | ||||
| @Entity() | ||||
| export class Attachment { | ||||
|     @ManyToOne({ entity: () => {return LearningObject}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return LearningObject; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     learningObject!: LearningObject; | ||||
| 
 | ||||
|     @PrimaryKey({ type: 'integer' }) | ||||
|  |  | |||
|  | @ -17,13 +17,22 @@ export class LearningObject { | |||
|     @PrimaryKey({ type: 'string' }) | ||||
|     hruid!: string; | ||||
| 
 | ||||
|     @Enum({ items: () => {return Language}, primary: true }) | ||||
|     @Enum({ | ||||
|         items: () => { | ||||
|             return Language; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     language!: Language; | ||||
| 
 | ||||
|     @PrimaryKey({ type: 'string' }) | ||||
|     version: string = '1'; | ||||
| 
 | ||||
|     @ManyToMany({ entity: () => {return Teacher} }) | ||||
|     @ManyToMany({ | ||||
|         entity: () => { | ||||
|             return Teacher; | ||||
|         }, | ||||
|     }) | ||||
|     admins!: Teacher[]; | ||||
| 
 | ||||
|     @Property({ type: 'string' }) | ||||
|  | @ -47,7 +56,12 @@ export class LearningObject { | |||
|     @Property({ type: 'array' }) | ||||
|     skosConcepts!: string[]; | ||||
| 
 | ||||
|     @Embedded({ entity: () => {return EducationalGoal}, array: true }) | ||||
|     @Embedded({ | ||||
|         entity: () => { | ||||
|             return EducationalGoal; | ||||
|         }, | ||||
|         array: true, | ||||
|     }) | ||||
|     educationalGoals: EducationalGoal[] = []; | ||||
| 
 | ||||
|     @Property({ type: 'string' }) | ||||
|  | @ -62,7 +76,11 @@ export class LearningObject { | |||
|     @Property({ type: 'integer' }) | ||||
|     estimatedTime!: number; | ||||
| 
 | ||||
|     @Embedded({ entity: () => {return ReturnValue} }) | ||||
|     @Embedded({ | ||||
|         entity: () => { | ||||
|             return ReturnValue; | ||||
|         }, | ||||
|     }) | ||||
|     returnValue!: ReturnValue; | ||||
| 
 | ||||
|     @Property({ type: 'bool' }) | ||||
|  | @ -71,7 +89,12 @@ export class LearningObject { | |||
|     @Property({ type: 'string', nullable: true }) | ||||
|     contentLocation?: string; | ||||
| 
 | ||||
|     @OneToMany({ entity: () => {return Attachment}, mappedBy: 'learningObject' }) | ||||
|     @OneToMany({ | ||||
|         entity: () => { | ||||
|             return Attachment; | ||||
|         }, | ||||
|         mappedBy: 'learningObject', | ||||
|     }) | ||||
|     attachments: Attachment[] = []; | ||||
| 
 | ||||
|     @Property({ type: 'blob' }) | ||||
|  |  | |||
|  | @ -16,10 +16,19 @@ export class LearningPath { | |||
|     @PrimaryKey({ type: 'string' }) | ||||
|     hruid!: string; | ||||
| 
 | ||||
|     @Enum({ items: () => {return Language}, primary: true }) | ||||
|     @Enum({ | ||||
|         items: () => { | ||||
|             return Language; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     language!: Language; | ||||
| 
 | ||||
|     @ManyToMany({ entity: () => {return Teacher} }) | ||||
|     @ManyToMany({ | ||||
|         entity: () => { | ||||
|             return Teacher; | ||||
|         }, | ||||
|     }) | ||||
|     admins!: Teacher[]; | ||||
| 
 | ||||
|     @Property({ type: 'string' }) | ||||
|  | @ -31,7 +40,12 @@ export class LearningPath { | |||
|     @Property({ type: 'blob' }) | ||||
|     image!: string; | ||||
| 
 | ||||
|     @Embedded({ entity: () => {return LearningPathNode}, array: true }) | ||||
|     @Embedded({ | ||||
|         entity: () => { | ||||
|             return LearningPathNode; | ||||
|         }, | ||||
|         array: true, | ||||
|     }) | ||||
|     nodes: LearningPathNode[] = []; | ||||
| } | ||||
| 
 | ||||
|  | @ -40,7 +54,11 @@ export class LearningPathNode { | |||
|     @Property({ type: 'string' }) | ||||
|     learningObjectHruid!: string; | ||||
| 
 | ||||
|     @Enum({ items: () => {return Language} }) | ||||
|     @Enum({ | ||||
|         items: () => { | ||||
|             return Language; | ||||
|         }, | ||||
|     }) | ||||
|     language!: Language; | ||||
| 
 | ||||
|     @Property({ type: 'string' }) | ||||
|  | @ -52,7 +70,12 @@ export class LearningPathNode { | |||
|     @Property({ type: 'bool' }) | ||||
|     startNode!: boolean; | ||||
| 
 | ||||
|     @Embedded({ entity: () => {return LearningPathTransition}, array: true }) | ||||
|     @Embedded({ | ||||
|         entity: () => { | ||||
|             return LearningPathTransition; | ||||
|         }, | ||||
|         array: true, | ||||
|     }) | ||||
|     transitions!: LearningPathTransition[]; | ||||
| } | ||||
| 
 | ||||
|  | @ -61,6 +84,10 @@ export class LearningPathTransition { | |||
|     @Property({ type: 'string' }) | ||||
|     condition!: string; | ||||
| 
 | ||||
|     @OneToOne({ entity: () => {return LearningPathNode} }) | ||||
|     @OneToOne({ | ||||
|         entity: () => { | ||||
|             return LearningPathNode; | ||||
|         }, | ||||
|     }) | ||||
|     next!: LearningPathNode; | ||||
| } | ||||
|  |  | |||
|  | @ -4,10 +4,20 @@ import { Teacher } from '../users/teacher.entity'; | |||
| 
 | ||||
| @Entity() | ||||
| export class Answer { | ||||
|     @ManyToOne({ entity: () => {return Teacher}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Teacher; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     author!: Teacher; | ||||
| 
 | ||||
|     @ManyToOne({ entity: () => {return Question}, primary: true }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Question; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     toQuestion!: Question; | ||||
| 
 | ||||
|     @PrimaryKey({ type: 'integer' }) | ||||
|  |  | |||
|  | @ -7,7 +7,12 @@ export class Question { | |||
|     @PrimaryKey({ type: 'string' }) | ||||
|     learningObjectHruid!: string; | ||||
| 
 | ||||
|     @Enum({ items: () => {return Language}, primary: true }) | ||||
|     @Enum({ | ||||
|         items: () => { | ||||
|             return Language; | ||||
|         }, | ||||
|         primary: true, | ||||
|     }) | ||||
|     learningObjectLanguage!: Language; | ||||
| 
 | ||||
|     @PrimaryKey({ type: 'string' }) | ||||
|  | @ -16,7 +21,11 @@ export class Question { | |||
|     @PrimaryKey({ type: 'integer' }) | ||||
|     sequenceNumber!: number; | ||||
| 
 | ||||
|     @ManyToOne({ entity: () => {return Student} }) | ||||
|     @ManyToOne({ | ||||
|         entity: () => { | ||||
|             return Student; | ||||
|         }, | ||||
|     }) | ||||
|     author!: Student; | ||||
| 
 | ||||
|     @Property({ type: 'datetime' }) | ||||
|  |  | |||
|  | @ -4,12 +4,20 @@ import { Class } from '../classes/class.entity.js'; | |||
| import { Group } from '../assignments/group.entity.js'; | ||||
| import { StudentRepository } from '../../data/users/student-repository.js'; | ||||
| 
 | ||||
| @Entity({ repository: () => {return StudentRepository} }) | ||||
| @Entity({ | ||||
|     repository: () => { | ||||
|         return StudentRepository; | ||||
|     }, | ||||
| }) | ||||
| export class Student extends User { | ||||
|     @ManyToMany(() => {return Class}) | ||||
|     @ManyToMany(() => { | ||||
|         return Class; | ||||
|     }) | ||||
|     classes!: Collection<Class>; | ||||
| 
 | ||||
|     @ManyToMany(() => {return Group}) | ||||
|     @ManyToMany(() => { | ||||
|         return Group; | ||||
|     }) | ||||
|     groups!: Collection<Group>; | ||||
| 
 | ||||
|     constructor( | ||||
|  |  | |||
|  | @ -4,6 +4,8 @@ import { Class } from '../classes/class.entity.js'; | |||
| 
 | ||||
| @Entity() | ||||
| export class Teacher extends User { | ||||
|     @ManyToMany(() => {return Class}) | ||||
|     @ManyToMany(() => { | ||||
|         return Class; | ||||
|     }) | ||||
|     classes!: Collection<Class>; | ||||
| } | ||||
|  |  | |||
		Reference in a new issue
	
	 Lint Action
						Lint Action