Skip to main content
The Periodic Rest rule can be used to set a minimum duration of continuous rest that an employee gets in a period. Of all the periods of rest the employee gets, the rule ensures that at least one of them is of the specified minimum duration per period. A good example of this rule is to ensure that employees get at least 48 hours of continuous rest in each week, so that they will always have at least 2 consecutive days off, regardless of which days it is planned on.

Rule schema

periodicRestRule
object
Used to set targets for continuous rest within specific periods.
The following example defines a periodic rest rule that ensures that all employees get at least one 48-hour long continuous rest in each week.
{
  "rules": {
    "periodicRestRules": [
      {
        "id": "48-hours-per-week",
        "importance": "HIGH",
        "targets": {
          "continuousRest": {
            "minHours": 48
          }
        },
        "periods": {
          "recurrentDefinition": {
            "daysPerPeriod": 7
          }
        }
      }
    ]
  }
}
The following example defines a periodic rest rule that ensures that all employees get at least one 72-hour long continuous rest in each month.
{
  "rules": {
    "periodicRestRules": [
      {
        "id": "72-hours-per-month",
        "importance": "HIGH",
        "targets": {
          "continuousRest": {
            "minHours": 72
          }
        },
        "periods": {
          "customDefinitions": [
            {
              "startDay": {
                "date": "2022-01-01"
              },
              "endDay": {
                "date": "2022-01-31"
              }
            },
            {
              "startDay": {
                "date": "2022-02-01"
              },
              "endDay": {
                "date": "2022-02-28"
              }
            }
          ]
        }
      }
    ]
  }
}