import { ApiProperty } from "@nestjs/swagger"
import { IsString, IsNotEmpty, IsOptional, IsNumber } from "class-validator"

export class UpdateVehicleMaintenanceDto {
  @ApiProperty({
    description: "Type of maintenance performed",
    example: "Regular Service",
  })
  @IsString()
  @IsNotEmpty()
  maintenance_type: string

  @ApiProperty({
    description: "Detailed description of the maintenance",
    example: "Oil change, filter replacement, brake check",
    required: false,
  })
  @IsString()
  @IsOptional()
  description?: string

  @ApiProperty({
    description: "Date when the maintenance was performed (YYYY-MM-DD)",
    example: "2025-06-05",
  })
  @IsString()
  @IsNotEmpty()
  maintenance_date: string

  @ApiProperty({
    description: "Cost of the maintenance service",
    example: 5000,
  })
  @IsNumber()
  @IsNotEmpty()
  cost: number

  @ApiProperty({
    description: "Service center or individual who performed the maintenance",
    example: "City Auto Service",
    required: false,
  })
  @IsString()
  @IsOptional()
  performed_by?: string

  @ApiProperty({
    description: "Status of the maintenance record",
    example: "Completed",
    required: false,
    enum: ["scheduled", "overdue", "completed"],
  })
  @IsString()
  @IsOptional()
  status?: string

  @ApiProperty({
    description: "Next scheduled maintenance date (YYYY-MM-DD)",
    example: "2025-09-05",
    required: false,
  })
  @IsString()
  @IsOptional()
  next_scheduled_maintenance?: string

  @ApiProperty({
    type: "string",
    format: "binary",
    description: "Upload maintenance/service document (PDF or file)",
    required: false,
  })
  @IsOptional()
  document_file?: any

  @ApiProperty({
    description: "ID of the associated fleet/vehicle",
    example: 3,
  })
  @IsNumber()
  @IsNotEmpty()
  fleet_id: number
}
