Enable *all* notifications during development and on test servers

This commit is contained in:
Andreas Svanberg 2025-02-18 14:17:45 +01:00
parent 970f6ee61b
commit cfef02b98c

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