<?php

namespace App\Modules\DefinedService\Route\Application\List;

use App\Modules\DefinedService\Route\Domain\ListRoute;
use App\Modules\DefinedService\Route\Domain\RouteDescription;
use App\Modules\DefinedService\Route\Domain\RouteRepository;

final class RouteLister
{
    public function __construct(private RouteRepository $repository) {}

    public function __invoke(RouteDescription $description, string $action)
    {
        return $this->repository->search(new ListRoute($description, $action));
    }
}
