Skip to main content

Function: createMaxHoursDayRule()

function createMaxHoursDayRule(config): CompilationRule;
Limits how many hours a person can work in a single day. Supports entity scoping (people, roles, skills) and time scoping (date ranges, specific dates, days of week, recurring periods).

Parameters

ParameterType
config{ dateRange?: { end: string; start: string; }; dayOfWeek?: ( | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[]; employeeIds?: string[]; hours: number; priority: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY"; recurringPeriods?: { endDay: number; endMonth: number; name: string; startDay: number; startMonth: number; }[]; roleIds?: string[]; skillIds?: string[]; specificDates?: string[]; }
config.dateRange?{ end: string; start: string; }
config.dateRange.endstring
config.dateRange.startstring
config.dayOfWeek?( | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[]
config.employeeIds?string[]
config.hoursnumber
config.priority"LOW" | "MEDIUM" | "HIGH" | "MANDATORY"
config.recurringPeriods?{ endDay: number; endMonth: number; name: string; startDay: number; startMonth: number; }[]
config.roleIds?string[]
config.skillIds?string[]
config.specificDates?string[]

Returns

CompilationRule

Examples

createMaxHoursDayRule({
  hours: 8,
  priority: "MANDATORY",
});
createMaxHoursDayRule({
  roleIds: ["student"],
  hours: 4,
  dayOfWeek: ["monday", "tuesday", "wednesday", "thursday", "friday"],
  priority: "MANDATORY",
});