parent
029e4beaf5
commit
f28b08ed65
@ -1,8 +1,15 @@
|
|||||||
import { Entity } from "typeorm";
|
import { Entity, OneToMany } from "typeorm";
|
||||||
import { Participant } from "./Participant";
|
import { Participant } from "./Participant";
|
||||||
|
import { RunnerGroup } from "./RunnerGroup";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a group's contact.
|
* Defines a group's contact.
|
||||||
*/
|
*/
|
||||||
@Entity()
|
@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 {
|
import {
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
@ -34,7 +34,7 @@ export abstract class RunnerGroup {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
//TODO: Relationship
|
@ManyToOne(() => GroupContact, contact => contact.groups)
|
||||||
contact?: GroupContact;
|
contact?: GroupContact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user