import { IsIn, IsOptional, IsString, IsUUID } from 'class-validator';

import {
  INTERCHANGE_DIRECTIONS,
  INTERCHANGE_DOCUMENT_STATUSES,
  InterchangeDirection,
  InterchangeDocumentStatus,
} from '../entities/interchange-document.entity';

export class InterchangeDocumentQueryDto {
  @IsOptional()
  @IsIn(INTERCHANGE_DIRECTIONS)
  direction?: InterchangeDirection;

  @IsOptional()
  @IsIn(INTERCHANGE_DOCUMENT_STATUSES)
  status?: InterchangeDocumentStatus;

  @IsOptional()
  @IsUUID()
  scheduleId?: string;

  @IsOptional()
  @IsString()
  documentNo?: string;

  @IsOptional()
  @IsString()
  dateFrom?: string;

  @IsOptional()
  @IsString()
  dateTo?: string;

  @IsOptional()
  @IsString()
  search?: string;
}
