parent
4075276130
commit
a6222a8025
@ -1,4 +1,4 @@
|
||||
import { Entity, Column, OneToMany } from "typeorm";
|
||||
import { Entity, Column, OneToMany, ManyToOne } from "typeorm";
|
||||
import { IsNotEmpty,} from "class-validator";
|
||||
import { Participant } from "./Participant";
|
||||
import { RunnerGroup } from "./RunnerGroup";
|
||||
@ -14,9 +14,12 @@ export class Runner extends Participant {
|
||||
*/
|
||||
@Column()
|
||||
@IsNotEmpty()
|
||||
//TODO:Relation
|
||||
@ManyToOne(() => RunnerGroup, group => group.runners)
|
||||
group: RunnerGroup;
|
||||
|
||||
/**
|
||||
* Used to link runners to donations.
|
||||
*/
|
||||
@OneToMany(() => DistanceDonation, distanceDonation => distanceDonation.runner)
|
||||
distanceDonations: DistanceDonation[];
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PrimaryGeneratedColumn, Column } from "typeorm";
|
||||
import { PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
|
||||
import {
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
@ -6,6 +6,7 @@ import {
|
||||
IsString,
|
||||
} from "class-validator";
|
||||
import { GroupContact } from "./GroupContact";
|
||||
import { Runner } from "./Runner";
|
||||
|
||||
/**
|
||||
* Defines the runnerGroup interface.
|
||||
@ -35,4 +36,10 @@ export abstract class RunnerGroup {
|
||||
@IsOptional()
|
||||
//TODO: Relationship
|
||||
contact?: GroupContact;
|
||||
|
||||
/**
|
||||
* Used to link runners to a runner group.
|
||||
*/
|
||||
@OneToMany(() => Runner, runner => runner.group)
|
||||
runners: Runner[];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user