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

import {
  WAREHOUSE_INVENTORY_STATUSES,
  WarehouseInventoryStatus,
} from '../entities/warehouse-inventory.entity';

export class FilterWarehouseInventoryDto {
  @ApiPropertyOptional({ format: 'uuid' })
  @IsOptional()
  @IsUUID()
  warehouseId?: string;

  @ApiPropertyOptional({ format: 'uuid' })
  @IsOptional()
  @IsUUID()
  yardId?: string;

  @ApiPropertyOptional({ format: 'uuid' })
  @IsOptional()
  @IsUUID()
  zoneId?: string;

  @ApiPropertyOptional({ format: 'uuid' })
  @IsOptional()
  @IsUUID()
  bookingId?: string;

  @ApiPropertyOptional({ format: 'uuid' })
  @IsOptional()
  @IsUUID()
  cargoId?: string;

  @ApiPropertyOptional({ format: 'uuid' })
  @IsOptional()
  @IsUUID()
  containerId?: string;

  @ApiPropertyOptional({ format: 'uuid' })
  @IsOptional()
  @IsUUID()
  goodsId?: string;

  @ApiPropertyOptional({ enum: WAREHOUSE_INVENTORY_STATUSES })
  @IsOptional()
  @IsEnum(WAREHOUSE_INVENTORY_STATUSES)
  status?: WarehouseInventoryStatus;

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