<?php

namespace App\Modules\Tour\Application\ListToursByType;

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

class ListToursByTypeQueryHandler implements QueryHandler
{
    public function __construct(
        private ToursByTypeLister $toursByTypeLister
    ) {}

    public function __invoke(ListToursByTypeQuery $query)
    {
        $search = $this->toursByTypeLister->__invoke($query->tourTypeId);
        return new ListToursByTypeQueryResponse($search);
    }
}
