Jelajahi Sumber

Merge branch 'base#14' into 'master'

Ref base#14 - Modified method to execute transitions on ONUs by ONU ID

See merge request interlink-sa/flowdat3/modules/ftth!149
Guillermo Espinoza 5 tahun lalu
induk
melakukan
b9663882ab
1 mengubah file dengan 6 tambahan dan 5 penghapusan
  1. 6 5
      src/FTTHBundle/Controller/REST/ONURESTController.php

+ 6 - 5
src/FTTHBundle/Controller/REST/ONURESTController.php

@@ -127,6 +127,8 @@ class ONURESTController extends RESTController
      * @Get("/client/{id}/apply/{transition}")
      * @View(statusCode=201, serializerEnableMaxDepthChecks=true)
      *
+     * https://ftth.client.flowdat.net/api/client/2/apply/active_disable
+     * 
      * @param Request $request
      * @param $id
      * @param $transition
@@ -135,6 +137,7 @@ class ONURESTController extends RESTController
      */
     public function clientAction(Request $request, Int $id, String $transition)
     {
+
         try {
             $tenancyService = $this->getTenancyService();
             $tenancyService->disableFilter();
@@ -143,11 +146,9 @@ class ONURESTController extends RESTController
 
             $query = $em->createQuery("
                 SELECT o FROM FTTHBundle:ONU o
-                WHERE o.administrativeState != :transition
-                AND o.clientId = :client
+                WHERE o.clientId = :client
             ")->setParameters([
-                'transition' => $transition,
-                'client' => $id,
+                'client' => $id
             ]);
             $onus = $query->getResult();
 
@@ -155,7 +156,7 @@ class ONURESTController extends RESTController
             
             $cmd_args = [
                 'entity' => '--entity:FTTHBundle\\Entity\\ONU',
-                'workflow' => '--workflow:administrative_state',
+                'workflow' => '--workflow:onu_workflow',
                 'transition' => "--transition:{$transition}",
             ];