Skip to main content
function createMaxShiftsDayRule(config): CompilationRule;
Limits how many shifts a person can work in a single day. This rule controls the maximum number of distinct shift assignments per day, regardless of shift duration. For limiting total hours worked, use max-hours-day. Supports entity scoping (people, roles, skills) and time scoping (date ranges, specific dates, days of week, recurring periods).

Parameters

config
MaxShiftsDayConfig
required

Returns

CompilationRule

Examples

createMaxShiftsDayRule({
  shifts: 1,
  priority: "MANDATORY",
});
createMaxShiftsDayRule({
  roleIds: ["part-time"],
  shifts: 2,
  priority: "HIGH",
});
createMaxShiftsDayRule({
  roleIds: ["student"],
  shifts: 2,
  dayOfWeek: ["saturday", "sunday"],
  priority: "MANDATORY",
});