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

use App\Http\Controllers\Controller;

use App\Http\Helpers\ResponseBuilder;
use App\Modules\LeadBookingServicePassenger\Application\Index\LeadBookingServicePassengerIndexerQuery;
use App\Modules\LeadBookingServicePassenger\Application\Index\LeadBookingServicePassengerIndexerResponse;
use App\Modules\Shared\Domain\Bus\Query\QueryBus;

class LeadBookingServicePassengerIndexController extends Controller
{

    public function __construct(
        private QueryBus $queryBus
    ) {
    }

    public function __invoke($Id)
    {
        /** @var LeadBookingServicePassengerIndexerResponse $response */
        $response = $this->queryBus->ask(new LeadBookingServicePassengerIndexerQuery($Id));

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