feature/11-new_classes #15

Merged
niggl merged 55 commits from feature/11-new_classes into dev 2020-12-02 17:48:19 +00:00
2 changed files with 9 additions and 2 deletions
Showing only changes of commit 0d9d72c223 - Show all commits

View File

@ -7,6 +7,7 @@ import {
} from "class-validator";
import { GroupContact } from "./GroupContact";
import { Runner } from "./Runner";
import { RunnerTeam } from "./RunnerTeam";
/**
* Defines the runnerGroup interface.
@ -42,4 +43,10 @@ export abstract class RunnerGroup {
*/
@OneToMany(() => Runner, runner => runner.group)
runners: Runner[];
/**
* Used to link teams to runner groups.
*/
@OneToMany(() => RunnerTeam, team => team.parentGroup)
teams: RunnerTeam[];
}

View File

@ -1,4 +1,4 @@
import { Entity, Column } from "typeorm";
import { Entity, Column, ManyToOne } from "typeorm";
import { IsNotEmpty } from "class-validator";
import { RunnerGroup } from "./RunnerGroup";
@ -14,6 +14,6 @@ export class RunnerTeam extends RunnerGroup {
*/
@Column()
@IsNotEmpty()
//TODO: Relationship
@ManyToOne(() => RunnerGroup, group => group.teams)
parentGroup?: RunnerGroup;
}