<?php
namespace App\Http\Controllers\Owner\External;

use App\Http\Controllers\Controller;

use App\Http\Helpers\ResponseBuilder;
use App\Modules\External\Application\ExternalIndexer;
use App\Modules\External\Domain\IdExternal;
use App\Modules\External\Infraestructure\MysqlExternalRepository;

class ExternalIndexController extends Controller
{
    public function __construct()
    {
    }

    public function __invoke($Id)
    {
        $response = (new ExternalIndexer(new MysqlExternalRepository()))
            ->__invoke(new IdExternal($Id));

        return ResponseBuilder::Response($response);
    }
}
