<?php

namespace App\Modules\RoomCalendar\Application\List;

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

final class ListRoomCalendarQueryHandler implements QueryHandler
{
    public function __construct(private RoomCalendarLister $lister) {}

    public function __invoke(ListRoomCalendarQuery $query): ListRoomCalendarResponse
    {
        return new ListRoomCalendarResponse(
            $this->lister->__invoke(
                $query->dateStart,
                $query->dateEnd,
            )
        );
    }
}
