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() {