Skip to main content
type CpsatRuleConfigEntry<Registry> = CpsatRuleConfigEntryFor<Registry>;
A named rule configuration entry. Flat discriminated union: name is the discriminant and all config fields (including scope fields like memberIds, dayOfWeek, etc.) sit at the same level. This eliminates the { name, config: { ... } } nesting that invited misplacement of scope fields.

Type Parameters

Registry

Registry extends CpsatRuleRegistry = BuiltInCpsatRuleRegistry

Example

const rules: CpsatRuleConfigEntry[] = [
  { name: "max-hours-week", hours: 40, priority: "MANDATORY" },
  { name: "time-off", memberIds: ["alice"], dayOfWeek: ["monday"], priority: "MANDATORY" },
];