src/Controller/Agent/Agent/FetchAgentController.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Agent\Agent;
  3. use App\Repository\AgentRepository;
  4. use Symfony\Component\HttpFoundation\JsonResponse;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class FetchAgentController
  7. {
  8.     private AgentRepository $repo;
  9.     public function __construct(AgentRepository $repo)
  10.     {
  11.         $this->repo $repo;
  12.     }
  13.     /**
  14.      * @Route("/api/internal/best/agent", name="getBestAgentByMandate")
  15.      */
  16.     public function getBestAgentByMandate(): JsonResponse
  17.     {
  18.         return new JsonResponse($this->repo->getTopAgentByMandate(), 200);
  19.     }
  20. }