import {
  IsDateString,
  IsNotEmpty,
  IsOptional,
  IsInt,
  IsUUID,
  Min,
  Max,
} from 'class-validator';
import { Type } from 'class-transformer';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class RescheduleTrainingDto {
  @ApiProperty({
    description: 'New scheduled date and time in ISO format',
    example: '2026-03-02T14:00:00.000Z',
  })
  @IsDateString()
  @IsNotEmpty()
  scheduledAt: string;

  @ApiPropertyOptional({
    description: 'New duration in minutes (15-480)',
    minimum: 15,
    maximum: 480,
  })
  @Type(() => Number)
  @IsInt()
  @Min(15)
  @Max(480)
  @IsOptional()
  duration?: number;

  @ApiPropertyOptional({
    description: 'New room UUID',
    example: '550e8400-e29b-41d4-a716-446655440002',
  })
  @IsUUID()
  @IsOptional()
  roomId?: string;
}
