<?php

namespace App\Modules\GroupPassenger\Application\SearchRoom;

use App\Modules\BookingTourPassenger\Application\Find\FindBookingTourPassengerQuery;
use App\Modules\BookingTourPassenger\Application\GetItem\GetItemBookingTourPassengerQuery;
use App\Modules\BookingTourPassenger\Application\GetItem\GetItemBookingTourPassengerResponse;
use App\Modules\BookingTourPassenger\Domain\IdBookingTourPassenger;
use App\Modules\Shared\Domain\Bus\Query\QueryBus;

class GroupPassengerRoomSearcher
{

    public function __construct(
        private QueryBus $queryBus
    ) {
        // $this->repository = $repository;
    }

    public function __invoke(IdBookingTourPassenger $id)
    {
        /** @var GetItemBookingTourPassengerResponse $response */
        $response = $this->queryBus->ask(new GetItemBookingTourPassengerQuery($id->value()));
        return $response->response();
    }
}
