Clear rider when JO has been rejected. Send event for rider availability when rider rejects JO. #437
This commit is contained in:
parent
95a070051e
commit
d01aa82e31
1 changed files with 8 additions and 1 deletions
|
|
@ -976,7 +976,8 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
|||
|
||||
$jo->requeue();
|
||||
|
||||
// TODO: do we leave JO as assigned to rider?
|
||||
// set rider to null
|
||||
$jo->clearRider();
|
||||
|
||||
// add event log
|
||||
$rider = $this->session->getRider();
|
||||
|
|
@ -997,6 +998,12 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
|||
];
|
||||
$this->mclient->sendEvent($jo, $payload);
|
||||
|
||||
// send available event to change rider icon status
|
||||
$channel = 'rider/' . $rider->getID() . '/status';
|
||||
$rider_status = 'available';
|
||||
|
||||
$this->mclient->publish($channel, $rider_status);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue