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 { IsNotEmpty,} from "class-validator";
|
||||||
import { Participant } from "./Participant";
|
import { Participant } from "./Participant";
|
||||||
import { RunnerGroup } from "./RunnerGroup";
|
import { RunnerGroup } from "./RunnerGroup";
|
||||||
@ -14,9 +14,12 @@ export class Runner extends Participant {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
//TODO:Relation
|
@ManyToOne(() => RunnerGroup, group => group.runners)
|
||||||
group: RunnerGroup;
|
group: RunnerGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to link runners to donations.
|
||||||
|
*/
|
||||||
@OneToMany(() => DistanceDonation, distanceDonation => distanceDonation.runner)
|
@OneToMany(() => DistanceDonation, distanceDonation => distanceDonation.runner)
|
||||||
distanceDonations: DistanceDonation[];
|
distanceDonations: DistanceDonation[];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PrimaryGeneratedColumn, Column } from "typeorm";
|
import { PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
@ -6,6 +6,7 @@ import {
|
|||||||
IsString,
|
IsString,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { GroupContact } from "./GroupContact";
|
import { GroupContact } from "./GroupContact";
|
||||||
|
import { Runner } from "./Runner";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the runnerGroup interface.
|
* Defines the runnerGroup interface.
|
||||||
@ -35,4 +36,10 @@ export abstract class RunnerGroup {
|
|||||||
@IsOptional()
|
@IsOptional()
|
||||||
//TODO: Relationship
|
//TODO: Relationship
|
||||||
contact?: GroupContact;
|
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