feature/11-new_classes #15

Merged
niggl merged 55 commits from feature/11-new_classes into dev 2020-12-02 17:48:19 +00:00
2 changed files with 11 additions and 4 deletions
Showing only changes of commit f28b08ed65 - Show all commits

View File

@ -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[];
}

View File

@ -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;
/** /**