import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsEnum, IsOptional, IsString } from 'class-validator';

import { RouteStatus } from '../entities/route.entity';

export class FilterRoutesDto {
  @ApiPropertyOptional({ description: 'Search origin/destination yard codes or names' })
  @IsOptional()
  @IsString()
  search?: string;

  @ApiPropertyOptional({ enum: ['AVAILABLE', 'MAINTENANCE', 'DAMAGED', 'STOP_WORKING'] })
  @IsOptional()
  @IsEnum(['AVAILABLE', 'MAINTENANCE', 'DAMAGED', 'STOP_WORKING'])
  status?: RouteStatus;
}
