How do breaks work with Work shifts?

Hello,

I have defined work shifts for the 5 days of the week, using the number of seconds as such, each day from 8am to 6pm :

    Monday shift : start 28800 end 64800
    Tuesday shift : start 115200 end 151200
    Wednesday shift : start 201600 end 237600
    Thursday shift : start 288000 end 324000
    Friday shift : start 374400 end 410400

Which in JSON renders to the following :

			"shifts": [
			{
				"shift_id": "Monday",
				"start_address": {
					...
				},
				"earliest_start": 28800,
				"latest_end": 64800
			},
			{
				"shift_id": "Tuesday",
				"start_address": {
					...
				},
				"earliest_start": 115200,
				"latest_end": 151200
			},
			{
				"shift_id": "Wednesday",
				"start_address": {
					...
				},
				"earliest_start": 201600,
				"latest_end": 237600
			},
			{
				"shift_id": "Thursday",
				"start_address": {
					...
				},
				"earliest_start": 288000,
				"latest_end": 324000
			},
			{
				"shift_id": "Friday",
				"start_address": {
					...
				},
				"earliest_start": 374400,
				"latest_end": 410400
			}
		],

I need to implement a lunch break, which is 1h long, from 12am to 2pm.

In the documentation, one can read the following for the property “break” of “vehicle” :

earliest - required integer <int64> - Specifies the earliest start time of the break in seconds.
latest - required integer <int64> - Specifies the latest start time of break in seconds.
duration - required integer <int64> - Specifies the duration of the break in seconds.

Do I need to specify each break, one per day ?
Does it work with same notation as shifts (seconds from start of week ?
Could someone kindly provide a sample json ?

Thank you for your amazing API :slight_smile:

That is music to our ears. Thank you so much.

Defining them in shifts is indeed not yet possible. However, you can define each break in “services” as service without location but with time window and duration. Here is an example: berlin-shifts-break.json · GitHub

FYI: We will likely add the current break specification to shifts also.

Hi Stefan, has there been any progress on adding the break spec to the shifts? Re. specifying breaks as services without locations: can you be sure that the break service will be included in the solution? I noticed in your example that there are no priorities specified; does the allowed_vehicles effectively force it to be included in the solution?

It is now possible to add breaks to shifts.

1 Like