import { IsArray, ValidateNested, IsUUID, IsInt, Min } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';

export class RotationEntryDto {
  @ApiProperty({ example: '550e8400-e29b-41d4-a716-446655440000' })
  @IsUUID()
  map_id: string;

  @ApiProperty({ example: 1 })
  @IsInt()
  @Min(0)
  rotation_order: number;
}

export class UpdateRotationDto {
  @ApiProperty({ type: [RotationEntryDto] })
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => RotationEntryDto)
  maps: RotationEntryDto[];
}
