import { IsArray, ValidateNested, IsNumber, IsString, IsIn, IsOptional } from 'class-validator';
import { Type } from 'class-transformer';

export class AwardItem {
  @IsNumber()
  workId: number;

  @IsString()
  @IsIn(['first', 'second', 'third', 'excellent', 'none'])
  awardLevel: string;

  @IsString()
  @IsOptional()
  awardName?: string;
}

export class BatchSetAwardsDto {
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => AwardItem)
  awards: AwardItem[];
}
