From 99307423c533f8cde847b59a80bffc2ff42c9769 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Wed, 14 Apr 2021 18:19:26 +0200 Subject: [PATCH] Added payed amount to update classes ref #193 --- src/models/actions/update/UpdateDonation.ts | 6 ++++++ src/models/actions/update/UpdateFixedDonation.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/models/actions/update/UpdateDonation.ts b/src/models/actions/update/UpdateDonation.ts index 569454a..b64d656 100644 --- a/src/models/actions/update/UpdateDonation.ts +++ b/src/models/actions/update/UpdateDonation.ts @@ -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. */ diff --git a/src/models/actions/update/UpdateFixedDonation.ts b/src/models/actions/update/UpdateFixedDonation.ts index 5e31068..19919dd 100644 --- a/src/models/actions/update/UpdateFixedDonation.ts +++ b/src/models/actions/update/UpdateFixedDonation.ts @@ -20,6 +20,7 @@ export class UpdateFixedDonation extends UpdateDonation { */ public async update(donation: FixedDonation): Promise { donation.amount = this.amount; + donation.payedAmount = this.payedAmount; donation.donor = await this.getDonor(); return donation;