ref #193
This commit is contained in:
@@ -35,12 +35,12 @@ export abstract class Donation {
|
||||
public abstract get amount(): number;
|
||||
|
||||
/**
|
||||
* The donation's payed amount in cents (or whatever your currency's smallest unit is.).
|
||||
* Used to mark donations as payed.
|
||||
* The donation's paid amount in cents (or whatever your currency's smallest unit is.).
|
||||
* Used to mark donations as paid.
|
||||
*/
|
||||
@Column({ nullable: true })
|
||||
@IsInt()
|
||||
payedAmount: number;
|
||||
paidAmount: number;
|
||||
|
||||
/**
|
||||
* Turns this entity into it's response class.
|
||||
|
||||
@@ -34,12 +34,12 @@ export class Donor extends Participant {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total payed donations of a donor based on his linked donations.
|
||||
* Returns the total paid donations of a donor based on his linked donations.
|
||||
*/
|
||||
@IsInt()
|
||||
public get payedDonationAmount(): number {
|
||||
public get paidDonationAmount(): number {
|
||||
if (!this.donations) { return 0; }
|
||||
return this.donations.reduce((sum, current) => sum + current.payedAmount, 0);
|
||||
return this.donations.reduce((sum, current) => sum + current.paidAmount, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user