import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsInt, IsNotEmpty } from 'class-validator'; export class OrderItemIdDto { @ApiProperty({ description: 'id identifier' }) @IsNotEmpty() @IsInt() @Transform(({ value }) => value !== undefined ? Number(value) : undefined) id!: number; }