Skip to main content
Version: v0.2b

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

NameTypeDescription
idRouteIdThe unique identifier of the route.
titlestringThe title of the route. Default ts ''
stopCountnumberNumber of stops in the route. Default ts 0
stateRouteState | nullCurrent state of the route. Default ts null
driverDriverId | nullThe route driver. See Driver
planPlanId | nullThe 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

NameTypeDescription
completedbooleanIf route is completed or not. Default ts false
completedAtEpochTimestamp | nullTimestamp in seconds of when route was completed. Default ts null
distributedbooleanIf route was distributed or not. Default ts false
distributedAtEpochTimestamp | nullTimestamp in seconds of when route was distributed. Default ts null
notifiedRecipientsbooleanWhether recipients were notified or not. Default ts false
notifiedRecipientsAtEpochTimestamp | nullTimestamp in seconds of when recipients were notified. Default ts null
startedbooleanIf driver started the route or not. Default ts false
startedAtEpochTimestamp | nullTimestamp in seconds of when route was started by the driver. Default ts null