parent
029e4beaf5
commit
f28b08ed65
|
@ -1,8 +1,15 @@
|
|||
import { Entity } from "typeorm";
|
||||
import { Entity, OneToMany } from "typeorm";
|
||||
import { Participant } from "./Participant";
|
||||
import { RunnerGroup } from "./RunnerGroup";
|
||||
|
||||
/**
|
||||
* Defines a group's contact.
|
||||
*/
|
||||
@Entity()
|
||||
export class GroupContact extends Participant{}
|
||||
export class GroupContact extends Participant{
|
||||
/**
|
||||
* Used to link runners to donations.
|
||||
*/
|
||||
@OneToMany(() => RunnerGroup, group => group.contact)
|
||||
groups: RunnerGroup[];
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
|
||||
import { PrimaryGeneratedColumn, Column, OneToMany, ManyToOne } from "typeorm";
|
||||
import {
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
|
@ -34,7 +34,7 @@ export abstract class RunnerGroup {
|
|||
*/
|
||||
@Column()
|
||||
@IsOptional()
|
||||
//TODO: Relationship
|
||||
@ManyToOne(() => GroupContact, contact => contact.groups)
|
||||
contact?: GroupContact;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue