Merge branch 'dev' into chore/logging
This commit is contained in:
commit
f82668148c
122 changed files with 6026 additions and 14446 deletions
35
backend/src/entities/assignments/assignment.entity.ts
Normal file
35
backend/src/entities/assignments/assignment.entity.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
import {
|
||||
Entity,
|
||||
Enum,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
} from '@mikro-orm/core';
|
||||
import { Class } from '../classes/class.entity.js';
|
||||
import { Group } from './group.entity.js';
|
||||
import { Language } from '../content/language.js';
|
||||
|
||||
@Entity()
|
||||
export class Assignment {
|
||||
@ManyToOne({ entity: () => {return Class}, primary: true })
|
||||
within!: Class;
|
||||
|
||||
@PrimaryKey({ type: 'number' })
|
||||
id!: number;
|
||||
|
||||
@Property({ type: 'string' })
|
||||
title!: string;
|
||||
|
||||
@Property({ type: 'text' })
|
||||
description!: string;
|
||||
|
||||
@Property({ type: 'string' })
|
||||
learningPathHruid!: string;
|
||||
|
||||
@Enum({ items: () => {return Language} })
|
||||
learningPathLanguage!: Language;
|
||||
|
||||
@OneToMany({ entity: () => {return Group}, mappedBy: 'assignment' })
|
||||
groups!: Group[];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue