<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Distributed\Failover;

final class DistributedLeaseRecoveryResult
{
    public function __construct(
        private readonly int $expired = 0,
        private readonly int $recovered = 0,
        private readonly array $affectedLeases = []
    ) {}

    public function expired(): int { return $this->expired; }
    public function recovered(): int { return $this->recovered; }

    public function toArray(): array
    {
        return [
            'expired' => $this->expired,
            'recovered' => $this->recovered,
            'affectedLeases' => $this->affectedLeases,
        ];
    }
}
