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

export class CreateGalleryDto {
  @ApiProperty({ required: true })
  @IsNotEmpty()
  title: string;

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

  @ApiProperty()
  @Transform(({ value }) => stringToBool(value))
  @IsNotEmpty()
  isActive: boolean;
}
