Skip to main content
Version: v0.2b

Route Schema

Model

Route

Route = object

Information about a Route.

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"
}

Properties

PropertyTypeDescription

id

RouteId

The unique identifier of the route.

title

string

The title of the route.

Default

''

stopCount

number

Number of stops in the route.

Default

0

state

RouteState | null

Current state of the route.

Default

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
}

Properties

PropertyTypeDescription

completed

boolean

If route is completed or not.

Default

false

completedAt

EpochTimestamp | null

Timestamp in seconds of when route was completed.

Default

null

distributed

boolean

If route was distributed or not.

Default

false

distributedAt

EpochTimestamp | null

Timestamp in seconds of when route was distributed.

Default

null

notifiedRecipients

boolean

Whether recipients were notified or not.

Default

false

notifiedRecipientsAt

EpochTimestamp | null

Timestamp in seconds of when recipients were notified.

Default

null

started

boolean

If driver started the route or not.

Default

false

startedAt

EpochTimestamp | null

Timestamp in seconds of when route was started by the driver.

Default

null