Skip to main content

Function: createEmployeeAssignmentPriorityRule()

function createEmployeeAssignmentPriorityRule(config): CompilationRule;
Adds objective weight to prefer or avoid assigning team members. 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[]; preference: "high" | "low"; 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.preference"high" | "low"
config.recurringPeriods?{ endDay: number; endMonth: number; name: string; startDay: number; startMonth: number; }[]
config.roleIds?string[]
config.skillIds?string[]
config.specificDates?string[]

Returns

CompilationRule

Examples

createEmployeeAssignmentPriorityRule({
  employeeIds: ["alice", "bob"],
  preference: "high",
});
createEmployeeAssignmentPriorityRule({
  roleIds: ["student"],
  dayOfWeek: ["monday", "tuesday", "wednesday", "thursday", "friday"],
  preference: "low",
});
createEmployeeAssignmentPriorityRule({
  skillIds: ["senior"],
  dayOfWeek: ["saturday", "sunday"],
  preference: "high",
});