<?php

namespace App\Modules\TourLock\Application\List;

use App\Modules\TourLock\Domain\ListTourLock;
use App\Modules\TourLock\Domain\TourLockRepository;
use App\Modules\Shared\Domain\DateStart;
use App\Modules\Tour\Domain\IdTour;

final class TourLockLister
{
    public function __construct(private TourLockRepository $repository) {}

    public function __invoke(IdTour $idTour, ?DateStart $dateStart)
    {
        return $this->repository->search(new ListTourLock($idTour, $dateStart));
    }
}
