refactor(donations): Make anon prepaid

This commit is contained in:
Nicolai Ort 2025-04-28 19:32:06 +02:00
parent 7697acff82
commit 02b1cb9904
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
4 changed files with 14 additions and 7 deletions

View File

@ -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;
}

View File

@ -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.

View File

@ -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;
/**

View File

@ -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).