refactor(donations): Make anon prepaid
This commit is contained in:
parent
7697acff82
commit
02b1cb9904
@ -22,7 +22,7 @@ export class CreateAnonymousDonation extends CreateDonation {
|
||||
let newDonation = new FixedDonation;
|
||||
|
||||
newDonation.amount = this.amount;
|
||||
newDonation.paidAmount = this.paidAmount;
|
||||
newDonation.paidAmount = this.amount;
|
||||
|
||||
return newDonation;
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export class CreateDistanceDonation extends CreateDonation {
|
||||
@IsPositive()
|
||||
donor: number;
|
||||
|
||||
/**
|
||||
* The donation's paid amount in the smalles unit of your currency (default: euro cent).
|
||||
*/
|
||||
@IsInt()
|
||||
paidAmount?: number;
|
||||
|
||||
/**
|
||||
* The donation's associated runner's id.
|
||||
* This is important to link the runner's distance ran to the donation.
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { Exclude } from 'class-transformer';
|
||||
import { IsInt, IsOptional } from 'class-validator';
|
||||
import { getConnection } from 'typeorm';
|
||||
import { Donation } from '../../entities/Donation';
|
||||
import { Donor } from '../../entities/Donor';
|
||||
@ -11,11 +10,7 @@ export abstract class CreateDonation {
|
||||
@Exclude()
|
||||
donor: number;
|
||||
|
||||
/**
|
||||
* The donation's paid amount in the smalles unit of your currency (default: euro cent).
|
||||
*/
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@Exclude()
|
||||
paidAmount?: number;
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,12 @@ export class CreateFixedDonation extends CreateDonation {
|
||||
@IsPositive()
|
||||
donor: number;
|
||||
|
||||
/**
|
||||
* The donation's paid amount in the smalles unit of your currency (default: euro cent).
|
||||
*/
|
||||
@IsInt()
|
||||
paidAmount?: number;
|
||||
|
||||
/**
|
||||
* The donation's amount.
|
||||
* The unit is your currency's smallest unit (default: euro cent).
|
||||
|
Loading…
x
Reference in New Issue
Block a user