<?php

namespace App\Modules\BookingExtraPassenger\Application\UpdateStatus;

use App\Modules\BookingExtraPassenger\Domain\IdBookingExtraPassenger;
use App\Modules\Room\Domain\IdRoom;
use App\Modules\Shared\Domain\Bus\Query\QueryHandler;

final class UpdateStatusBookingExtraPassengerQueryHandler implements QueryHandler
{
    public function __construct(private BookingExtraPassengerUpdateStatusLister $lister) {}

    public function __invoke(UpdateStatusBookingExtraPassengerQuery $query): UpdateStatusBookingExtraPassengerResponse
    {
        return $this->lister->__invoke(new IdRoom($query->id()), $query->status());
    }
}
