<?php

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

use App\Modules\DefinedService\TypeDefinedService\Domain\ListTypeDefinedService;
use App\Modules\DefinedService\TypeDefinedService\Domain\TypeDefinedServiceRepository;
use App\Modules\TypeProvider\Domain\IdTypeProvider;

final class TypeDefinedServiceLister
{
    public function __construct(private TypeDefinedServiceRepository $repository) {}

    public function __invoke(IdTypeProvider $idTypeProvider, string $action)
    {
        return $this->repository->search(new ListTypeDefinedService($idTypeProvider, $action));
    }
}
