Skip to main content
Configuration for schedule. Coverage entries for the same semantic time and target stack additively. An unscoped entry applies every day; adding a weekend-only entry on top doubles the count on those days. Use mutually exclusive dayOfWeek on both entries to avoid stacking. See cover for details. roleIds, times, coverage, and shiftPatterns are required. These four fields form the minimum solvable schedule.

Type Parameters

R

R extends readonly string[] = readonly string[]

S

S extends readonly string[] = readonly []

T

T extends Record<string, SemanticTimeEntry> = Record<string, SemanticTimeEntry>

Properties

coverage
NoInfer<CoverageEntry<keyof T & string, R[number] | S[number]>>[]
required
Staffing requirements per time period (entries stack additively).
dayOfWeek
readonly [DayOfWeek, DayOfWeek]
Days of the week the business operates (inclusion filter).
members
SchedulingMember[]
Team members (typically added via .with() at runtime).
roleIds
R
required
Declared role IDs.
ruleFactories
Record<string, CreateCpsatRuleFunction>
Custom rule factories. Keys are rule names, values are functions that take a config object and return a CompilationRule. Built-in rule names cannot be overridden.
rules
RuleEntry[]
Scheduling rules and constraints.
shiftPatterns
ShiftPattern[]
required
Available shift patterns.
skillIds
S
Declared skill IDs. When omitted, coverage targets can only be roles.
times
T
required
Named semantic time periods.
weekStartsOn
DayOfWeek
Which day starts the week for weekly rules. Defaults to "monday".