<?php

namespace App\Modules\BookingExtraPassenger\Application\Partners;

use App\Modules\BookingExtraPassenger\Application\Partners\BookingExtraPassengerPartnersResponses;

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

final class PartnersBookingExtraPassengerQueryHandler implements QueryHandler
{
    public function __construct(private BookingExtraPassengerPartnersLister $lister) {}

    public function __invoke(PartnersBookingExtraPassengerQuery $query): BookingExtraPassengerPartnersResponses
    {
        return new BookingExtraPassengerPartnersResponses(
            $this->lister->__invoke(new IdBookingExtraPassenger($query->idBookingExtraPassenger())
        ));
    }
}
