/**
 * DTO used to attach one or more files to a specific entity.
 *
 * Commonly used in modules where documents, images,
 * or other supporting files need to be linked.
 */
import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsArray, IsOptional, IsString } from 'class-validator';

export class AddAttachmentDto {
  /**
   * Primary identifier of the entity
   * (e.g., lead ID, client ID, request ID).
   */
  @IsString()
  id: string;

  /**
   * Entity or module type for which
   * the attachment is being added.
   *
   * Example: 'lead', 'client', 'visa_case'
   */
  @IsString()
  type: string;

  /**
   * List of attachment file names or paths.
   *
   * Optional field:
   * - Supports multiple files
   * - Each entry must be a string
   */
  @ApiPropertyOptional({ type: [String] })
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  attachment_file?: string[];
}
