Added donor donation amount to the donor response
Some checks failed
continuous-integration/drone/pr Build is failing

ref #66
This commit is contained in:
2021-01-13 17:32:10 +01:00
parent cd5e4bbd60
commit bba35d189e
4 changed files with 26 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
import {
IsBoolean
IsBoolean, IsInt
} from "class-validator";
import { Donor } from '../entities/Donor';
import { ResponseParticipant } from './ResponseParticipant';
@@ -15,6 +15,12 @@ export class ResponseDonor extends ResponseParticipant {
@IsBoolean()
receiptNeeded: boolean;
/**
* Returns the total donations of a donor based on his linked donations.
*/
@IsInt()
donationAmount: number;
/**
* Creates a ResponseRunner object from a runner.
* @param runner The user the response shall be build for.
@@ -22,5 +28,6 @@ export class ResponseDonor extends ResponseParticipant {
public constructor(donor: Donor) {
super(donor);
this.receiptNeeded = donor.receiptNeeded;
this.donationAmount = donor.donationAmount;
}
}