28 lines
715 B
TypeScript
28 lines
715 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 })
|
|
export class TeacherInvitation {
|
|
@ManyToOne({
|
|
entity: () => Teacher,
|
|
primary: true,
|
|
})
|
|
sender!: Teacher;
|
|
|
|
@ManyToOne({
|
|
entity: () => Teacher,
|
|
primary: true,
|
|
})
|
|
receiver!: Teacher;
|
|
|
|
@ManyToOne({
|
|
entity: () => Class,
|
|
primary: true,
|
|
})
|
|
class!: Class;
|
|
}
|