<?php

declare(strict_types=1);

namespace Drupal\ffmpeg_media\Service;

use Drupal\ffmpeg_media\ValueObject\ConversionContext;
use Drupal\file\FileInterface;
use Drupal\media\MediaInterface;

/**
 * Schedules and processes original file retention.
 *
 * @internal Runtime service, not part of the supported contrib extension API.
 */
interface OriginalFileRetentionServiceInterface {

  /**
   * Schedules original file cleanup for a converted media item.
   *
   * @param \Drupal\media\MediaInterface $media
   *   Media entity.
   * @param \Drupal\ffmpeg_media\ValueObject\ConversionContext $context
   *   Conversion context.
   * @param \Drupal\file\FileInterface $sourceFile
   *   Source file entity.
   */
  public function schedule(MediaInterface $media, ConversionContext $context, FileInterface $sourceFile): void;

  /**
   * Processes due retention records.
   *
   * @param int $limit
   *   Maximum number of records to process.
   *
   * @return int
   *   Number of records processed.
   */
  public function processDue(int $limit = 50): int;

}
