12: Add grace period support for persistent alarms

This commit is contained in:
2026-06-23 13:35:49 +02:00
parent 48f087dc6e
commit 091de624f6
@@ -11,6 +11,7 @@ public record PriceAlarmDefinition(
PriceDirection direction, PriceDirection direction,
BigDecimal target, BigDecimal target,
AlarmTrigger trigger, AlarmTrigger trigger,
long triggerGracePeriodSeconds,
AlarmSeverity severity, AlarmSeverity severity,
String note String note
) { ) {
@@ -24,5 +25,11 @@ public record PriceAlarmDefinition(
if (target.signum() < 0) { if (target.signum() < 0) {
throw new IllegalArgumentException("Target price cannot be negative (was: " + target.signum() + ")!"); throw new IllegalArgumentException("Target price cannot be negative (was: " + target.signum() + ")!");
} }
if (triggerGracePeriodSeconds < 0) {
throw new IllegalArgumentException(
"Trigger grace period cannot be negative: " + triggerGracePeriodSeconds
);
}
} }
} }