From c5738d269b4dd66bb049db4ef05129994a86b0bc Mon Sep 17 00:00:00 2001 From: Matthieu Date: Sat, 20 Jun 2026 18:51:49 +0200 Subject: [PATCH] feat(directory) : migrate Client into Directory module (back) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LST-58 (2.4), part 1/2 — Client move. Prospect + repertoire front are pending the product spec and will be added on this branch afterward. - Client entity moved to src/Module/Directory/Domain/Entity; repository split into Domain/Repository/ClientRepositoryInterface + Doctrine impl (bound in services.yaml). 5 client MCP tools moved to Infrastructure/Mcp/Tool, now injecting the interface. - resolve_target_entities ClientInterface repointed to Directory\Client; Directory mapping added; DirectoryModule registered (id directory, 2 RBAC perms). Client.projects relation now uses ProjectInterface -> Directory no longer depends on ProjectManagement. - ProjectManagement Create/UpdateProjectTool inject Directory's ClientRepositoryInterface; Serializer and fixtures repointed. - Garde-fous: #[Auditable] + Timestampable/Blamable on Client (additive migration: created_at/updated_at + created_by/updated_by FK ON DELETE SET NULL + COMMENT). 161 tests green, mapping valid, no API route regression, cs-fixer clean. --- config/modules.php | 2 + config/packages/doctrine.yaml | 7 ++- config/services.yaml | 2 + migrations/Version20260620180000.php | 53 +++++++++++++++++++ src/DataFixtures/AppFixtures.php | 2 +- src/Mcp/Tool/Serializer.php | 2 +- src/Module/Directory/DirectoryModule.php | 41 ++++++++++++++ .../Directory/Domain}/Entity/Client.php | 23 +++++--- .../Repository/ClientRepositoryInterface.php | 20 +++++++ .../Doctrine/DoctrineClientRepository.php | 26 +++++++++ .../Mcp/Tool}/CreateClientTool.php | 4 +- .../Mcp/Tool}/DeleteClientTool.php | 8 +-- .../Mcp/Tool}/GetClientTool.php | 8 +-- .../Mcp/Tool}/ListClientsTool.php | 6 +-- .../Mcp/Tool}/UpdateClientTool.php | 8 +-- .../Mcp/Tool/Project/CreateProjectTool.php | 6 +-- .../Mcp/Tool/Project/UpdateProjectTool.php | 6 +-- src/Repository/ClientRepository.php | 17 ------ 18 files changed, 190 insertions(+), 51 deletions(-) create mode 100644 migrations/Version20260620180000.php create mode 100644 src/Module/Directory/DirectoryModule.php rename src/{ => Module/Directory/Domain}/Entity/Client.php (82%) create mode 100644 src/Module/Directory/Domain/Repository/ClientRepositoryInterface.php create mode 100644 src/Module/Directory/Infrastructure/Doctrine/DoctrineClientRepository.php rename src/{Mcp/Tool/Reference => Module/Directory/Infrastructure/Mcp/Tool}/CreateClientTool.php (92%) rename src/{Mcp/Tool/Reference => Module/Directory/Infrastructure/Mcp/Tool}/DeleteClientTool.php (81%) rename src/{Mcp/Tool/Reference => Module/Directory/Infrastructure/Mcp/Tool}/GetClientTool.php (77%) rename src/{Mcp/Tool/Reference => Module/Directory/Infrastructure/Mcp/Tool}/ListClientsTool.php (82%) rename src/{Mcp/Tool/Reference => Module/Directory/Infrastructure/Mcp/Tool}/UpdateClientTool.php (87%) delete mode 100644 src/Repository/ClientRepository.php diff --git a/config/modules.php b/config/modules.php index 9a03656..a799714 100644 --- a/config/modules.php +++ b/config/modules.php @@ -9,6 +9,7 @@ declare(strict_types=1); use App\Module\Absence\AbsenceModule; use App\Module\Core\CoreModule; +use App\Module\Directory\DirectoryModule; use App\Module\ProjectManagement\ProjectManagementModule; use App\Module\TimeTracking\TimeTrackingModule; @@ -17,4 +18,5 @@ return [ TimeTrackingModule::class, ProjectManagementModule::class, AbsenceModule::class, + DirectoryModule::class, ]; diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index 6b872cf..9157f14 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -25,7 +25,7 @@ doctrine: App\Shared\Domain\Contract\ProjectInterface: App\Module\ProjectManagement\Domain\Entity\Project App\Shared\Domain\Contract\TaskInterface: App\Module\ProjectManagement\Domain\Entity\Task App\Shared\Domain\Contract\TaskTagInterface: App\Module\ProjectManagement\Domain\Entity\TaskTag - App\Shared\Domain\Contract\ClientInterface: App\Entity\Client + App\Shared\Domain\Contract\ClientInterface: App\Module\Directory\Domain\Entity\Client mappings: App: type: attribute @@ -53,6 +53,11 @@ doctrine: is_bundle: false dir: '%kernel.project_dir%/src/Module/Absence/Domain/Entity' prefix: 'App\Module\Absence\Domain\Entity' + Directory: + type: attribute + is_bundle: false + dir: '%kernel.project_dir%/src/Module/Directory/Domain/Entity' + prefix: 'App\Module\Directory\Domain\Entity' controller_resolver: auto_mapping: false diff --git a/config/services.yaml b/config/services.yaml index c722b23..cb54a66 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -99,4 +99,6 @@ services: App\Module\Absence\Domain\Repository\AbsenceBalanceRepositoryInterface: '@App\Module\Absence\Infrastructure\Doctrine\DoctrineAbsenceBalanceRepository' + App\Module\Directory\Domain\Repository\ClientRepositoryInterface: '@App\Module\Directory\Infrastructure\Doctrine\DoctrineClientRepository' + App\Shared\Domain\Contract\NotifierInterface: '@App\Module\Core\Infrastructure\Notifier' diff --git a/migrations/Version20260620180000.php b/migrations/Version20260620180000.php new file mode 100644 index 0000000..1304283 --- /dev/null +++ b/migrations/Version20260620180000.php @@ -0,0 +1,53 @@ +addSql('ALTER TABLE client ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE client ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE client ADD created_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE client ADD updated_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE client ADD CONSTRAINT FK_C7440455DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('ALTER TABLE client ADD CONSTRAINT FK_C744045516FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('CREATE INDEX IDX_C7440455DE12AB56 ON client (created_by)'); + $this->addSql('CREATE INDEX IDX_C744045516FE72E1 ON client (updated_by)'); + $this->addSql("COMMENT ON COLUMN client.created_at IS 'Creation timestamp (Timestampable, set on prePersist)'"); + $this->addSql("COMMENT ON COLUMN client.updated_at IS 'Last update timestamp (Timestampable, set on prePersist/preUpdate)'"); + $this->addSql("COMMENT ON COLUMN client.created_by IS 'User who created the entry (Blamable, FK user.id, SET NULL on delete)'"); + $this->addSql("COMMENT ON COLUMN client.updated_by IS 'User who last updated the entry (Blamable, FK user.id, SET NULL on delete)'"); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE client DROP CONSTRAINT FK_C7440455DE12AB56'); + $this->addSql('ALTER TABLE client DROP CONSTRAINT FK_C744045516FE72E1'); + $this->addSql('DROP INDEX IDX_C7440455DE12AB56'); + $this->addSql('DROP INDEX IDX_C744045516FE72E1'); + $this->addSql('ALTER TABLE client DROP created_at'); + $this->addSql('ALTER TABLE client DROP updated_at'); + $this->addSql('ALTER TABLE client DROP created_by'); + $this->addSql('ALTER TABLE client DROP updated_by'); + } +} diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php index 7ad5264..f52805f 100644 --- a/src/DataFixtures/AppFixtures.php +++ b/src/DataFixtures/AppFixtures.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace App\DataFixtures; -use App\Entity\Client; use App\Entity\MailConfiguration; use App\Entity\ZimbraConfiguration; use App\Enum\ContractType; @@ -15,6 +14,7 @@ use App\Module\Absence\Domain\Enum\AbsenceStatus; use App\Module\Absence\Domain\Enum\AbsenceType; use App\Module\Core\Application\Rbac\RbacSeeder; use App\Module\Core\Domain\Entity\User; +use App\Module\Directory\Domain\Entity\Client; use App\Module\ProjectManagement\Domain\Entity\Project; use App\Module\ProjectManagement\Domain\Entity\Task; use App\Module\ProjectManagement\Domain\Entity\TaskEffort; diff --git a/src/Mcp/Tool/Serializer.php b/src/Mcp/Tool/Serializer.php index c4f4dff..5111143 100644 --- a/src/Mcp/Tool/Serializer.php +++ b/src/Mcp/Tool/Serializer.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace App\Mcp\Tool; -use App\Entity\Client; use App\Module\Absence\Domain\Entity\AbsenceBalance; use App\Module\Absence\Domain\Entity\AbsencePolicy; use App\Module\Absence\Domain\Entity\AbsenceRequest; use App\Module\Core\Domain\Entity\User; +use App\Module\Directory\Domain\Entity\Client; use App\Module\ProjectManagement\Domain\Entity\Project; use App\Module\ProjectManagement\Domain\Entity\Task; use App\Module\ProjectManagement\Domain\Entity\TaskDocument; diff --git a/src/Module/Directory/DirectoryModule.php b/src/Module/Directory/DirectoryModule.php new file mode 100644 index 0000000..6ccf2aa --- /dev/null +++ b/src/Module/Directory/DirectoryModule.php @@ -0,0 +1,41 @@ + + */ + public static function permissions(): array + { + return [ + ['code' => 'directory.clients.view', 'label' => 'Voir les clients'], + ['code' => 'directory.clients.manage', 'label' => 'Gérer les clients'], + ]; + } +} diff --git a/src/Entity/Client.php b/src/Module/Directory/Domain/Entity/Client.php similarity index 82% rename from src/Entity/Client.php rename to src/Module/Directory/Domain/Entity/Client.php index 6f3bf8a..eb28ae0 100644 --- a/src/Entity/Client.php +++ b/src/Module/Directory/Domain/Entity/Client.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\Directory\Domain\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Delete; @@ -10,14 +10,19 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Module\ProjectManagement\Domain\Entity\Project; -use App\Repository\ClientRepository; +use App\Module\Directory\Infrastructure\Doctrine\DoctrineClientRepository; +use App\Shared\Domain\Attribute\Auditable; +use App\Shared\Domain\Contract\BlamableInterface; use App\Shared\Domain\Contract\ClientInterface; +use App\Shared\Domain\Contract\ProjectInterface; +use App\Shared\Domain\Contract\TimestampableInterface; +use App\Shared\Domain\Trait\TimestampableBlamableTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; +#[Auditable] #[ApiResource( operations: [ new GetCollection(paginationEnabled: false, security: "is_granted('ROLE_USER')"), @@ -30,9 +35,11 @@ use Symfony\Component\Serializer\Attribute\Groups; denormalizationContext: ['groups' => ['client:write']], order: ['name' => 'ASC'], )] -#[ORM\Entity(repositoryClass: ClientRepository::class)] -class Client implements ClientInterface +#[ORM\Entity(repositoryClass: DoctrineClientRepository::class)] +class Client implements ClientInterface, TimestampableInterface, BlamableInterface { + use TimestampableBlamableTrait; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] @@ -63,8 +70,8 @@ class Client implements ClientInterface #[Groups(['client:read', 'client:write'])] private ?string $postalCode = null; - /** @var Collection */ - #[ORM\OneToMany(targetEntity: Project::class, mappedBy: 'client')] + /** @var Collection */ + #[ORM\OneToMany(targetEntity: ProjectInterface::class, mappedBy: 'client')] private Collection $projects; public function __construct() @@ -149,7 +156,7 @@ class Client implements ClientInterface return $this; } - /** @return Collection */ + /** @return Collection */ public function getProjects(): Collection { return $this->projects; diff --git a/src/Module/Directory/Domain/Repository/ClientRepositoryInterface.php b/src/Module/Directory/Domain/Repository/ClientRepositoryInterface.php new file mode 100644 index 0000000..4562b76 --- /dev/null +++ b/src/Module/Directory/Domain/Repository/ClientRepositoryInterface.php @@ -0,0 +1,20 @@ + $criteria + * @param null|array $orderBy + * + * @return Client[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; +} diff --git a/src/Module/Directory/Infrastructure/Doctrine/DoctrineClientRepository.php b/src/Module/Directory/Infrastructure/Doctrine/DoctrineClientRepository.php new file mode 100644 index 0000000..a5cdf9d --- /dev/null +++ b/src/Module/Directory/Infrastructure/Doctrine/DoctrineClientRepository.php @@ -0,0 +1,26 @@ + + */ +final class DoctrineClientRepository extends ServiceEntityRepository implements ClientRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Client::class); + } + + public function findById(int $id): ?Client + { + return $this->find($id); + } +} diff --git a/src/Mcp/Tool/Reference/CreateClientTool.php b/src/Module/Directory/Infrastructure/Mcp/Tool/CreateClientTool.php similarity index 92% rename from src/Mcp/Tool/Reference/CreateClientTool.php rename to src/Module/Directory/Infrastructure/Mcp/Tool/CreateClientTool.php index 3218610..087d30b 100644 --- a/src/Mcp/Tool/Reference/CreateClientTool.php +++ b/src/Module/Directory/Infrastructure/Mcp/Tool/CreateClientTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Reference; +namespace App\Module\Directory\Infrastructure\Mcp\Tool; -use App\Entity\Client; use App\Mcp\Tool\Serializer; +use App\Module\Directory\Domain\Entity\Client; use Doctrine\ORM\EntityManagerInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; diff --git a/src/Mcp/Tool/Reference/DeleteClientTool.php b/src/Module/Directory/Infrastructure/Mcp/Tool/DeleteClientTool.php similarity index 81% rename from src/Mcp/Tool/Reference/DeleteClientTool.php rename to src/Module/Directory/Infrastructure/Mcp/Tool/DeleteClientTool.php index b3af640..168af47 100644 --- a/src/Mcp/Tool/Reference/DeleteClientTool.php +++ b/src/Module/Directory/Infrastructure/Mcp/Tool/DeleteClientTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Reference; +namespace App\Module\Directory\Infrastructure\Mcp\Tool; -use App\Repository\ClientRepository; +use App\Module\Directory\Domain\Repository\ClientRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class DeleteClientTool { public function __construct( - private readonly ClientRepository $clientRepository, + private readonly ClientRepositoryInterface $clientRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class DeleteClientTool throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } - $client = $this->clientRepository->find($id); + $client = $this->clientRepository->findById($id); if (null === $client) { throw new InvalidArgumentException(sprintf('Client with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/Reference/GetClientTool.php b/src/Module/Directory/Infrastructure/Mcp/Tool/GetClientTool.php similarity index 77% rename from src/Mcp/Tool/Reference/GetClientTool.php rename to src/Module/Directory/Infrastructure/Mcp/Tool/GetClientTool.php index 163070f..de37db3 100644 --- a/src/Mcp/Tool/Reference/GetClientTool.php +++ b/src/Module/Directory/Infrastructure/Mcp/Tool/GetClientTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Reference; +namespace App\Module\Directory\Infrastructure\Mcp\Tool; use App\Mcp\Tool\Serializer; -use App\Repository\ClientRepository; +use App\Module\Directory\Domain\Repository\ClientRepositoryInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; @@ -17,7 +17,7 @@ use function sprintf; class GetClientTool { public function __construct( - private readonly ClientRepository $clientRepository, + private readonly ClientRepositoryInterface $clientRepository, private readonly Security $security, ) {} @@ -27,7 +27,7 @@ class GetClientTool throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } - $client = $this->clientRepository->find($id); + $client = $this->clientRepository->findById($id); if (null === $client) { throw new InvalidArgumentException(sprintf('Client with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/Reference/ListClientsTool.php b/src/Module/Directory/Infrastructure/Mcp/Tool/ListClientsTool.php similarity index 82% rename from src/Mcp/Tool/Reference/ListClientsTool.php rename to src/Module/Directory/Infrastructure/Mcp/Tool/ListClientsTool.php index 29ef197..9eb8218 100644 --- a/src/Mcp/Tool/Reference/ListClientsTool.php +++ b/src/Module/Directory/Infrastructure/Mcp/Tool/ListClientsTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Reference; +namespace App\Module\Directory\Infrastructure\Mcp\Tool; -use App\Repository\ClientRepository; +use App\Module\Directory\Domain\Repository\ClientRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListClientsTool { public function __construct( - private readonly ClientRepository $clientRepository, + private readonly ClientRepositoryInterface $clientRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/Reference/UpdateClientTool.php b/src/Module/Directory/Infrastructure/Mcp/Tool/UpdateClientTool.php similarity index 87% rename from src/Mcp/Tool/Reference/UpdateClientTool.php rename to src/Module/Directory/Infrastructure/Mcp/Tool/UpdateClientTool.php index fc03cb8..f6ff65b 100644 --- a/src/Mcp/Tool/Reference/UpdateClientTool.php +++ b/src/Module/Directory/Infrastructure/Mcp/Tool/UpdateClientTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Reference; +namespace App\Module\Directory\Infrastructure\Mcp\Tool; use App\Mcp\Tool\Serializer; -use App\Repository\ClientRepository; +use App\Module\Directory\Domain\Repository\ClientRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -18,7 +18,7 @@ use function sprintf; class UpdateClientTool { public function __construct( - private readonly ClientRepository $clientRepository, + private readonly ClientRepositoryInterface $clientRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -36,7 +36,7 @@ class UpdateClientTool throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } - $client = $this->clientRepository->find($id); + $client = $this->clientRepository->findById($id); if (null === $client) { throw new InvalidArgumentException(sprintf('Client with ID %d not found.', $id)); } diff --git a/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/CreateProjectTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/CreateProjectTool.php index ff212e6..25c2fae 100644 --- a/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/CreateProjectTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/CreateProjectTool.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Project; use App\Mcp\Tool\Serializer; +use App\Module\Directory\Domain\Repository\ClientRepositoryInterface; use App\Module\ProjectManagement\Domain\Entity\Project; -use App\Repository\ClientRepository; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -20,7 +20,7 @@ class CreateProjectTool { public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly ClientRepository $clientRepository, + private readonly ClientRepositoryInterface $clientRepository, private readonly Security $security, ) {} @@ -46,7 +46,7 @@ class CreateProjectTool $project->setColor($color); } if (null !== $clientId) { - $client = $this->clientRepository->find($clientId); + $client = $this->clientRepository->findById($clientId); if (null === $client) { throw new InvalidArgumentException(sprintf('Client with ID %d not found.', $clientId)); } diff --git a/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/UpdateProjectTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/UpdateProjectTool.php index 4e9275b..d3bb783 100644 --- a/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/UpdateProjectTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/UpdateProjectTool.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Project; use App\Mcp\Tool\Serializer; +use App\Module\Directory\Domain\Repository\ClientRepositoryInterface; use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; -use App\Repository\ClientRepository; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -20,7 +20,7 @@ class UpdateProjectTool { public function __construct( private readonly ProjectRepositoryInterface $projectRepository, - private readonly ClientRepository $clientRepository, + private readonly ClientRepositoryInterface $clientRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -57,7 +57,7 @@ class UpdateProjectTool $project->setColor($color); } if (null !== $clientId) { - $client = $this->clientRepository->find($clientId); + $client = $this->clientRepository->findById($clientId); if (null === $client) { throw new InvalidArgumentException(sprintf('Client with ID %d not found.', $clientId)); } diff --git a/src/Repository/ClientRepository.php b/src/Repository/ClientRepository.php deleted file mode 100644 index 198e9d2..0000000 --- a/src/Repository/ClientRepository.php +++ /dev/null @@ -1,17 +0,0 @@ -