import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsDate, IsEnum } from 'class-validator';
import { Type } from 'class-transformer';

// TODO: protests are filed at race level but also managed on league level

export class ProtestDTO {
  @ApiProperty()
  @IsString()
  id: string;

  @ApiProperty()
  @IsString()
  raceId: string;

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

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

  @ApiProperty()
  @IsDate()
  @Type(() => Date)
  submittedAt: Date;

  @ApiProperty()
  @IsString()
  description: string;

  @ApiProperty({ enum: ['pending', 'accepted', 'rejected'] })
  @IsEnum(['pending', 'accepted', 'rejected'])
  status: 'pending' | 'accepted' | 'rejected';
}