import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { ArrayNotEmpty, IsArray, IsIn, IsOptional, IsString, IsUUID } from 'class-validator';

/** Bulk-receive eligible PAID bookings into a warehouse location, by trade direction. */
export class BulkReceiveDto {
  @ApiProperty({ enum: ['IMPORT', 'EXPORT'] })
  @IsIn(['IMPORT', 'EXPORT'])
  direction!: 'IMPORT' | 'EXPORT';

  @ApiProperty({ format: 'uuid' })
  @IsUUID()
  warehouseId!: string;

  @ApiProperty({ format: 'uuid' })
  @IsUUID()
  yardId!: string;

  @ApiProperty({ format: 'uuid' })
  @IsUUID()
  zoneId!: string;

  @ApiProperty({ type: [String], format: 'uuid' })
  @IsArray()
  @ArrayNotEmpty()
  @IsUUID('all', { each: true })
  bookingIds!: string[];

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