Skip to main content
Scoping options shared by most rule functions. Default priority is MANDATORY. Use appliesTo to scope to a role, skill, or member ID. Use time scoping options (dayOfWeek, dateRange, dates) to limit when the rule applies. Scope answers where a rule is evaluated. It does not change the rule’s core meaning. For example, maxDaysPerWeek(4, { dayOfWeek: ["monday"] }) is still a day-cap concept, just scoped to matching scheduling days. Priority is just as important as scope: scope decides where a rule applies, and priority decides how hard the solver should enforce it. Use "MANDATORY" for requirements the schedule cannot violate, and softer priorities for things the requirements describe as preferred, ideal, or “where possible”. Not all rules support all scoping options. Entity-only rules (e.g., maxConsecutiveDays) ignore time scoping.

Extended by

Properties

appliesTo
appliesTo?: string | string[]
Who this rule applies to (role name, skill name, or member ID).
dateRange
dateRange?: object
Restrict to a date range.
dates
dates?: string[]
Restrict to specific dates (YYYY-MM-DD).
dayOfWeek
dayOfWeek?: readonly [DayOfWeek, DayOfWeek]
Restrict to specific days of the week.
priority
priority?: "LOW" | "MEDIUM" | "HIGH" | "MANDATORY"
Defaults to "MANDATORY".
recurringPeriods
recurringPeriods?: [RecurringPeriod, ...RecurringPeriod[]]
Restrict to recurring calendar periods.