<?php
/**
 * BookiFlex Core
 *
 * @package    BookiFlex
 * @subpackage Core
 * @author     BookiFlex
 * @copyright  Copyright (c) 2025 BookiFlex
 * @license    GPL-2.0-or-later
 *
 * @link       https://bookiflex.com
 */

declare(strict_types=1);

namespace BookiFlex\Core\Contract\Queue;

defined( 'ABSPATH' ) || exit;

/**
 * Interface for queue job handlers
 */
interface QueueJobInterface
{
    /**
     * Handle the queued job
     *
     * @param array $args Arguments passed from the queue
     * @return void
     * @throws \Exception If job execution fails
     */
    public function handle(array $args): void;

    /**
     * Get the unique hook identifier for this job
     *
     * @return string Hook identifier (e.g., 'bookiflex_send_notification')
     */
    public function getHook(): string;

    /**
     * Get the maximum number of retry attempts for this job
     *
     * @return int Maximum attempts (0 = no retries, -1 = unlimited retries)
     */
    public function getMaxAttempts(): int;
}
