fix: @entity(...) decorator gefixt in backend/src/entities

This commit is contained in:
Adriaan Jacquet 2025-03-05 15:48:35 +01:00
parent 7a8673f66e
commit 55387066f0
12 changed files with 24 additions and 12 deletions

View file

@ -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.js';
@Entity()
@Entity({ repository: () => ClassJoinRequestRepository })
export class ClassJoinRequest {
@ManyToOne({ entity: () => Student, primary: true })
requester!: Student;

View file

@ -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.js';
@Entity()
@Entity({ repository: () => ClassRepository })
export class Class {
@PrimaryKey()
classId = v4();

View file

@ -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.js';
/**
* 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;