import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
  IsArray,
  IsBoolean,
  IsOptional,
  IsString,
  ValidateNested,
} from 'class-validator';
import { DateRangeDto } from 'src/utils/datetime/dateRangeDto';
import { PaginationDto } from 'src/config/pagination/paginationDto';

export class SearchVisaCommissionDto extends PaginationDto {
  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  search_title?: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  association_type?: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  product_id?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  visa_country_id?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  visa_client_country_id?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  created_by?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  updated_by?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  student_condition?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  currency?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  campus_condition?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  study_level_condition?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  course_condition?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  active?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  associate_id?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsBoolean()
  is_csv?: boolean = false;

  @ApiPropertyOptional({ type: DateRangeDto })
  @IsOptional()
  @ValidateNested()
  @Type(() => DateRangeDto)
  created_on?: DateRangeDto;

  @ApiPropertyOptional({ type: DateRangeDto })
  @IsOptional()
  @ValidateNested()
  @Type(() => DateRangeDto)
  updated_on?: DateRangeDto;
}
