<?php
/**
 * LogRepositoryInterface - Contract for log storage implementations
 *
 * Defines the interface for log storage backends. SDK provides framework-agnostic
 * queue implementations, plugins provide platform-specific repositories.
 */

namespace CloudXM\SDK\Queue;

interface LogRepositoryInterface
{
    /**
     * Insert a log record
     */
    public function insert(string $table, array $data): bool;

    /**
     * Select a batch of log records for processing
     */
    public function selectBatch(string $table, int $limit, int $minId = 0): array;

    /**
     * Update attempts counter for claimed records
     */
    public function updateAttempts(string $table, array $ids): bool;

    /**
     * Delete multiple log records
     */
    public function delete(string $table, array $ids): bool;

    /**
     * Update attempts counter for failed records
     */
    public function bumpAttempts(string $table, array $ids): bool;

    /**
     * Get statistics about log records
     */
    public function getStats(string $table): array;

    /**
     * Clear all records from table
     */
    public function clearAll(string $table): bool;

    /**
     * Purge old records based on age
     */
    public function purgeOld(string $table, int $maxAgeSeconds): int;
}