<?php

declare(strict_types=1);

namespace App\Support\RestoreSafety;

final readonly class ExecutionReadinessState
{
    /**
     * @param  list<string>  $blockingReasons
     */
    public function __construct(
        public bool $allowed,
        public array $blockingReasons,
        public string $mutationScope,
        public string $requiredCapability,
        public string $displaySummary,
    ) {}

    /**
     * @return array{
     *     allowed: bool,
     *     blocking_reasons: list<string>,
     *     mutation_scope: string,
     *     required_capability: string,
     *     display_summary: string
     * }
     */
    public function toArray(): array
    {
        return [
            'allowed' => $this->allowed,
            'blocking_reasons' => $this->blockingReasons,
            'mutation_scope' => $this->mutationScope,
            'required_capability' => $this->requiredCapability,
            'display_summary' => $this->displaySummary,
        ];
    }
}
