Cleaned up a load of relations and optional stuff

ref #11
This commit is contained in:
2020-12-05 10:43:28 +01:00
parent 109e145a19
commit a1105f06ab
18 changed files with 50 additions and 80 deletions

View File

@@ -1,7 +1,6 @@
import {
IsInt,
IsNotEmpty,
IsOptional
IsNotEmpty
} from "class-validator";
import { Entity, ManyToOne, PrimaryGeneratedColumn, TableInheritance } from "typeorm";
import { Participant } from "./Participant";
@@ -16,7 +15,6 @@ export abstract class Donation {
* Autogenerated unique id (primary key).
*/
@PrimaryGeneratedColumn()
@IsOptional()
@IsInt()
id: number;
@@ -24,7 +22,7 @@ export abstract class Donation {
* The donations's donor.
*/
@IsNotEmpty()
@ManyToOne(() => Participant, donor => donor.donations, { nullable: true })
@ManyToOne(() => Participant, donor => donor.donations)
donor: Participant;
/**