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