feat(backend): Entities toegevoegd
Entites Class, Class Join Request, Class Invitation, Assignment, Group en entities om de Dwengo-leerinhoud te modelleren, toegevoegd.
This commit is contained in:
parent
62a278a6e0
commit
d5101737ef
14 changed files with 289 additions and 7 deletions
25
backend/src/entities/assigments/assignment.entity.ts
Normal file
25
backend/src/entities/assigments/assignment.entity.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import {Entity, ManyToOne, OneToMany, PrimaryKey, Property} from "@mikro-orm/core";
|
||||
import {Class} from "../classes/class.entity";
|
||||
import {LearningPath} from "../content/learning-path.entity";
|
||||
import {Group} from "./group.entity"
|
||||
|
||||
@Entity()
|
||||
export class Assignment {
|
||||
@ManyToOne({entity: () => Class, primary: true})
|
||||
within!: Class;
|
||||
|
||||
@PrimaryKey({type: "number"})
|
||||
id!: number;
|
||||
|
||||
@Property({type: "string"})
|
||||
title!: string;
|
||||
|
||||
@Property({type: "longtext"})
|
||||
description!: string;
|
||||
|
||||
@ManyToOne({entity: () => LearningPath})
|
||||
task!: LearningPath;
|
||||
|
||||
@OneToMany({entity: () => Group})
|
||||
groups!: Group[];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue