2025SELab2-project-Dwengo/backend/src/entities/classes/class.entity.ts
Gerald Schmittinger d5101737ef feat(backend): Entities toegevoegd
Entites Class, Class Join Request, Class Invitation, Assignment, Group en entities om de Dwengo-leerinhoud te modelleren, toegevoegd.
2025-02-25 12:51:04 +01:00

19 lines
478 B
TypeScript

import {Collection, Entity, ManyToMany, PrimaryKey, Property} from "@mikro-orm/core";
import { v4 } from 'uuid';
import {Teacher} from "../users/teacher.entity";
import {Student} from "../users/student.entity";
@Entity()
export class Class {
@PrimaryKey()
classId = v4();
@Property({type: "string"})
displayName!: string;
@ManyToMany(() => Teacher)
teachers!: Collection<Teacher>;
@ManyToMany(() => Student)
students!: Collection<Student>;
}