parent
a6222a8025
commit
029e4beaf5
@ -3,6 +3,7 @@ import { IsNotEmpty,} from "class-validator";
|
|||||||
import { Participant } from "./Participant";
|
import { Participant } from "./Participant";
|
||||||
import { RunnerGroup } from "./RunnerGroup";
|
import { RunnerGroup } from "./RunnerGroup";
|
||||||
import { DistanceDonation } from "./DistanceDonation";
|
import { DistanceDonation } from "./DistanceDonation";
|
||||||
|
import { RunnerCard } from "./RunnerCard";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a runner.
|
* Defines a runner.
|
||||||
@ -22,4 +23,10 @@ export class Runner extends Participant {
|
|||||||
*/
|
*/
|
||||||
@OneToMany(() => DistanceDonation, distanceDonation => distanceDonation.runner)
|
@OneToMany(() => DistanceDonation, distanceDonation => distanceDonation.runner)
|
||||||
distanceDonations: DistanceDonation[];
|
distanceDonations: DistanceDonation[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to link runners to cards.
|
||||||
|
*/
|
||||||
|
@OneToMany(() => RunnerCard, card => card.runner)
|
||||||
|
cards: RunnerCard[];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
@ -26,7 +26,7 @@ export class RunnerCard {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
//TODO: Relation
|
@ManyToOne(() => Runner, runner => runner.cards)
|
||||||
runner: Runner;
|
runner: Runner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user