Added payed amount to update classes

ref #193
This commit is contained in:
Nicolai Ort 2021-04-14 18:19:26 +02:00
parent 71542bc388
commit 99307423c5
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,12 @@ export abstract class UpdateDonation {
@IsPositive()
donor: number;
/**
* The donation's payed amount in the smalles unit of your currency (default: euro cent).
*/
@IsInt()
payedAmount: number;
/**
* Creates a new Donation entity from this.
*/

View File

@ -20,6 +20,7 @@ export class UpdateFixedDonation extends UpdateDonation {
*/
public async update(donation: FixedDonation): Promise<FixedDonation> {
donation.amount = this.amount;
donation.payedAmount = this.payedAmount;
donation.donor = await this.getDonor();
return donation;