Skip to main content
function mustAssign(opts?): RuleEntry<"must-assign", {
  appliesTo?: string | string[];
}>;
Guarantees that targeted members appear on the schedule each week.

Parameters

appliesTo
string | string[]

Returns

RuleEntry<"must-assign", {
  appliesTo?: string | string[];
}\>
Use for staffing obligations: salaried employees who are paid regardless of whether they work, or contracted staff who must be rostered. The solver ensures each targeted member has at least one assignment per scheduling week. Always a soft constraint (HIGH priority internally). The schedule still generates when a member genuinely cannot be placed (e.g., full week of absences). Violations surface as validation warnings with distinct messaging from minDaysPerWeek. Priority is not configurable; the rule name communicates the intent.