<?php

declare(strict_types=1);

namespace App\Services\DataForSeo;

final readonly class MatchCandidate
{
    /**
     * @param  list<string>  $reasons
     */
    public function __construct(
        public NormalizedResult $result,
        public int $score,
        public array $reasons,
    ) {}

    /**
     * @return array<string, mixed>
     */
    public function toAuditArray(): array
    {
        return [
            ...$this->result->toArray(),
            'score' => $this->score,
            'reasons' => $this->reasons,
        ];
    }
}
