feat: secure penalty catalog management
This commit is contained in:
19
myteamwallet_backend/src/penalty/dto/update-penalty.dto.ts
Normal file
19
myteamwallet_backend/src/penalty/dto/update-penalty.dto.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsNumber, IsString, Length, Max, Min } from 'class-validator';
|
||||
|
||||
export class UpdatePenaltyDTO {
|
||||
@ApiProperty({ example: 'Zu spät kommen' })
|
||||
@Transform(({ value }) =>
|
||||
typeof value === 'string' ? value.trim() : value,
|
||||
)
|
||||
@IsString()
|
||||
@Length(1, 120)
|
||||
description: string;
|
||||
|
||||
@ApiProperty({ example: 5 })
|
||||
@IsNumber({ maxDecimalPlaces: 2 })
|
||||
@Min(0.01)
|
||||
@Max(10000)
|
||||
amount: number;
|
||||
}
|
||||
Reference in New Issue
Block a user