import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsString, IsInt, IsNumber, IsOptional, IsArray, Min, Max } from 'class-validator';

export class UpdateBattleTokenDto {
  @ApiPropertyOptional({ description: 'Token display name' })
  @IsOptional()
  @IsString()
  name?: string;

  @ApiPropertyOptional({ description: 'X position on grid' })
  @IsOptional()
  @IsNumber()
  positionX?: number;

  @ApiPropertyOptional({ description: 'Y position on grid' })
  @IsOptional()
  @IsNumber()
  positionY?: number;

  @ApiPropertyOptional({ description: 'Current HP' })
  @IsOptional()
  @IsInt()
  @Min(0)
  hpCurrent?: number;

  @ApiPropertyOptional({ description: 'Maximum HP' })
  @IsOptional()
  @IsInt()
  @Min(1)
  hpMax?: number;

  @ApiPropertyOptional({ description: 'Initiative value' })
  @IsOptional()
  @IsInt()
  initiative?: number;

  @ApiPropertyOptional({ description: 'Active conditions', type: [String] })
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  conditions?: string[];

  @ApiPropertyOptional({ description: 'Token size (1=Medium, 2=Large, etc.)' })
  @IsOptional()
  @IsInt()
  @Min(1)
  @Max(6)
  size?: number;
}
