feat: implémenter SignalR hubs (Monitoring, Notifications, Admin) + système de notifications complet

SignalR Hubs:
- MonitoringHub (/hubs/monitoring) — statuts agents/caméras/stockage/GPU jobs
- NotificationsHub (/hubs/notifications) — notifications in-app badge temps réel
- AdminHub (/hubs/admin) — broadcast changements config (Admin only)

Notification System:
- Nouvelles entités: Notification, NotificationTemplate, UserNotificationConfig
- CQRS/MediatR: 6 handlers (list, unread, mark-read, mark-all, config get/update)
- Infrastructure: NotificationService orchestrator + EmailService + GotifyService
- Rate limiter IMemoryCache (20 events/min/camera/type)
- Hangfire jobs: SendNotification, DailyDigest, WeeklyDigest
- NotificationsController API (6 endpoints)
- Blazor UI: NotificationsPage + NotificationBadge
- Migration AddNotifications (3 nouvelles tables)
- 644 nouveaux tests (Domain: 131, Application: 321, Infra: 151, Integration: 120, +autres)
This commit is contained in:
Arnaud Dartois committed 2026-07-26 20:45:35 +00:00
1 parent ef3ea9d1ca
commit f9be0f1e0d
62 files changed
+6664 -3

No files matched your search

@@ -1027,6 +1027,128 @@ namespace Heimdall.Infrastructure.Migrations
b.ToTable("known_faces", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Notification", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid?>("CameraId")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("EventType")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("IsRead")
.HasColumnType("boolean");
b.Property<string>("Link")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<DateTime?>("ReadAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("SiteId")
.HasColumnType("uuid");
b.Property<string>("SnapshotUrl")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("UserId");
b.HasIndex("UserId", "IsRead");
b.ToTable("notifications", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.NotificationTemplate", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("BodyMarkdown")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Channel")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("EventType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("IsDefault")
.HasColumnType("boolean");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasDefaultValue("fr");
b.Property<string>("Subject")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.HasIndex("EventType", "Channel", "Language")
.IsUnique();
b.ToTable("notification_templates", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Person", b =>
{
b.Property<Guid>("Id")
@@ -1180,6 +1302,68 @@ namespace Heimdall.Infrastructure.Migrations
b.ToTable("user_groups", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserNotificationConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<bool>("DailyDigest")
.HasColumnType("boolean");
b.Property<string>("EmailAddress")
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<bool>("EmailEnabled")
.HasColumnType("boolean");
b.Property<bool>("GotifyEnabled")
.HasColumnType("boolean");
b.Property<string>("GotifyToken")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("GotifyUrl")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasDefaultValue("fr");
b.Property<string>("SubscribedEventsJson")
.HasColumnType("jsonb")
.HasColumnName("subscribed_events");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<bool>("WeeklyDigest")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("user_notification_configs", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserSite", b =>
{
b.Property<Guid>("UserId")