import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsNotEmpty, IsOptional } from 'class-validator';
import { stringToBool } from '../../../utils';

export class CreateCustomerrDto {
  @ApiProperty({ required: true })
  @IsNotEmpty()
  name: string;

  @ApiProperty({ type: 'string', format: 'binary', required: true })
  image: any;

  @ApiProperty({ required: false })
  @IsOptional()
  percentVAT: number;

  @ApiProperty({ required: true })
  @Transform(({ value }) => stringToBool(value))
  @IsNotEmpty()
  special: boolean;
}
