import { IsOptional, IsBoolean, Matches } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';

export class UpdateWorkScheduleDto {
  @ApiPropertyOptional({
    description: 'Start time in HH:mm format',
    example: '10:00',
  })
  @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
    message: 'startTime must be in HH:mm format (e.g. "10:00")',
  })
  @IsOptional()
  startTime?: string;

  @ApiPropertyOptional({
    description: 'End time in HH:mm format',
    example: '19:00',
  })
  @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
    message: 'endTime must be in HH:mm format (e.g. "19:00")',
  })
  @IsOptional()
  endTime?: string;

  @ApiPropertyOptional({
    description: 'Whether the trainer is available on this schedule',
  })
  @IsBoolean()
  @IsOptional()
  isAvailable?: boolean;
}
