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 { Group } from './group.entity.js'; | ||||
| import { Language } from '../content/language.js'; | ||||
| import {AssignmentRepository} from "../../data/assignments/assignment-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => AssignmentRepository}) | ||||
| export class Assignment { | ||||
|     @ManyToOne({ entity: () => Class, primary: true }) | ||||
|     within!: Class; | ||||
|  |  | |||
|  | @ -1,8 +1,9 @@ | |||
| import { 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"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => GroupRepository}) | ||||
| export class Group { | ||||
|     @ManyToOne({ entity: () => Assignment, primary: true }) | ||||
|     assignment!: Assignment; | ||||
|  |  | |||
|  | @ -2,8 +2,9 @@ import { Student } from '../users/student.entity.js'; | |||
| import { Group } from './group.entity.js'; | ||||
| import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | ||||
| import { Language } from '../content/language.js'; | ||||
| import {SubmissionRepository} from "../../data/assignments/submission-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => SubmissionRepository}) | ||||
| export class Submission { | ||||
|     @PrimaryKey({ type: 'string' }) | ||||
|     learningObjectHruid!: string; | ||||
|  |  | |||
|  | @ -1,8 +1,9 @@ | |||
| import { Entity, Enum, ManyToOne } from '@mikro-orm/core'; | ||||
| import { Student } from '../users/student.entity.js'; | ||||
| import { Class } from './class.entity.js'; | ||||
| import {ClassJoinRequestRepository} from "../../data/classes/class-join-request-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => ClassJoinRequestRepository}) | ||||
| export class ClassJoinRequest { | ||||
|     @ManyToOne({ entity: () => Student, primary: true }) | ||||
|     requester!: Student; | ||||
|  |  | |||
|  | @ -8,8 +8,9 @@ import { | |||
| import { v4 } from 'uuid'; | ||||
| import { Teacher } from '../users/teacher.entity.js'; | ||||
| import { Student } from '../users/student.entity.js'; | ||||
| import {ClassRepository} from "../../data/classes/class-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => ClassRepository}) | ||||
| export class Class { | ||||
|     @PrimaryKey() | ||||
|     classId = v4(); | ||||
|  |  | |||
|  | @ -1,11 +1,12 @@ | |||
| import { Entity, ManyToOne } from '@mikro-orm/core'; | ||||
| import { Teacher } from '../users/teacher.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). | ||||
|  */ | ||||
| @Entity() | ||||
| @Entity({repository: () => TeacherInvitationRepository}) | ||||
| export class TeacherInvitation { | ||||
|     @ManyToOne({ entity: () => Teacher, primary: true }) | ||||
|     sender!: Teacher; | ||||
|  |  | |||
|  | @ -13,8 +13,9 @@ import { Attachment } from './attachment.entity.js'; | |||
| import { Teacher } from '../users/teacher.entity.js'; | ||||
| import {DwengoContentType} from "../../services/learning-objects/processing/content-type"; | ||||
| import {v4} from "uuid"; | ||||
| import {LearningObjectRepository} from "../../data/content/learning-object-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => LearningObjectRepository}) | ||||
| export class LearningObject { | ||||
|     @PrimaryKey({ type: 'string' }) | ||||
|     hruid!: string; | ||||
|  |  | |||
|  | @ -10,8 +10,9 @@ import { | |||
| } from '@mikro-orm/core'; | ||||
| import { Language } from './language.js'; | ||||
| import { Teacher } from '../users/teacher.entity.js'; | ||||
| import {LearningPathRepository} from "../../data/content/learning-path-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => LearningPathRepository}) | ||||
| export class LearningPath { | ||||
|     @PrimaryKey({ type: 'string' }) | ||||
|     hruid!: string; | ||||
|  |  | |||
|  | @ -1,8 +1,9 @@ | |||
| import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | ||||
| import { Question } from './question.entity.js'; | ||||
| import { Teacher } from '../users/teacher.entity.js'; | ||||
| import {AnswerRepository} from "../../data/questions/answer-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => AnswerRepository}) | ||||
| export class Answer { | ||||
|     @ManyToOne({ entity: () => Teacher, primary: true }) | ||||
|     author!: Teacher; | ||||
|  |  | |||
|  | @ -1,8 +1,9 @@ | |||
| import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'; | ||||
| import { Language } from '../content/language.js'; | ||||
| import { Student } from '../users/student.entity.js'; | ||||
| import {QuestionRepository} from "../../data/questions/question-repository"; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({repository: () => QuestionRepository}) | ||||
| export class Question { | ||||
|     @PrimaryKey({ type: 'string' }) | ||||
|     learningObjectHruid!: string; | ||||
|  |  | |||
|  | @ -1,8 +1,9 @@ | |||
| import { Collection, Entity, ManyToMany } from '@mikro-orm/core'; | ||||
| import { User } from './user.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 { | ||||
|     @ManyToMany(() => Class) | ||||
|     classes!: Collection<Class>; | ||||
|  |  | |||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger