Marked payedAmount as optional during creation and/or update

ref #193
This commit is contained in:
Nicolai Ort 2021-04-14 18:29:40 +02:00
parent 34dbaaafe0
commit 0636616dad
2 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { IsInt, IsPositive } from 'class-validator';
import { IsInt, IsOptional, IsPositive } from 'class-validator';
import { getConnection } from 'typeorm';
import { DonorNotFoundError } from '../../../errors/DonorErrors';
import { Donation } from '../../entities/Donation';
@ -20,7 +20,8 @@ export abstract class CreateDonation {
* The donation's payed amount in the smalles unit of your currency (default: euro cent).
*/
@IsInt()
payedAmount: number;
@IsOptional()
payedAmount?: number;
/**
* Creates a new Donation entity from this.

View File

@ -1,4 +1,4 @@
import { IsInt, IsPositive } from 'class-validator';
import { IsInt, IsOptional, IsPositive } from 'class-validator';
import { getConnection } from 'typeorm';
import { DonorNotFoundError } from '../../../errors/DonorErrors';
import { Donation } from '../../entities/Donation';
@ -27,7 +27,8 @@ export abstract class UpdateDonation {
* The donation's payed amount in the smalles unit of your currency (default: euro cent).
*/
@IsInt()
payedAmount: number;
@IsOptional()
payedAmount?: number;
/**
* Creates a new Donation entity from this.