<?php

namespace App\Modules\Room\Application\ListAll;

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

final class ListAllRoomQueryHandler implements QueryHandler
{
    public function __construct(private RoomAllLister $lister) {}

    public function __invoke(ListAllRoomQuery $query): ListAllRoomResponse
    {
        return new ListAllRoomResponse(
            $this->lister->__invoke(
                $query->dateStart,
                $query->dateEnd,
                $query->orderBy,
                $query->orderType,
                $query->statuses,
                $query->idExtras,
                $query->idProviders,
                $query->locks,
                $query->idCategories,
                $query->idTours,
                $query->idTypeRooms,
                $query->UpgradeStatuses,
                $query->allStatuses,
                $query->allExtras,
                $query->allProviders,
                $query->allLocks,
                $query->allTours,
                $query->allTypeRooms,
                $query->allUpgradeStatuses,
                $query->IdLocation,
                $query->search,
                $query->page,
                $query->limit,
                $query->idRoom,
            )
        );
    }
}
