From 0bad014811f207a941590780affde5bfd9d16401 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Wed, 22 Apr 2026 16:04:55 +0200 Subject: [PATCH] core(alerting): AlertRule.withEvalState wither for cursor threading --- .../com/cameleer/server/core/alerting/AlertRule.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertRule.java b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertRule.java index 55b530c2..4c8fb659 100644 --- a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertRule.java +++ b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertRule.java @@ -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 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); + } }