feat: add notification center and reliable client presence

This commit is contained in:
2026-07-30 20:43:06 +03:00
parent 3e60abed50
commit c7aa286dde
27 changed files with 1625 additions and 67 deletions
@@ -3,6 +3,8 @@ package httpapi
import (
"testing"
"time"
"rmm-openwrt/server/internal/model"
)
func TestNotificationRetryDelay(t *testing.T) {
@@ -16,3 +18,15 @@ func TestNotificationRetryDelay(t *testing.T) {
t.Fatalf("retry cap: got %s want 30m", got)
}
}
func TestNotificationQuietHoursAcrossMidnight(t *testing.T) {
settings := model.NotificationSettings{
Timezone: "UTC", QuietHoursEnabled: true, QuietHoursStart: "22:00", QuietHoursEnd: "08:00",
}
if !notificationQuietNow(settings, time.Date(2026, 7, 30, 23, 0, 0, 0, time.UTC)) {
t.Fatal("23:00 must be quiet")
}
if notificationQuietNow(settings, time.Date(2026, 7, 30, 12, 0, 0, 0, time.UTC)) {
t.Fatal("12:00 must not be quiet")
}
}