fix(backend): Added missing repository-properties to entity annotations
This commit is contained in:
		
							parent
							
								
									02be44fe53
								
							
						
					
					
						commit
						34af354a33
					
				
					 11 changed files with 22 additions and 11 deletions
				
			
		|  | @ -9,8 +9,9 @@ import { | ||||||
| import { Class } from '../classes/class.entity.js'; | import { Class } from '../classes/class.entity.js'; | ||||||
| import { Group } from './group.entity.js'; | import { Group } from './group.entity.js'; | ||||||
| import { Language } from '../content/language.js'; | import { Language } from '../content/language.js'; | ||||||
|  | import {AssignmentRepository} from "../../data/assignments/assignment-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => AssignmentRepository}) | ||||||
| export class Assignment { | export class Assignment { | ||||||
|     @ManyToOne({ entity: () => Class, primary: true }) |     @ManyToOne({ entity: () => Class, primary: true }) | ||||||
|     within!: Class; |     within!: Class; | ||||||
|  |  | ||||||
|  | @ -1,8 +1,9 @@ | ||||||
| import { Entity, ManyToMany, ManyToOne, PrimaryKey } from '@mikro-orm/core'; | import { Entity, ManyToMany, ManyToOne, PrimaryKey } from '@mikro-orm/core'; | ||||||
| import { Assignment } from './assignment.entity.js'; | import { Assignment } from './assignment.entity.js'; | ||||||
| import { Student } from '../users/student.entity.js'; | import { Student } from '../users/student.entity.js'; | ||||||
|  | import {GroupRepository} from "../../data/assignments/group-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => GroupRepository}) | ||||||
| export class Group { | export class Group { | ||||||
|     @ManyToOne({ entity: () => Assignment, primary: true }) |     @ManyToOne({ entity: () => Assignment, primary: true }) | ||||||
|     assignment!: Assignment; |     assignment!: Assignment; | ||||||
|  |  | ||||||
|  | @ -2,8 +2,9 @@ import { Student } from '../users/student.entity.js'; | ||||||
| import { Group } from './group.entity.js'; | import { Group } from './group.entity.js'; | ||||||
| import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | ||||||
| import { Language } from '../content/language.js'; | import { Language } from '../content/language.js'; | ||||||
|  | import {SubmissionRepository} from "../../data/assignments/submission-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => SubmissionRepository}) | ||||||
| export class Submission { | export class Submission { | ||||||
|     @PrimaryKey({ type: 'string' }) |     @PrimaryKey({ type: 'string' }) | ||||||
|     learningObjectHruid!: string; |     learningObjectHruid!: string; | ||||||
|  |  | ||||||
|  | @ -1,8 +1,9 @@ | ||||||
| import { Entity, Enum, ManyToOne } from '@mikro-orm/core'; | import { Entity, Enum, ManyToOne } from '@mikro-orm/core'; | ||||||
| import { Student } from '../users/student.entity.js'; | import { Student } from '../users/student.entity.js'; | ||||||
| import { Class } from './class.entity.js'; | import { Class } from './class.entity.js'; | ||||||
|  | import {ClassJoinRequestRepository} from "../../data/classes/class-join-request-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => ClassJoinRequestRepository}) | ||||||
| export class ClassJoinRequest { | export class ClassJoinRequest { | ||||||
|     @ManyToOne({ entity: () => Student, primary: true }) |     @ManyToOne({ entity: () => Student, primary: true }) | ||||||
|     requester!: Student; |     requester!: Student; | ||||||
|  |  | ||||||
|  | @ -8,8 +8,9 @@ import { | ||||||
| import { v4 } from 'uuid'; | import { v4 } from 'uuid'; | ||||||
| import { Teacher } from '../users/teacher.entity.js'; | import { Teacher } from '../users/teacher.entity.js'; | ||||||
| import { Student } from '../users/student.entity.js'; | import { Student } from '../users/student.entity.js'; | ||||||
|  | import {ClassRepository} from "../../data/classes/class-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => ClassRepository}) | ||||||
| export class Class { | export class Class { | ||||||
|     @PrimaryKey() |     @PrimaryKey() | ||||||
|     classId = v4(); |     classId = v4(); | ||||||
|  |  | ||||||
|  | @ -1,11 +1,12 @@ | ||||||
| import { Entity, ManyToOne } from '@mikro-orm/core'; | import { Entity, ManyToOne } from '@mikro-orm/core'; | ||||||
| import { Teacher } from '../users/teacher.entity.js'; | import { Teacher } from '../users/teacher.entity.js'; | ||||||
| import { Class } from './class.entity.js'; | import { Class } from './class.entity.js'; | ||||||
|  | import {TeacherInvitationRepository} from "../../data/classes/teacher-invitation-repository"; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Invitation of a teacher into a class (in order to teach it). |  * Invitation of a teacher into a class (in order to teach it). | ||||||
|  */ |  */ | ||||||
| @Entity() | @Entity({repository: () => TeacherInvitationRepository}) | ||||||
| export class TeacherInvitation { | export class TeacherInvitation { | ||||||
|     @ManyToOne({ entity: () => Teacher, primary: true }) |     @ManyToOne({ entity: () => Teacher, primary: true }) | ||||||
|     sender!: Teacher; |     sender!: Teacher; | ||||||
|  |  | ||||||
|  | @ -13,8 +13,9 @@ import { Attachment } from './attachment.entity.js'; | ||||||
| import { Teacher } from '../users/teacher.entity.js'; | import { Teacher } from '../users/teacher.entity.js'; | ||||||
| import {DwengoContentType} from "../../services/learning-objects/processing/content-type"; | import {DwengoContentType} from "../../services/learning-objects/processing/content-type"; | ||||||
| import {v4} from "uuid"; | import {v4} from "uuid"; | ||||||
|  | import {LearningObjectRepository} from "../../data/content/learning-object-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => LearningObjectRepository}) | ||||||
| export class LearningObject { | export class LearningObject { | ||||||
|     @PrimaryKey({ type: 'string' }) |     @PrimaryKey({ type: 'string' }) | ||||||
|     hruid!: string; |     hruid!: string; | ||||||
|  |  | ||||||
|  | @ -10,8 +10,9 @@ import { | ||||||
| } from '@mikro-orm/core'; | } from '@mikro-orm/core'; | ||||||
| import { Language } from './language.js'; | import { Language } from './language.js'; | ||||||
| import { Teacher } from '../users/teacher.entity.js'; | import { Teacher } from '../users/teacher.entity.js'; | ||||||
|  | import {LearningPathRepository} from "../../data/content/learning-path-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => LearningPathRepository}) | ||||||
| export class LearningPath { | export class LearningPath { | ||||||
|     @PrimaryKey({ type: 'string' }) |     @PrimaryKey({ type: 'string' }) | ||||||
|     hruid!: string; |     hruid!: string; | ||||||
|  |  | ||||||
|  | @ -1,8 +1,9 @@ | ||||||
| import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | ||||||
| import { Question } from './question.entity.js'; | import { Question } from './question.entity.js'; | ||||||
| import { Teacher } from '../users/teacher.entity.js'; | import { Teacher } from '../users/teacher.entity.js'; | ||||||
|  | import {AnswerRepository} from "../../data/questions/answer-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => AnswerRepository}) | ||||||
| export class Answer { | export class Answer { | ||||||
|     @ManyToOne({ entity: () => Teacher, primary: true }) |     @ManyToOne({ entity: () => Teacher, primary: true }) | ||||||
|     author!: Teacher; |     author!: Teacher; | ||||||
|  |  | ||||||
|  | @ -1,8 +1,9 @@ | ||||||
| import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | ||||||
| import { Language } from '../content/language.js'; | import { Language } from '../content/language.js'; | ||||||
| import { Student } from '../users/student.entity.js'; | import { Student } from '../users/student.entity.js'; | ||||||
|  | import {QuestionRepository} from "../../data/questions/question-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => QuestionRepository}) | ||||||
| export class Question { | export class Question { | ||||||
|     @PrimaryKey({ type: 'string' }) |     @PrimaryKey({ type: 'string' }) | ||||||
|     learningObjectHruid!: string; |     learningObjectHruid!: string; | ||||||
|  |  | ||||||
|  | @ -1,8 +1,9 @@ | ||||||
| import { Collection, Entity, ManyToMany } from '@mikro-orm/core'; | import { Collection, Entity, ManyToMany } from '@mikro-orm/core'; | ||||||
| import { User } from './user.entity.js'; | import { User } from './user.entity.js'; | ||||||
| import { Class } from '../classes/class.entity.js'; | import { Class } from '../classes/class.entity.js'; | ||||||
|  | import {TeacherRepository} from "../../data/users/teacher-repository"; | ||||||
| 
 | 
 | ||||||
| @Entity() | @Entity({repository: () => TeacherRepository}) | ||||||
| export class Teacher extends User { | export class Teacher extends User { | ||||||
|     @ManyToMany(() => Class) |     @ManyToMany(() => Class) | ||||||
|     classes!: Collection<Class>; |     classes!: Collection<Class>; | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger