How rules work
Rules are passed toModelBuilder as ruleConfigs, an array of { name, config } entries. Each rule compiles into CP-SAT constraints during builder.compile().
Priority levels
Each rule has apriority that determines how the solver treats it:
Built-in rules
Hours limits
Consecutive days
Shift limits
Time off
Assignment
Scoping
Rules can be scoped to apply to specific subsets of employees or time periods. Use thescope field:
employeeIds: apply to specific employeesroleIds: apply to employees with specific rolesskillIds: apply to employees with specific skillsdays: apply only on specific datesdaysOfWeek: apply only on specific days of the week