import { IsNumber, IsString } from 'class-validator';

/**
 * DTO used to remove an attachment from a record.
 *
 * Contains the necessary identifiers and metadata
 * to locate and delete the attachment.
 */
export class RemoveAttachmentDto {
  /**
   * Identifier of the entity from which the attachment is to be removed.
   * Required field.
   */
  @IsString()
  id: string;

  /**
   * Row ID of the specific attachment entry in the database.
   * Required field.
   */
  @IsNumber()
  row_id: number;

  /**
   * Name of the file to be removed.
   * Required field.
   */
  @IsString()
  file_name: string;

  /**
   * URL or path of the file to be removed.
   * Required field.
   */
  @IsString()
  file_url: string;
}
