src/Controller/Fiche/SuiviPartenariatController.php line 646

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Fiche;
  3. use App\Entity\Formation;
  4. use App\Helper\ConstApp;
  5. use App\Helper\Helper;
  6. use App\Repository\StatutFicheRepository;
  7. use App\Repository\UserRepository;
  8. use App\Service\Fiche\SuiviPartenariaService;
  9. use App\Service\FicheService;
  10. use Doctrine\ORM\EntityManagerInterface;
  11. use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
  12. use Symfony\Component\HttpFoundation\Request;
  13. use Symfony\Component\HttpFoundation\Response;
  14. use Symfony\Component\Routing\Annotation\Route;
  15. use App\Entity\Fiche\SuiviPartenariat\Partenariat;
  16. use Symfony\Component\HttpFoundation\JsonResponse;
  17. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  18. use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
  19. /**
  20.  * @Route("/suivi/partenariat")
  21.  */
  22. class SuiviPartenariatController extends AbstractController
  23. {
  24.     private SuiviPartenariaService $suiviPartenariaService;
  25.     private FicheService $ficheService;
  26.     private ParameterBagInterface $params;
  27.     private UserRepository $userRepo;
  28.     private Helper $helper;
  29.     private EntityManagerInterface $em;
  30.     private ConstApp $constApp;
  31.     public function __construct(
  32.         SuiviPartenariaService $suiviPartenariaService,
  33.         FicheService $ficheService,
  34.         ParameterBagInterface $params,
  35.         UserRepository $userRepo,
  36.         Helper $helper,
  37.         EntityManagerInterface $em,
  38.         ConstApp $constApp
  39.     )
  40.     {
  41.         $this->suiviPartenariaService $suiviPartenariaService;
  42.         $this->ficheService $ficheService;
  43.         $this->params $params;
  44.         $this->userRepo $userRepo;
  45.         $this->helper $helper;
  46.         $this->em $em;
  47.         $this->constApp $constApp;
  48.     }
  49.     /**
  50.      * @Route("/", name="app_suivi_partenariat_index")
  51.      */
  52.     public function index(): Response
  53.     {
  54.         return $this->render('fiche/suivi_partenariat/index.html.twig', []);
  55.     }
  56.     /**
  57.      * @Route("/api/suivi-partenariat-list", name="app_suivi_partenariat_list")
  58.      */
  59.     public function getAllSuiviPartenariat(Request $request): JsonResponse {
  60.         $currentUser $this->getUser();
  61.         $user $this->userRepo->find($currentUser);
  62.         $profilUser $user->getProfil()->getId();
  63.         $profilName $user->getProfil()->getName();
  64.         $column $request->query->get("column") ?? "";
  65.         $value $request->query->get("value") ?? "";
  66.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  67.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  68.         $offset = ($limit $page) - $limit;
  69.         $totalRows = [];
  70.         $ceps = [];
  71.         //-------Beginning of filter data by Locality level-------------
  72.         $userLevelLocality $user->getProfil()->getNiveauLocalite();
  73.         $userLocality = [];
  74.         $localityMethods $this->constApp->localityMethods();
  75.         if (isset($localityMethods[$userLevelLocality])) {
  76.             $method $localityMethods[$userLevelLocality];
  77.             foreach ($user->$method() as $locality) {
  78.                 $userLocality[] = $locality->getId();
  79.             }
  80.         }
  81.         //-------End of filter data by Locality level-------------
  82.         //Récuperation des données à afficher si l'utilisateur connecté est admin
  83.         if ($user->getProfil()->getNiveauLocalite() == "nat_") {
  84.             $ceps $this->suiviPartenariaService->getAllSuiviPartenariat(
  85.                 $column,
  86.                 $value,
  87.                 $limit,
  88.                 $offset,
  89.                 null,
  90.                 null,
  91.                 null
  92.             );
  93.             $totalRows $this->suiviPartenariaService->getAllSuiviPartenariat(
  94.                 $column,
  95.                 $value,
  96.                 null,
  97.                 null,
  98.                 null,
  99.                 null,
  100.                 null
  101.             );
  102.         } else {
  103.             $ceps $this->suiviPartenariaService->getAllSuiviPartenariat(
  104.                 $column$value$limit$offset,
  105.                 $userLocality,
  106.                 $userLevelLocality,
  107.                 $profilName == 'CGEAF' $user->getId() : null
  108.             );
  109.             $totalRows $this->suiviPartenariaService->getAllSuiviPartenariat(
  110.                 $column$valuenullnull,
  111.                 $userLocality,
  112.                 $userLevelLocality,
  113.                 $profilName == 'CGEAF' $user->getId() : null
  114.             );
  115.         }
  116.         return new JsonResponse(
  117.             [
  118.                 'title' => 'Récuperation liste suivis partenariats',
  119.                 'message' => 'Récuperation avec succès',
  120.                 'status' => 'success',
  121.                 'data' => [
  122.                     'rows' => $ceps,
  123.                     'dataInfo' => [
  124.                         'totalRows' => count($totalRows),
  125.                         'limit' => $limit,
  126.                         'page' => $page,
  127.                     ]
  128.                 ]
  129.             ],
  130.             200,
  131.             ['Content-Type' => 'application/json']
  132.         );
  133.     }
  134.     /**
  135.      * @Route("/{id}/show", name="app_suivi_partenariat_show", methods={"GET", "POST"})
  136.      */
  137.     public function show(Partenariat $partenariat): Response
  138.     {
  139.         $fokontanyOP $partenariat->getOrganisationPaysanne()->getFokontany();
  140.         $poleOP $partenariat->getOrganisationPaysanne()->getPole();
  141.         $fokontanyOM $partenariat->getOperateurMarche()->getFokontany();
  142.         $htmlViewFormFiche $this->renderView('fiche/suivi_partenariat/show.html.twig', [
  143.             'partenariat' => $partenariat,
  144.             'fokontany' => $fokontanyOP,
  145.             'fokontanyOM' => $fokontanyOM,
  146.             'pole' => $poleOP
  147.         ]);
  148.         return new JsonResponse(
  149.             [
  150.                 'title' => 'Affichage suivi partenariat',
  151.                 'message' => 'Affichage suivi partenariat avec succès',
  152.                 'status' => 'success',
  153.                 'htmlViewFormFiche' => $htmlViewFormFiche,
  154.             ],
  155.             200,
  156.             ['Content-Type' => 'application/json']
  157.         );
  158.     }
  159.     /**
  160.      * @Route("/api/formation_partenariat/{id}", name="app_suivi_partenariat_formation", methods="GET")
  161.      */
  162.     public function getListFormationPartenariat(Partenariat $partenariatRequest $request): JsonResponse
  163.     {
  164.         $column $request->query->get("column") ?? "";
  165.         $value $request->query->get("value") ?? "";
  166.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  167.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  168.         $offset = ($limit $page) - $limit;
  169.         $data $this->helper->getAllFormation(
  170.             'partenariat_formation',
  171.             $partenariat->getId(),
  172.             'partenariat_id',
  173.             $this->em,
  174.             $column,
  175.             $value,
  176.             $limit,
  177.             $offset
  178.         );
  179.         $totalRows $this->helper->getAllFormation(
  180.             'partenariat_formation',
  181.             $partenariat->getId(),
  182.             'partenariat_id',
  183.             $this->em,
  184.             $column,
  185.             $value,
  186.             null,
  187.             null
  188.         );
  189.         return new JsonResponse(
  190.             [
  191.                 'title' => 'Récuperation liste formation',
  192.                 'message' => 'Récuperation avec succès',
  193.                 'status' => 'success',
  194.                 'data' => [
  195.                     'rows' => $data,
  196.                     'dataInfo' => [
  197.                         'totalRows' => count($totalRows),
  198.                         'limit' => $limit,
  199.                         'page' => $page,
  200.                     ]
  201.                 ]
  202.             ],
  203.             200,
  204.             ['Content-Type' => 'application/json']
  205.         );
  206.     }
  207.     /**
  208.      * @Route("/api/formation_partenariat/{formationId}/beneficiaire", name="app_suivi_partenariat_formation_participant", methods="GET")
  209.      */
  210.     public function getListParticipantFormationPartenariat(Formation $formationIdRequest $request): JsonResponse
  211.     {
  212.         $column $request->query->get("column") ?? "";
  213.         $value $request->query->get("value") ?? "";
  214.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  215.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  216.         $offset = ($limit $page) - $limit;
  217.         $data $this->helper->getAllBeneficiaryFormation(
  218.             $formationId,
  219.             $this->em,
  220.             $column,
  221.             $value,
  222.             $limit,
  223.             $offset
  224.         );
  225.         $totalRows $this->helper->getAllBeneficiaryFormation(
  226.             $formationId,
  227.             $this->em,
  228.             $column,
  229.             $value,
  230.             null,
  231.             null
  232.         );
  233.         return new JsonResponse(
  234.             [
  235.                 'title' => 'Récuperation liste des bénéficiaires formation',
  236.                 'message' => 'Récuperation avec succès',
  237.                 'status' => 'success',
  238.                 'data' => [
  239.                     'rows' => $data,
  240.                     'dataInfo' => [
  241.                         'totalRows' => count($totalRows),
  242.                         'limit' => $limit,
  243.                         'page' => $page,
  244.                     ]
  245.                 ]
  246.             ],
  247.             200,
  248.             ['Content-Type' => 'application/json']
  249.         );
  250.     }
  251.     /**
  252.      * @Route("/api/visite-echange/partenariat/{id}", name="app_suivi_partenariat_visite-echange", methods="GET")
  253.      */
  254.     public function getListVisiteEchangePartenariat(Partenariat $partenariatRequest $request): JsonResponse
  255.     {
  256.         $column $request->query->get("column") ?? "";
  257.         $value $request->query->get("value") ?? "";
  258.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  259.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  260.         $offset = ($limit $page) - $limit;
  261.         $formations $this->suiviPartenariaService->getListVisteEchangePartenariat(
  262.             $partenariat,
  263.             $column,
  264.             $value,
  265.             $limit,
  266.             $offset
  267.         );
  268.         $totalRows $this->suiviPartenariaService->getListVisteEchangePartenariat(
  269.             $partenariat,
  270.             $column,
  271.             $value,
  272.             null,
  273.             null
  274.         );
  275.         return new JsonResponse(
  276.             [
  277.                 'title' => 'Récuperation liste formation',
  278.                 'message' => 'Récuperation avec succès',
  279.                 'status' => 'success',
  280.                 'data' => [
  281.                     'rows' => $formations,
  282.                     'dataInfo' => [
  283.                         'totalRows' => count($totalRows),
  284.                         'limit' => $limit,
  285.                         'page' => $page,
  286.                     ]
  287.                 ]
  288.             ],
  289.             200,
  290.             ['Content-Type' => 'application/json']
  291.         );
  292.     }
  293.     /**
  294.      * @Route("/api/participant/visite-echange/partenariat/{id}", name="app_suivi_partenariat_visite-echange_participant", methods="GET")
  295.      */
  296.     public function getListParticipantVisiteEchangePartenariat(Partenariat $partenariatRequest $request): JsonResponse
  297.     {
  298.         $column $request->query->get("column") ?? "";
  299.         $value $request->query->get("value") ?? "";
  300.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  301.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  302.         $offset = ($limit $page) - $limit;
  303.         $formations $this->suiviPartenariaService->getListEafVisiteEchangePartenariatService(
  304.             $partenariat,
  305.             $column,
  306.             $value,
  307.             $limit,
  308.             $offset
  309.         );
  310.         $totalRows $this->suiviPartenariaService->getListEafVisiteEchangePartenariatService(
  311.             $partenariat,
  312.             $column,
  313.             $value,
  314.             null,
  315.             null
  316.         );
  317.         return new JsonResponse(
  318.             [
  319.                 'title' => 'Récuperation liste formation',
  320.                 'message' => 'Récuperation avec succès',
  321.                 'status' => 'success',
  322.                 'data' => [
  323.                     'rows' => $formations,
  324.                     'dataInfo' => [
  325.                         'totalRows' => count($totalRows),
  326.                         'limit' => $limit,
  327.                         'page' => $page,
  328.                     ]
  329.                 ]
  330.             ],
  331.             200,
  332.             ['Content-Type' => 'application/json']
  333.         );
  334.     }
  335.     /**
  336.      * @Route("/api/autres/partenariat/{id}", name="app_suivi_partenariat_autres", methods="GET")
  337.      */
  338.     public function getListAutresPartenariat(Partenariat $partenariatRequest $request): JsonResponse
  339.     {
  340.         $column $request->query->get("column") ?? "";
  341.         $value $request->query->get("value") ?? "";
  342.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  343.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  344.         $offset = ($limit $page) - $limit;
  345.         $autres $this->suiviPartenariaService->getListAutrePartenariat(
  346.             $partenariat,
  347.             $column,
  348.             $value,
  349.             $limit,
  350.             $offset
  351.         );
  352.         $totalRows $this->suiviPartenariaService->getListAutrePartenariat(
  353.             $partenariat,
  354.             $column,
  355.             $value,
  356.             null,
  357.             null
  358.         );
  359.         return new JsonResponse(
  360.             [
  361.                 'title' => 'Récuperation liste formation',
  362.                 'message' => 'Récuperation avec succès',
  363.                 'status' => 'success',
  364.                 'data' => [
  365.                     'rows' => $autres,
  366.                     'dataInfo' => [
  367.                         'totalRows' => count($totalRows),
  368.                         'limit' => $limit,
  369.                         'page' => $page,
  370.                     ]
  371.                 ]
  372.             ],
  373.             200,
  374.             ['Content-Type' => 'application/json']
  375.         );
  376.     }
  377.     /**
  378.      * @Route("/api/participant/autres/partenariat/{id}", name="app_suivi_partenariat_autres_participant", methods="GET")
  379.      */
  380.     public function getListParticipantAutresPartenariat(Partenariat $partenariatRequest $request): JsonResponse
  381.     {
  382.         $column $request->query->get("column") ?? "";
  383.         $value $request->query->get("value") ?? "";
  384.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  385.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  386.         $offset = ($limit $page) - $limit;
  387.         $autreParticipant $this->suiviPartenariaService->getListEafAutreService(
  388.             $partenariat,
  389.             $column,
  390.             $value,
  391.             $limit,
  392.             $offset
  393.         );
  394.         $totalRows $this->suiviPartenariaService->getListEafAutreService(
  395.             $partenariat,
  396.             $column,
  397.             $value,
  398.             null,
  399.             null
  400.         );
  401.         return new JsonResponse(
  402.             [
  403.                 'title' => 'Récuperation liste formation',
  404.                 'message' => 'Récuperation avec succès',
  405.                 'status' => 'success',
  406.                 'data' => [
  407.                     'rows' => $autreParticipant,
  408.                     'dataInfo' => [
  409.                         'totalRows' => count($totalRows),
  410.                         'limit' => $limit,
  411.                         'page' => $page,
  412.                     ]
  413.                 ]
  414.             ],
  415.             200,
  416.             ['Content-Type' => 'application/json']
  417.         );
  418.     }
  419.     /**
  420.      * @Route("/api/resultat-obtenu/partenariat/{id}", name="app_suivi_partenariat_resultat_participant", methods="GET")
  421.      */
  422.     public function getResultatObtenuPartenariat(Partenariat $partenariatRequest $request): JsonResponse
  423.     {
  424.         $column $request->query->get("column") ?? "";
  425.         $value $request->query->get("value") ?? "";
  426.         $limit $request->query->get("limit") ? intval($request->query->get("limit")) : 0;
  427.         $page $request->query->get("page") ? intval($request->query->get("page")) : 0;
  428.         $offset = ($limit $page) - $limit;
  429.         $autreParticipant $this->suiviPartenariaService->getResultatObtenuService(
  430.             $partenariat,
  431.             $column,
  432.             $value,
  433.             $limit,
  434.             $offset
  435.         );
  436.         $totalRows $this->suiviPartenariaService->getResultatObtenuService(
  437.             $partenariat,
  438.             $column,
  439.             $value,
  440.             null,
  441.             null
  442.         );
  443.         return new JsonResponse(
  444.             [
  445.                 'title' => 'Récuperation liste formation',
  446.                 'message' => 'Récuperation avec succès',
  447.                 'status' => 'success',
  448.                 'data' => [
  449.                     'rows' => $autreParticipant,
  450.                     'dataInfo' => [
  451.                         'totalRows' => count($totalRows),
  452.                         'limit' => $limit,
  453.                         'page' => $page,
  454.                     ]
  455.                 ]
  456.             ],
  457.             200,
  458.             ['Content-Type' => 'application/json']
  459.         );
  460.     }
  461.     /**
  462.      * @Route("/{id}/api/pieces", name="app_suivi_partenariat_pieces_joint", methods={"GET", "POST"})
  463.      */
  464.     public function getPiecesJointCep(Partenariat $partenariatRequest $request): JsonResponse
  465.     {
  466.         $result = [
  467.             'data' => [],
  468.             'alt' => '',
  469.             'baseUrl' => $_SERVER['API_PHOTO']
  470.         ];
  471.         if (count($partenariat->getPartenariatPhotos()) > 0) {
  472.             foreach ($partenariat->getPartenariatPhotos() as $partenariatPhoto) {
  473.                 if ($partenariatPhoto->getType() == intval($request->get('type'))) {
  474.                     $dico = [
  475.                         "type" => $partenariatPhoto->getType(),
  476.                         "uuid" => $partenariatPhoto->getPhoto()->getUuid(),
  477.                         "path" => $partenariatPhoto->getPhoto()->getPath(),
  478.                         "filename" => $partenariatPhoto->getPhoto()->getFilename()
  479.                     ];
  480.                     $result['data'][] = $dico;
  481.                 }
  482.             }
  483.         } else {
  484.             $result['data'] = [];
  485.             $result['alt'] = $request->getSchemeAndHttpHost() . '/images/image.png';
  486.         }
  487.         if (count($result['data']) == 0) {
  488.             $result['alt'] = $request->getSchemeAndHttpHost() . '/images/image.png';
  489.         }
  490.         return new JsonResponse(
  491.             [
  492.                 'title' => 'Affichage Cep Manico',
  493.                 'message' => 'Affichage Cep Manico avec succès',
  494.                 'status' => 'success',
  495.                 'data' => $result
  496.             ],
  497.             200,
  498.             ['Content-Type' => 'application/json']
  499.         );
  500.     }
  501.     /**
  502.      * @Route("/{id}/{id_statut}/{niveau}/valide", name="app_suivi_partenariat_valide", methods={"GET","POST"})
  503.      */
  504.     public function valid(
  505.         StatutFicheRepository $statutFicheRepository,
  506.         Partenariat $partenariat,
  507.         Request $request
  508.     ): Response
  509.     {
  510.         $statutFiche $statutFicheRepository->find($request->attributes->get('id_statut'));
  511.         $niveau $request->attributes->get('niveau');
  512.         $user $this->getUser();
  513.         $message " ";
  514.         $status " ";
  515.         try {
  516.             //Mise à jour statut de la fiche s'il n'y pas d'erreur et appel au fonction valide dans ficheService
  517.             $this->ficheService->valide($partenariat$statutFiche$user$niveau);
  518.             $message "Validation de la fiche partenariat avec succès";
  519.             $status "success";
  520.         } catch (\Throwable $th) {
  521.             $message "Validation de la fiche partenariat avec erreur";
  522.             $status "error";
  523.         }
  524.         return new JsonResponse(
  525.             [
  526.                 'title' => 'Validation de la fiche cep',
  527.                 'message' => $message,
  528.                 'status' => $status,
  529.             ],
  530.             200,
  531.             ['Content-Type' => 'application/json']
  532.         );
  533.     }
  534.     /**
  535.      * @Route("/{id}/{id_statut}/{niveau}/rejete", name="app_suivi_partenariat_rejete", methods={"POST"})
  536.      */
  537.     public function rejete(
  538.         Request $request,
  539.         StatutFicheRepository $statutFicheRepository,
  540.         Partenariat $partenariat
  541.     ): Response
  542.     {
  543.         $user $this->getUser();
  544.         $statutFiche $statutFicheRepository->find($request->attributes->get('id_statut'));
  545.         $niveau =$request->attributes->get('niveau');
  546.         $observation $request->request->get("observation");
  547.         $validations $partenariat->getValidation();
  548.         $recentValidateur null;
  549.         //recuperation du validateur recent de la fiche --> niveau inferieur de l'user connecté
  550.         for ($i=count($validations); $i 0$i--) {
  551.             $niveauValidation $validations[$i-1]->getNiveau();
  552.             $statutValidation $validations[$i-1]->getStatut();
  553.             if ($niveauValidation == $niveau -&& $statutValidation == $this->params->get("statut_valide")) {
  554.                 $recentValidateur $validations[$i-1]->getValidateur();
  555.                 break;
  556.             }
  557.         }
  558.         //recuperation remplisseur initiale si la fiche est refusE au niveau cir (validation niveau 3)
  559.         if ($recentValidateur == null) {
  560.             $recentValidateur $partenariat->getRemplisseur();
  561.         }
  562.         if (isset($recentValidateur)) {
  563.             //MAJ statut de la fiche
  564.             try {
  565.                 $this->ficheService->rejete($partenariat$statutFiche$user$observation$niveau);
  566.                 $message "Refus de la fiche partinariat  avec succès";
  567.                 $status "success";
  568.             } catch (TransportExceptionInterface $e) {
  569.                 $message "Refus de la fiche partenariat avec erreur";
  570.                 $status "error";
  571.             }
  572.         }else {
  573.             $message "Validateur invalide";
  574.             $status "error";
  575.         }
  576.         return new JsonResponse(
  577.             [
  578.                 'title' => 'Refus de la fiche cep',
  579.                 'message' => $message,
  580.                 'status' => $status,
  581.             ],
  582.             200,
  583.             ['Content-Type' => 'application/json']
  584.         );
  585.     }
  586.     /**
  587.      * @Route("/api/get_montant_total_partenariat", name="app_suivi_partenariat_get_montant_total_partenariat")
  588.      */
  589.     public function getNbrTransformation(Request $request): JsonResponse
  590.     {
  591.         $year = (int) $request->query->get("year") ?? null;
  592.         $cirId = (int) $request->query->get("cir") ?? null;
  593.         $poles $this->helper->getPolesCoordinationZone($cirId);
  594.         return new JsonResponse(
  595.             [
  596.                 'title' => 'Récuperation partenariat data',
  597.                 'message' => 'Récuperation avec succès',
  598.                 'status' => 'success',
  599.                 'data' => ['montant_total' => $this->suiviPartenariaService->getMontantPartenariatService($poles$year)],
  600.             ],
  601.             200,
  602.             ['Content-Type' => 'application/json']
  603.         );
  604.     }
  605.     /**
  606.      * @Route("/api/get_nbr_type_contrat_partenariat", name="app_suivi_partenariat_get_nbr_type_contrat_partenariat")
  607.      */
  608.     public function getNbrContratPartenariat(Request $request): JsonResponse
  609.     {
  610.         $year = (int) $request->query->get("year") ?? null;
  611.         $cirId = (int) $request->query->get("cir") ?? null;
  612.         $poles $this->helper->getPolesCoordinationZone($cirId);
  613.         $typePartenariat $this->params->get('type_partenariat_contrat');
  614.         return new JsonResponse(
  615.             [
  616.                 'title' => 'Récuperation partenariat data',
  617.                 'message' => 'Récuperation avec succès',
  618.                 'status' => 'success',
  619.                 'data' => ['total' => $this->suiviPartenariaService->getNbrPartenariatTypeContractService($poles$year$typePartenariat)],
  620.             ],
  621.             200,
  622.             ['Content-Type' => 'application/json']
  623.         );
  624.     }
  625. }