> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solvice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rest Requirements

> Enforce minimum rest periods between shifts and throughout the schedule

Rest constraints ensure employees have adequate recovery time between shifts, comply with labor regulations, and maintain work-life balance.

## Rest Types

| Type                 | Description                                   |
| -------------------- | --------------------------------------------- |
| **Between shifts**   | Minimum idle time after a specific shift ends |
| **Weekly rest**      | Minimum total rest during a defined period    |
| **Consecutive rest** | Minimum uninterrupted rest period             |

## Rest After Shift

Require minimum rest time after specific shift types. Triggered when a shift ends:

```json theme={null}
{
  "rests": [
    {
      "tags": ["NIGHT"],
      "sequence": "AFTER",
      "min": "PT15H"
    }
  ]
}
```

<Info>
  After any shift tagged `NIGHT`, the employee must have at least 15 hours before their next shift.
</Info>

### Multiple Rest Tolerances

Define tiered rest requirements:

```json theme={null}
{
  "rests": [
    {
      "tags": ["NIGHT"],
      "min": "PT15H",
      "frequency": 1
    },
    {
      "tags": ["NIGHT"],
      "min": "PT22H",
      "frequency": 1
    }
  ]
}
```

## Weekly Rest

Ensure minimum total rest hours within a defined period:

```json theme={null}
{
  "rests": [
    {
      "period": {
        "from": "2024-01-01T00:00:00",
        "to": "2024-01-08T00:00:00"
      },
      "min": "PT35H"
    }
  ]
}
```

<Check>
  Employees get at least 35 hours of rest during the week of January 1-7.
</Check>

### Exclude Non-Work Shifts

Exclude certain shift types from rest calculations:

```json theme={null}
{
  "rests": [
    {
      "excludes": ["TRAINING", "MEETING"],
      "period": {
        "from": "2024-01-01T00:00:00",
        "to": "2024-01-08T00:00:00"
      },
      "min": "PT35H"
    }
  ]
}
```

### Weekend Rest Window

Define a specific weekend rest window (e.g., Saturday night to Monday morning):

```json theme={null}
{
  "rests": [
    {
      "period": {
        "from": "2024-01-06T20:00:00",
        "to": "2024-01-08T08:00:00"
      },
      "min": "PT35H"
    }
  ]
}
```

## Consecutive Rest

Require a minimum uninterrupted rest period:

```json theme={null}
{
  "rests": [
    {
      "periodType": "WEEKLY",
      "tags": ["ALL"],
      "min": "PT20H",
      "minConsecutive": "PT10H",
      "frequency": 3,
      "sequence": "AFTER"
    }
  ]
}
```

<ParamField body="min" type="string (ISO 8601 duration)">
  Total minimum rest required (can be split)
</ParamField>

<ParamField body="minConsecutive" type="string (ISO 8601 duration)">
  Minimum uninterrupted rest block required
</ParamField>

<ParamField body="frequency" type="integer">
  Maximum number of rest occurrences to enforce
</ParamField>

## Rest Properties

<ParamField body="tags" type="array">
  Shift tags that trigger this rest rule (e.g., `["NIGHT"]`)
</ParamField>

<ParamField body="excludes" type="array">
  Shift tags to exclude from rest calculations
</ParamField>

<ParamField body="sequence" type="string">
  When to apply: `AFTER` (default) or `BEFORE`
</ParamField>

<ParamField body="period" type="object">
  Fixed time period for weekly/periodic rest rules
</ParamField>

<ParamField body="periodType" type="string">
  Rolling period type: `WEEKLY`, `DAILY`
</ParamField>

## Common Rest Patterns

<AccordionGroup>
  <Accordion title="11-hour daily rest (EU Working Time Directive)">
    ```json theme={null}
    {
      "rests": [
        {
          "tags": ["ALL"],
          "sequence": "AFTER",
          "min": "PT11H"
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="24-hour weekly rest">
    ```json theme={null}
    {
      "rests": [
        {
          "periodType": "WEEKLY",
          "min": "PT24H",
          "minConsecutive": "PT24H"
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="Extended rest after night shifts">
    ```json theme={null}
    {
      "rests": [
        {
          "tags": ["NIGHT"],
          "sequence": "AFTER",
          "min": "PT48H"
        }
      ]
    }
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  Combine rest rules with [patterns](/guides/fill/examples/pattern) for comprehensive fatigue management. Rest rules handle timing, patterns handle shift sequences.
</Tip>
