import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString, IsUrl, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { ProtestIncidentDTO } from './ProtestIncidentDTO';

export class FileProtestCommandDTO {
  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  raceId!: string;

  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  protestingDriverId!: string;

  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  accusedDriverId!: string;

  @ApiProperty()
  @ValidateNested()
  @Type(() => ProtestIncidentDTO)
  incident!: ProtestIncidentDTO;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  comment?: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  @IsUrl()
  proofVideoUrl?: string;
}
