Files
teamwallet/myteamwallet_backend/src/penalty/dto/update-penalty.dto.ts
2026-08-01 13:17:44 +02:00

20 lines
503 B
TypeScript

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