Implemented a possible bugfix

ref #68
This commit is contained in:
2021-01-02 19:56:04 +01:00
parent 9b5d16ae92
commit 2c47436259
5 changed files with 31 additions and 23 deletions

View File

@@ -1,5 +1,7 @@
import { IsInt } from "class-validator";
import { ChildEntity, OneToMany } from "typeorm";
import { IsInt, IsOptional } from "class-validator";
import { ChildEntity, ManyToOne, OneToMany } from "typeorm";
import { Address } from './Address';
import { IAddressUser } from './IAddressUser';
import { Runner } from './Runner';
import { RunnerGroup } from "./RunnerGroup";
import { RunnerTeam } from "./RunnerTeam";
@@ -9,14 +11,14 @@ import { RunnerTeam } from "./RunnerTeam";
* This usually is a school, club or company.
*/
@ChildEntity()
export class RunnerOrganisation extends RunnerGroup {
export class RunnerOrganisation extends RunnerGroup implements IAddressUser {
// /**
// * The organisations's address.
// */
// @IsOptional()
// @ManyToOne(() => Address, address => address.groups, { nullable: true })
// address?: Address;
/**
* The organisations's address.
*/
@IsOptional()
@ManyToOne(() => Address, address => address.addressUsers, { nullable: true })
address?: Address;
/**
* The organisation's teams.