<?php

namespace App\Modules\BookingTourPassenger\Application\SearchRoom;

use App\Modules\BookingTourPassenger\Domain\IdBookingTourPassenger;
use App\Modules\Shared\Domain\Bus\Query\QueryHandler;

final class SearchRoomBookingTourPassengerQueryHandler implements QueryHandler
{
    public function __construct(private BookingTourPassengerRoomSearcher $changer) {}

    public function __invoke(SearchRoomBookingTourPassengerQuery $query): SearchRoomBookingTourPassengerResponse
    {
        return $this->changer->__invoke(
            new IdBookingTourPassenger($query->id)
        );
    }
}
