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

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

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

  @ApiProperty({ required: false })
  @Transform(({ value }) => stringToBool(value))
  @IsOptional()
  isInternal: boolean;
}
