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

export class CreateVehicleInsuranceDto {
  @ApiProperty({
    description: "Unique insurance policy number",
    example: "POLICY-2025-001",
  })
  @IsString()
  @IsNotEmpty()
  policy_number: string

  @ApiProperty({
    description: "Insurance provider name",
    example: "ICICI Lombard",
  })
  @IsString()
  @IsNotEmpty()
  insurance_provider: string

  @ApiProperty({
    description: "Type of insurance coverage",
    example: "Comprehensive",
  })
  @IsString()
  @IsNotEmpty()
  coverage_type: string

  @ApiProperty({
    description: "Policy start date (YYYY-MM-DD)",
    example: "2025-01-01",
  })
  @IsString()
  @IsNotEmpty()
  start_date: string

  @ApiProperty({
    description: "Policy end date (YYYY-MM-DD)",
    example: "2026-01-01",
  })
  @IsString()
  @IsNotEmpty()
  end_date: string

  @ApiProperty({
    description: "Whether this is the currently active policy",
    // example: true,
    // required: false,
    // type: String,
  })
  @IsOptional()
  is_active_policy?: string

  @ApiProperty({
    description: "Status of the policy",
    example: "active",
    required: false,
    enum: ["active", "inactive", "expired"],
  })
  @IsString()
  @IsOptional()
  status?: string

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

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