import { IsUUID, IsString, IsDateString, IsNumber, IsOptional, IsEnum } from 'class-validator';
import { IncidentType, IncidentSeverity, IncidentStatus } from '../entities/incident.entity';

export class CreateIncidentDto {
  @IsOptional()
  @IsUUID()
  vehicleId?: string;

  @IsOptional()
  @IsUUID()
  driverId?: string;

  @IsOptional()
  @IsUUID()
  bookingId?: string;

  @IsEnum(IncidentType)
  type!: IncidentType;

  @IsEnum(IncidentSeverity)
  severity!: IncidentSeverity;

  @IsDateString()
  occurredAt!: string;

  @IsOptional()
  @IsString()
  location?: string;

  @IsString()
  description!: string;

  @IsOptional()
  @IsNumber()
  damageEstimate?: number;

  @IsOptional()
  @IsEnum(IncidentStatus)
  status?: IncidentStatus;

  @IsOptional()
  @IsString()
  insuranceClaimNumber?: string;

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