import { PENALTY_TYPE_VALUES } from '@core/racing/domain/entities/penalty/PenaltyType';
import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';

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

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

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

  @ApiProperty({ enum: PENALTY_TYPE_VALUES })
  @IsEnum(PENALTY_TYPE_VALUES)
  type!: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsNumber()
  value?: number;

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

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

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