<?php

namespace App\Modules\Booking\Application\Index;

use App\Modules\Booking\Domain\IdBooking;
use App\Modules\Shared\Domain\Bus\Query\QueryHandler;

final class IndexBookingQueryHandler implements QueryHandler
{
    public function __construct(private BookingIndexer $changer) {}

    public function __invoke(IndexBookingQuery $query): IndexBookingResponse
    {
        return $this->changer->__invoke(
            new IdBooking($query->id())
        );
    }
}
