<?php

declare(strict_types=1);

namespace App\Framework\CircuitBreaker\Events;

use App\Framework\CircuitBreaker\CircuitBreakerMetrics;
use App\Framework\CircuitBreaker\CircuitState;
use App\Framework\Core\ValueObjects\Timestamp;

/**
 * Interface for all Circuit Breaker events
 */
interface CircuitBreakerEvent
{
    public string $service {get;}

    public string $namespace {get;}

    public CircuitState $previousState {get;}

    public CircuitState $newState {get;}

    public CircuitBreakerMetrics $metrics {get;}

    public Timestamp $occurredAt {get;}

    public ?string $reason {get;}

    public string $eventType {get;}

    public string $severity {get;}

    public function getDescription(): string;

    public function toArray(): array;
}
