import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsArray, IsDateString, IsOptional, IsUUID } from 'class-validator';

export class GetDuplicateSeatsQuery {
  @ApiProperty({ example: '2026-07-17', description: 'Schedule date (YYYY-MM-DD)' })
  @IsDateString()
  date: string;

  @ApiPropertyOptional({ description: 'Filter to a specific schedule ID' })
  @IsOptional()
  @IsUUID()
  scheduleId?: string;
}

export class ResolveDuplicatesDto {
  @ApiProperty({
    description: 'BookingSeat IDs of the duplicate bookings to reassign',
    type: [String],
    example: ['uuid-booking-seat-1', 'uuid-booking-seat-2'],
  })
  @IsArray()
  @IsUUID(undefined, { each: true })
  bookingSeatIds: string[];

  @ApiProperty({
    description: 'Coach IDs to source replacement seats from (searched in order; first available seat per coach is used)',
    type: [String],
    example: ['uuid-coach-1', 'uuid-coach-2'],
  })
  @IsArray()
  @IsUUID(undefined, { each: true })
  coachIds: string[];
}
