<?php

declare(strict_types=1);

namespace App\Framework\ErrorAggregation;

use App\Framework\Exception\Core\ErrorSeverity;
use App\Framework\Exception\ErrorHandlerContext;

/**
 * Interface for error aggregation services
 *
 * Provides pattern detection, alerting, and error analysis capabilities
 */
interface ErrorAggregatorInterface
{
    /**
     * Processes a new error from ErrorHandlerContext
     */
    public function processError(ErrorHandlerContext $context): void;

    /**
     * Gets error statistics for a time period
     */
    public function getStatistics(\DateTimeImmutable $from, \DateTimeImmutable $to): array;

    /**
     * Gets active error patterns
     */
    public function getActivePatterns(int $limit = 50, int $offset = 0): array;

    /**
     * Gets recent error events
     */
    public function getRecentEvents(int $limit = 100, ?ErrorSeverity $severity = null): array;
}
