import { ApiPropertyOptional } from "@nestjs/swagger"
import { Type } from "class-transformer"
import { IsNumber, IsOptional, IsString, Min } from "class-validator"

export class VehiclePricingFilterDto {
  @ApiPropertyOptional({
    description: "Search term (applies to name, type, etc.)",
    example: "Sedan",
  })
  @IsOptional()
  @IsString()
  search?: string

  @ApiPropertyOptional({
    description: "Page size (limit)",
    example: 10,
    default: 10,
  })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(1)
  limit?: number

  @ApiPropertyOptional({
    description: "Page offset (skip)",
    example: 0,
    default: 0,
  })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(0)
  skip?: number

  @ApiPropertyOptional({
    description: "Filter by Plan ID",
    example: 1,
  })
  plan_id: number

  @ApiPropertyOptional({
    description: "Filter by Vehicle Type ID",
    example: 2,
  })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  vehicle_type_id?: number

  @ApiPropertyOptional({
    description: "Filter by Service Type ID",
    example: 3,
  })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  service_type_id?: number

  @ApiPropertyOptional({
    description: "Filter by City ID",
    example: 5,
  })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  city_id?: number
}
