import { IsString, IsEmail, IsDateString, IsEnum, IsOptional, IsArray } from 'class-validator';
import { DriverStatus } from '../entities/driver.entity';

export class CreateDriverDto {
  @IsString()
  licenseNumber!: string;

  @IsString()
  firstName!: string;

  @IsString()
  lastName!: string;

  @IsEmail()
  email!: string;

  @IsString()
  phoneNumber!: string;

  @IsDateString()
  dateOfBirth!: string;

  @IsDateString()
  licenseExpiryDate!: string;

  @IsEnum(DriverStatus)
  status!: DriverStatus;

  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  vehicleTypesAuthorized?: string[];

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

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

  @IsOptional()
  @IsString()
  notes?: string;
}
