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 8e2eac9dc0 - Show all commits

View File

@ -4,6 +4,7 @@ import { Participant } from "./Participant";
import { RunnerGroup } from "./RunnerGroup";
import { DistanceDonation } from "./DistanceDonation";
import { RunnerCard } from "./RunnerCard";
import { Scan } from "./Scan";
/**
* Defines a runner.
@ -29,4 +30,10 @@ export class Runner extends Participant {
*/
@OneToMany(() => RunnerCard, card => card.runner)
cards: RunnerCard[];
/**
* Used to link runners to a scans
*/
@OneToMany(() => Scan, scan => scan.runner)
scans: Scan[];
}

View File

@ -1,4 +1,4 @@
import { PrimaryGeneratedColumn, Column } from "typeorm";
import { PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
import {
IsInt,
IsNotEmpty,
@ -24,7 +24,7 @@ export abstract class Scan {
*/
@Column()
@IsNotEmpty()
//TODO: Relationship
@ManyToOne(() => Runner, runner => runner.scans)
runner: Runner;
/**