Added donor donation amount to the donor response
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
ref #66
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user