<?php

namespace App\Domains\Bootstrap\Controllers;

use App\Domains\Bootstrap\Requests\ScannerBootstrapRequest;
use App\Domains\Bootstrap\Resources\ScannerBootstrapResource;
use App\Domains\Bootstrap\Services\ScannerBootstrapService;
use App\Http\Controllers\Controller;

class ScannerBootstrapController extends Controller
{
    public function __construct(protected ScannerBootstrapService $bootstrapService) {}

    public function __invoke(ScannerBootstrapRequest $request): ScannerBootstrapResource
    {
        return ScannerBootstrapResource::make(
            $this->bootstrapService->get((string) $request->validated('dominio'))
        );
    }
}
