Start a trial
Color

People list and the leaving check

Find, add and change people and driver profiles, and run the leaving check before someone is made inactive.

For
OwnerFleet managerDispatcher
Hosting
Any hosting
Devices
All devices
Business
FleetTowingTaxi and livery

Checked against Pop Dispatch 0.1.0

People are the staff and drivers your business works with. You will be able to find a person, add one, change their details and make them inactive without losing track of an open shift, an open call or an open advance.

Before you start #

  • You are an owner, a manager or a dispatcher (the fleet-manager group).
  • Fleet writes need the dispatch_fleet license flag. Reads work without it.

Steps #

  1. List people with GET /people. Narrow the list with q (part of a name), driver=1 (drivers only), active=1 or active=0, and page through with limit and cursor.
  2. Add a person with POST /people. Send name, and optionally phone, email, employee_no and notes. For a driver add a driver block with pay_mode (none, hourly, per_call or percent), pay_value, current_asset_id (the usual vehicle) and active.
  3. Read one person with GET /people/<id>.
  4. Change a person with PATCH /people/<id>. Send any field from step 2. current_asset_id: null clears the usual vehicle. Setting driver.on_shift: true needs a usual vehicle.
  5. Before making someone inactive, call GET /people/<id>/leaving-check. The answer says whether the person is ready, lists what blocks the change (on_shift or open_call) and shows any open advance by currency.
  6. Make the person inactive with PATCH /people/<id> and active: false.
  7. Confirm the result. The person and the driver profile show inactive, and the person's sign-in ends.

How the leaving check decides #

  • A shift in progress or an open call stops the change with leaving_check (409). End the shift or finish or reassign the call, then try again. Confirming cannot override this.
  • An open advance balance stops the change until you send confirm_leaving: true. The balance carries over and the audit log records that you confirmed it. Settling the advance first is the cleaner path. See "Driver profiles".
  • Nobody can make their own account inactive. That answers conflict (409).
Technical details
  • pay_value is hundredths of a percent for percent (up to 10000) and minor units of money for the other modes.
  • The person answer holds id, name, phone, email, employee_no, notes, active, created_at, roles, user_id and driver (null, or pay_mode, pay_value, active, on_shift, current_asset_id, shift_started_at).
  • The leaving check answer holds person_id, ready, blocking (each with code and message), open_advances, open_call, on_shift and messages.

If something goes wrong #

  • leaving_check (409): read blocking, deal with each item, then send the change again.
  • conflict (409): you tried to make your own account inactive, or the driver needs a usual vehicle before going on shift.
  • not_found (404): no such person.
  • feature_not_licensed (403) or licence_read_only (403): ask the owner to restore the license.