Add in_transit mqtt event for new app #730
This commit is contained in:
parent
63526d65f2
commit
c32b7d68c7
1 changed files with 9 additions and 1 deletions
|
|
@ -389,7 +389,7 @@ class RiderAppController extends APIController
|
|||
|
||||
}
|
||||
|
||||
public function acceptJobOrder(Request $req, EntityManagerInterface $em)
|
||||
public function acceptJobOrder(Request $req, EntityManagerInterface $em, MQTTClientApiv2 $mclientv2)
|
||||
{
|
||||
$required_params = ['jo_id'];
|
||||
|
||||
|
|
@ -412,6 +412,14 @@ class RiderAppController extends APIController
|
|||
// set jo status to in transit
|
||||
$jo->setStatus(JOStatus::IN_TRANSIT);
|
||||
|
||||
// NOTE: send new in transit event to new app
|
||||
$payload = [
|
||||
'event' => 'in_transit',
|
||||
'jo_id' => $jo->getID(),
|
||||
];
|
||||
|
||||
$mclientv2->sendEvent($jo, $payload);
|
||||
|
||||
// set delivery status
|
||||
$jo->setDeliveryStatus(DeliveryStatus::RIDER_ACCEPT);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue