From cfef02b98c2665f29068b3552e40f73b2a3cc87e Mon Sep 17 00:00:00 2001
From: Andreas Svanberg <andreass@dsv.su.se>
Date: Tue, 18 Feb 2025 14:17:45 +0100
Subject: [PATCH] Enable *all* notifications during development and on test
 servers

---
 .../se/su/dsv/scipro/DataInitializer.java     | 29 +++++++++++++++----
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/core/src/main/java/se/su/dsv/scipro/DataInitializer.java b/core/src/main/java/se/su/dsv/scipro/DataInitializer.java
index fb3bf8b4f9..cc67c30b8b 100644
--- a/core/src/main/java/se/su/dsv/scipro/DataInitializer.java
+++ b/core/src/main/java/se/su/dsv/scipro/DataInitializer.java
@@ -28,7 +28,14 @@ import se.su.dsv.scipro.match.TholanderBox;
 import se.su.dsv.scipro.milestones.dataobjects.MilestoneActivityTemplate;
 import se.su.dsv.scipro.milestones.dataobjects.MilestonePhaseTemplate;
 import se.su.dsv.scipro.milestones.service.MilestoneActivityTemplateService;
+import se.su.dsv.scipro.notifications.dataobject.CustomEvent;
+import se.su.dsv.scipro.notifications.dataobject.GroupEvent;
+import se.su.dsv.scipro.notifications.dataobject.IdeaEvent;
+import se.su.dsv.scipro.notifications.dataobject.MileStoneEvent;
 import se.su.dsv.scipro.notifications.dataobject.Notification;
+import se.su.dsv.scipro.notifications.dataobject.PeerEvent;
+import se.su.dsv.scipro.notifications.dataobject.ProjectEvent;
+import se.su.dsv.scipro.notifications.dataobject.ProjectForumEvent;
 import se.su.dsv.scipro.notifications.dataobject.SeminarEvent;
 import se.su.dsv.scipro.notifications.settings.service.ReceiverConfigurationService;
 import se.su.dsv.scipro.profiles.CurrentProfile;
@@ -155,12 +162,22 @@ public class DataInitializer implements Lifecycle {
     }
 
     private void setUpNotifications() {
-        receiverConfigurationService.setReceiving(
-            Notification.Type.FINAL_SEMINAR,
-            SeminarEvent.Event.OPPOSITION_REPORT_SUBMITTED,
-            Member.Type.SUPERVISOR,
-            true
-        );
+        enableAllNotifications(Notification.Type.PEER, PeerEvent.Event.values());
+        enableAllNotifications(Notification.Type.FORUM, ProjectForumEvent.Event.values());
+        enableAllNotifications(Notification.Type.GROUP, GroupEvent.Event.values());
+        enableAllNotifications(Notification.Type.MILESTONE, MileStoneEvent.Event.values());
+        enableAllNotifications(Notification.Type.PROJECT, ProjectEvent.Event.values());
+        enableAllNotifications(Notification.Type.IDEA, IdeaEvent.Event.values());
+        enableAllNotifications(Notification.Type.CUSTOM, CustomEvent.Event.values());
+        enableAllNotifications(Notification.Type.FINAL_SEMINAR, SeminarEvent.Event.values());
+    }
+
+    private void enableAllNotifications(Notification.Type type, Enum<?>[] events) {
+        for (Enum<?> event : events) {
+            for (Member.Type member : Member.Type.values()) {
+                receiverConfigurationService.setReceiving(type, event, member, true);
+            }
+        }
     }
 
     private void createPastFinalSeminar() {