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

export class FilterCustomerDto {
  @ApiProperty({
    description: "Search by company name, client type, or phone number",
    example: "Acme",
    required: false,
  })
  @IsOptional()
  @IsString()
  search?: string

  @ApiProperty({
    description: "Limit",
    example: 10,
    required: false,
  })
  @IsOptional()
  @IsInt()
  limit?: number

  @ApiProperty({
    description: "Skip",
    example: 0,
    required: false,
  })
  @IsOptional()
  @IsInt()
  skip?: number

  @ApiProperty({
    description: "Country ID to filter by country",
    example: 91,
    required: false,
  })
  @IsOptional()
  @IsInt()
  country_id?: number

  @ApiProperty({
    description: "Client ID to filter by client",
    example: 91,
    required: false,
  })
  @IsOptional()
  @IsInt()
  client_id?: number

  @ApiProperty({
    description: "Indicates whether the user is a medical patients.",
    required: false,
    enum: ["true", "false"],
  })
  @IsOptional()
  is_medical_patient?: string

  @ApiProperty({
    description: "Indicates whether the user is direct customer or not.",
    required: false,
    enum: ["true", "false"],
  })
  @IsOptional()
  is_direct_customer?: string

  @ApiProperty({
    description: "Hospital ID to filter by hospital",
    example: 91,
    required: false,
  })
  @IsOptional()
  @IsInt()
  hospital_id?: number

  @ApiProperty({
    description: "Enter the prn number",
    required: false,
  })
  @IsOptional()
  prn_number?: string

  @ApiProperty({
    description:
      "Indicates whether the API is being used for the customer dropdown",
    required: false,
    type: Boolean,
  })
  @IsOptional()
  is_customer_dropdown?: boolean

  @ApiProperty({
    description: "Filter customers by those assigned to a dispatcher",
    required: false,
  })
  @IsOptional()
  dispatcher_id?: number
}
