import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator';
import { Type } from 'class-transformer';

export class CheckDuplicatesDto {
  @IsOptional()
  @IsString()
  company?: string;

  @IsOptional()
  @IsString()
  contact?: string;

  @IsOptional()
  @IsString()
  phone?: string;

  @IsOptional()
  @IsEmail()
  email?: string;

  @IsOptional()
  @IsInt()
  @Type(() => Number)
  ignore_id?: number;
}

export class RequestHandoverDto {
  @IsString()
  @IsNotEmpty()
  @MaxLength(150)
  reason: string;

  @IsOptional()
  @IsString()
  @MaxLength(1000)
  note?: string;
}
