2025SELab2-project-Dwengo/backend/src/entities/classes/teacher-invitation.entity.ts
2025-03-13 14:30:11 +00:00

31 lines
779 B
TypeScript

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({ repository: () => TeacherInvitationRepository })
@Entity({
repository: () => TeacherInvitationRepository,
})
export class TeacherInvitation {
@ManyToOne({
entity: () => Teacher,
primary: true,
})
sender!: Teacher;
@ManyToOne({
entity: () => Teacher,
primary: true,
})
receiver!: Teacher;
@ManyToOne({
entity: () => Class,
primary: true,
})
class!: Class;
}