Route Schema
Model
Route
Ƭ Route: Object
Information about a Route.
Description
A route differs from a plan in that it is an actual route that a driver will take. While a plan is a set of stops and a set of drivers which may or may not be optimized, a route is a set of stops that a driver will visit in a given order. A route is created by the optimization process, and is not directly editable via the API.
A route is always associated with a plan, and a plan can have multiple routes, each of which can be associated with a driver.
Example
{
"id": "routes/gjaqksJIa26qGPzsgBXT",
"title": "Tue, Nov 22 Route 1",
"stopCount": 28,
"state": {
"completed": false,
"completedAt": null,
"distributed": true,
"distributedAt": 1669153050,
"notifiedRecipients": false,
"notifiedRecipientsAt": null,
"started": false,
"startedAt": null
},
"driver": "drivers/w8ZaNn3e5ZA8EQSABtca",
"plan": "plans/zeOCJaJCzZhpKVCVAC9o"
}
Type declaration
Name | Type | Description |
---|---|---|
id | RouteId | The unique identifier of the route. |
title | string | The title of the route. Default ts '' |
stopCount | number | Number of stops in the route. Default ts 0 |
state | RouteState | null | Current state of the route. Default ts null |
driver | DriverId | null | The route driver. See Driver |
plan | PlanId | null | The plan this route is associated with. See Plan |
Identifier
RouteId
Ƭ RouteId: `routes/${string}`
A route id is a string that is unique for a route. It is used to identify the route in the API.
Example
"routes/0xBYy4MYt4piMCSQEsts"
Fields
RouteState
Ƭ RouteState: Object
The current state of the route when the event was generated.
Example
{
"completed": false,
"completedAt": null,
"distributed": true,
"distributedAt": 1669153050,
"notifiedRecipients": false,
"notifiedRecipientsAt": null,
"started": false,
"startedAt": null
}
Type declaration
Name | Type | Description |
---|---|---|
completed | boolean | If route is completed or not. Default ts false |
completedAt | EpochTimestamp | null | Timestamp in seconds of when route was completed. Default ts null |
distributed | boolean | If route was distributed or not. Default ts false |
distributedAt | EpochTimestamp | null | Timestamp in seconds of when route was distributed. Default ts null |
notifiedRecipients | boolean | Whether recipients were notified or not. Default ts false |
notifiedRecipientsAt | EpochTimestamp | null | Timestamp in seconds of when recipients were notified. Default ts null |
started | boolean | If driver started the route or not. Default ts false |
startedAt | EpochTimestamp | null | Timestamp in seconds of when route was started by the driver. Default ts null |