Resolve "Data archiving" #1687

Open
korina.cordero wants to merge 139 commits from 762-data-archiving into 746-resq-2-0-final
2 changed files with 28 additions and 1 deletions
Showing only changes of commit d603934d93 - Show all commits

View file

@ -89,6 +89,6 @@ class MQTTClient
*/
// NOTE: this is for the new rider app
$this->publish('rider/' . $rider->getID() . '/delivery', json_encode($payload));
$this->publish('rider/' . $rider->getID(), json_encode($payload));
}
}

View file

@ -68,4 +68,31 @@ class MQTTClientApiv2
// error_log('sent to ' . $channel);
}
}
public function sendRiderEvent(JobOrder $job_order, $payload)
{
// check if a rider is available
$rider = $job_order->getRider();
if ($rider == null)
return;
/*
// NOTE: this is for the old rider app
// check if rider has sessions
$sessions = $rider->getSessions();
if (count($sessions) == 0)
return;
// send to every rider session
foreach ($sessions as $sess)
{
$sess_id = $sess->getID();
$channel = self::RIDER_PREFIX . $sess_id;
$this->publish($channel, json_encode($payload));
}
*/
// NOTE: this is for the new rider app
$this->publish('rider/' . $rider->getID() . '/delivery', json_encode($payload));
}
}