<?php

namespace App\Domains\Bootstrap\Controllers;

use App\Domains\Bootstrap\Requests\AdminAppBootstrapRequest;
use App\Domains\Bootstrap\Resources\AdminAppBootstrapResource;
use App\Domains\Bootstrap\Services\AdminAppBootstrapService;
use App\Http\Controllers\Controller;

class AdminAppBootstrapController extends Controller
{
    public function __construct(protected AdminAppBootstrapService $bootstrapService) {}

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