core(alerting): AlertRule.withEvalState wither for cursor threading

This commit is contained in:
hsiegeln
2026-04-22 16:04:55 +02:00
parent c2252a0e72
commit 0bad014811

View File

@@ -35,4 +35,15 @@ public record AlertRule(
targets = targets == null ? List.of() : List.copyOf(targets);
evalState = evalState == null ? Map.of() : Map.copyOf(evalState);
}
public AlertRule withEvalState(Map<String, Object> newEvalState) {
return new AlertRule(
id, environmentId, name, description, severity, enabled,
conditionKind, condition, evaluationIntervalSeconds,
forDurationSeconds, reNotifyMinutes,
notificationTitleTmpl, notificationMessageTmpl,
webhooks, targets, nextEvaluationAt, claimedBy, claimedUntil,
newEvalState,
createdAt, createdBy, updatedAt, updatedBy);
}
}