Skip to main content
function createMaxHoursWeekRule(config): CompilationRule;
Caps total hours a person can work within each scheduling week. Supports entity scoping (people, roles, skills) and time scoping (date ranges, specific dates, days of week, recurring periods). Time scoping filters which days within each week count toward the limit.

Parameters

config
MaxHoursWeekConfig
required

Returns

CompilationRule

Examples

createMaxHoursWeekRule({
  hours: 40,
  priority: "HIGH",
});
createMaxHoursWeekRule({
  roleIds: ["student"],
  hours: 20,
  recurringPeriods: [
    { name: "fall-term", startMonth: 9, startDay: 1, endMonth: 12, endDay: 15 },
    { name: "spring-term", startMonth: 1, startDay: 15, endMonth: 5, endDay: 31 },
  ],
  priority: "MANDATORY",
});