ref #193
This commit is contained in:
@@ -42,10 +42,10 @@ export class ResponseDonation implements IResponse {
|
||||
amount: number;
|
||||
|
||||
/**
|
||||
* The donation's payed amount in the smalles unit of your currency (default: euro cent).
|
||||
* The donation's paid amount in the smalles unit of your currency (default: euro cent).
|
||||
*/
|
||||
@IsInt()
|
||||
payedAmount: number;
|
||||
paidAmount: number;
|
||||
|
||||
/**
|
||||
* Creates a ResponseDonation object from a scan.
|
||||
@@ -55,12 +55,12 @@ export class ResponseDonation implements IResponse {
|
||||
this.id = donation.id;
|
||||
this.donor = donation.donor.toResponse();
|
||||
this.amount = donation.amount;
|
||||
this.payedAmount = donation.payedAmount || 0;
|
||||
if (this.payedAmount < this.amount) {
|
||||
this.paidAmount = donation.paidAmount || 0;
|
||||
if (this.paidAmount < this.amount) {
|
||||
this.status = DonationStatus.OPEN;
|
||||
}
|
||||
else {
|
||||
this.status = DonationStatus.PAYED;
|
||||
this.status = DonationStatus.PAID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user