parent
1c43442300
commit
2b693917b0
@ -1,4 +1,4 @@
|
|||||||
import { PrimaryGeneratedColumn, Column } from "typeorm";
|
import { PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
@ -24,7 +24,7 @@ export abstract class Donation {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
//TODO: Relationship
|
@ManyToOne(() => Participant, donor => donor.donations)
|
||||||
donor: Participant;
|
donor: Participant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PrimaryGeneratedColumn, Column } from "typeorm";
|
import { PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsEmail,
|
IsEmail,
|
||||||
IsInt,
|
IsInt,
|
||||||
@ -8,6 +8,7 @@ import {
|
|||||||
IsString,
|
IsString,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { Address } from "./Address";
|
import { Address } from "./Address";
|
||||||
|
import { Donation } from "./Donation";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the participant interface.
|
* Defines the participant interface.
|
||||||
@ -72,4 +73,10 @@ export abstract class Participant {
|
|||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsEmail()
|
@IsEmail()
|
||||||
email?: string;
|
email?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to link the participant as the donor of a donation.
|
||||||
|
*/
|
||||||
|
@OneToMany(() => Donation, donation => donation.donor)
|
||||||
|
donations: Donation[];
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user