Skip to main content

Function: createMinRestBetweenShiftsRule()

function createMinRestBetweenShiftsRule(config): CompilationRule;
Enforces a minimum rest period between any two shifts a person works.

Parameters

ParameterType
config{ employeeIds?: string[]; hours: number; priority: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY"; roleIds?: string[]; skillIds?: string[]; }
config.employeeIds?string[]
config.hoursnumber
config.priority"LOW" | "MEDIUM" | "HIGH" | "MANDATORY"
config.roleIds?string[]
config.skillIds?string[]

Returns

CompilationRule

Example

const rule = createMinRestBetweenShiftsRule({
  hours: 10,
  priority: "MANDATORY",
});
builder = new ModelBuilder({ ...config, rules: [rule] });