<?php

namespace App\Support;

use App\Models\AdminSite;
use App\Models\AgentNode;

final class AgentLinePresenter
{
    /** @return array<string, mixed> */
    public static function provisioned(AdminSite $site, AgentNode $root): array
    {
        $sitePayload = AdminIntegrationSitePresenter::detail($site);

        return array_merge($sitePayload, [
            'agent_node' => AgentNodePresenter::item($root),
            'line_root' => [
                'agent_node_id' => (int) $root->id,
                'site_code' => (string) $site->code,
                'is_line_root' => true,
            ],
        ]);
    }
}
