One Day Rest In Seven Rule

Class Name

com.workbrain.app.ta.quickrules.OneDayRestInSevenRule

Overview

The One Day Rest In Seven Rule ensures that an employee receives a minimum of 24 hours of consecutive rest in seven days, as long as the employee has worked a specified minimum number of hours. You can configure the rule to guarantee any number of consecutive rest hours for any number of days, such as 48 hours of consecutive rest in 10 days. You can also ensure the rest period includes a specified block of time.

If the rule determines an employee does not have appropriate breaks of sufficient length, the rule inserts an error on the employee's timesheet.

Parameters

Parameters marked with an asterisk (*) are required.

Parameter Description
*Limit to Calendar Week This parameter determines whether the seven day period the rule checks is limited to a calendar week.
  • Select this check box to check that employees are not scheduled for 7 consecutive days without an appropriate rest period during one calendar week. The duration of the rest period is defined by the Minimum Rest Period Duration parameter. The rule allows employees to be scheduled for 7 consecutive days without an appropriate rest period as long as the consecutive 7 day period spans 2 calendar weeks.
  • Clear the check box to check for any consecutive number of days, defined in the Days to Look Back parameter, that employees are scheduled without an appropriate rest period.
Split Time Specify the time, in the HH:mm format, at which days are split when the rule determines which work details to include. Any work details that occur before this time on the first day of the time period under examination are not included.

For example, if the rule splits work details at 6:00 and the rule is limited to calendar weeks starting on Sunday, a shift scheduled from 1:00 to 5:00 on Sunday counts toward the previous week and not the current week.

Day Week Starts Select what day is considered the first day of the week from the drop-down list. By default, this parameter is blank. The rule considers the day that is specified in the DAY_WEEK_STARTS registry parameter as the start of the week.

Select the day of the week you want the rule to consider the start of the week to override the registry parameter's value.

This parameter is not used when the Limit to Calendar Week parameter is cleared.

Days to Look Back Specify the number of days you want the rule to examine. The specified time period is only used when the Limit to Calendar Week parameter is cleared. The time period under examination includes the current day. Therefore, if today is Friday and Days to Look Back is set to 7, the rule examines from the previous Saturday to today.
Minimum Worked Hours Specify the minimum number of hours an employee must be scheduled before the rule applies. If an employee is not scheduled the specified number of hours, within the time period under examination (either the calendar week or the number of days that is specified in the Days to Look Back parameter), the rule does not check if the employee has a rest period.
Valid Work Time Codes Specify a comma-separated list of time codes that represent time spent working. Work details with these time codes are counted toward the total number of worked hours.
Valid Work Hour Types Specify a comma-separated list of hour types that represent time spent working. Work details with these hour types are counted toward the total number of worked hours. By default, the parameter is blank and the rule does not examine the hour types. Work details with valid work time codes are counted toward the total number of work hours, regardless of their hour type.
Valid Non-Work Non-Rest Time Code Specify a comma-separated list of time codes that represent time spent not working or not resting. Work details with these time codes are not counted toward the total number of worked or rest hours. By default, the parameter is set to VAC, SICK, so that vacation time and sick days are not counted toward the total number of worked or rest hours.
Valid Non-Work Non-Rest Hour Types Specify a comma-separated list of hour types that represent time neither spent working nor is considered rest. Work details with these hour types are not counted toward the total number of worked or rest hours. By default, the parameter is blank and the rule does not examine the hour types of work details to determine if the time is spent working or at rest.
Minimum Rest Period Duration Specify the number of consecutive hours required for a rest period. By default, the value is 24 and the rule checks that a 24-hour rest period is included in the time period under examination. You can specify the rule to check for any length. For example, specify 48 to ensure employees are scheduled two consecutive days off.
Rest Period Start Time Specify the start time of the required rest period to configure the rule to only consider rest periods that start on or before the start time.
Rest Period End Time Specify the end time of the required rest period to configure the rule to only consider rest periods that end on or after the end time.

Example: Not enough rest within a calendar week

The rule checks calendar weeks for a 24 hour rest period, as long as the employee has worked at least 20 hours. The relevant parameter settings are:

  • Limit to Calendar Week = True
  • Start Day = Sunday
  • Minimum Worked Hours = 20

The employee's rotating 7-day shift pattern:

Date Start Time End Time Rest Hours Hours Scheduled Total Cumulative Hours Scheduled
Sunday 9:00 14:00 22 5 5
Monday 9:00 14:00 19 5 10
Tuesday 9:00 11:00 19 2 12
Wednesday 9:00 11:00 22 2 14
Thursday 9:00 11:00 22 2 16
Friday 9:00 11:00 22 2 18
Saturday 9:00 11:00 22 2 20

These settings result in the rule failing. The employee has worked the minimum number of hours, but the longest rest period is only 22 hours, not 24.

Example: Not enough rest within the specified rest period

The rule checks consecutive 7 days for a 24 hour rest period that starts on or before 8:00 and ends on or after 17:00, as long as the employee has worked at least 20 hours. The relevant parameter settings are:

  • Limit to Calendar Week = False
  • Days to Look Back = 7
  • Minimum Worked Hours = 20
  • Rest Period Start Time = 08:00
  • Rest Period End Time = 17:00

The employee's rotating 7-day shift pattern:

Day Start Time End Time Rest Hours Hours Scheduled Total Cumulative Hours Scheduled Rest Period Included?
1 13:00 22:00 26 7 7 No
2 17:00 23:00 19 6 13 Yes
3 9:00 12:00 10 3 16 No
4 9:00 11:00 21 2 18 No
5 9:00 11:00 22 2 20 No
6 9:00 11:00 22 2 22 No
7 9:00 11:00 22 2 24 No

These settings result in the rule failing. The employee has worked the minimum number of hours, but the longest rest period that qualifies is only 19 hours, not 24. The 26 hour rest period does not start on or before 08:00, so the rest period does not qualify.