Autofleet / locomotion

An open-source rider/passenger mobile app written in React Native and Node.js that can be customized and modified to support any ride-hailing
MIT License
32 stars 13 forks source link

How to update Driver status? #837

Closed uri-jeff closed 4 weeks ago

uri-jeff commented 1 month ago

Hi Team,

After I create a Ride from Passenger, how can I update the status from Driver: accepted/rejected/ completed a ride? I checked the Driver related settings on the control panel but didn’t see it, Can we update this through API? any details regarding this?

Thanks Team,

OmerGery commented 1 month ago

Hey,

  1. Updating driver/ride states is through the fleet manager api ( https://api.autofleet.io/ ) and not ( https://client.staging.eu.autofleet.io/ ). it's out of scope for clients / locomotion to change that
  2. Changing a ride to completed is through arriving/completing stop points , not directly changing the ride state.
6ewis commented 1 month ago

About your point #2, Can you clarify how would you do that? What endpoint would you use to generate fake rides, and drivers status to test ? @OmerGery

michalbanin commented 1 month ago

@6ewis you have a few options here:

  1. You can activate a few drivers that will accept rides in the staging env, and complete rides through the env:

    • create fake drivers through the fleet section > drivers tab
    • set them with the "Uride vendor" (which is an auto accept vendor)
    • create a few fake vehicles through the fleet section > vehicles tab
    • in the main dashboard, switch to the vehicles tab > click on a vehicle > switch to the "driver" tab > click on "assign driver" and select one of the drivers
    • after you create a ride, it should go to one of the drivers automatically. if it doesn't (drivers are located to far for example) you can force the ride to one of the drivers.
    • after a ride is assigned to a driver you can manually complete or cancel the ride through the dashboard.
  2. Through API

    • create rides through the clients API so it will mimic locomotion/ through locomotion
    • ride and driver states will be handled through the Autofleet APIs - instructions are detailed in the docs
uri-jeff commented 1 month ago

I was able to update the status of the driver through updating Stop points, thanks for clarifying

One more question regarding ride tracking: Is there a way to simulate the driver's location so I can see the driver moving to the pickup and drop-off points? and through which API can I get the driver's location - in real time?

Thanks @michalbanin

uri-jeff commented 1 month ago

@michalbanin @OmerGery Can you please take a look? Also, can I update the status of stop points to "arrived"? Currently I can only update -> "completed" through admin panel

michalbanin commented 1 month ago

Unfortunately there is no way to simulate a driver's real time location in the staging env. In your testing env (production) we can activate fake drivers that will move around and simulate drivers completing rides. When completing rides through the Control Center, you can only complete and not mark arrived.

6ewis commented 1 month ago

@michalbanin basically we have to go back to use the production environment to test

michalbanin commented 1 month ago

Only if you want to simulate real time location Another option is to connect as drivers to the staging env and complete trips through the driver app (and move around with the app). How to do this:

  1. Register yourself as a driver in the staging env (fleet section > drivers tab)
  2. Download the uride driver app
  3. Access this link, it will open the driver app
  4. Log in using the phone number you registered
  5. Create trips and complete them through the driver app
michalbanin commented 4 weeks ago

@uri-jeff just wanted to update- you can update a stop point to "arrived" via API - post: https://control.autofleet.io/api/v1/vehicles/xxxxxx/stop-points/yyyyyy/arrived xxxxxx= vehicleId yyyyyy= stopPointId