diff --git a/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/Handlers/UpdateUserNotificationPreferencesHandler.cs b/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/Handlers/UpdateUserNotificationPreferencesHandler.cs index 3d572100..246b5df9 100644 --- a/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/Handlers/UpdateUserNotificationPreferencesHandler.cs +++ b/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/Handlers/UpdateUserNotificationPreferencesHandler.cs @@ -24,15 +24,21 @@ public async Task HandleAsync(UpdateUserNotificationPreferences command, Cancell var commandJson = JsonSerializer.Serialize(command); Console.WriteLine($"Received UpdateUserNotificationPreferences command: {commandJson}"); + // Create the updated NotificationPreferences object var notificationPreferences = new NotificationPreferences( - command.AccountChanges, command.SystemLogin, - command.NewEvent, command.InterestBasedEvents, command.EventNotifications, command.CommentsNotifications, command.PostsNotifications, - command.FriendsNotifications + command.EventRecommendation, + command.FriendsRecommendation, + command.FriendsPosts, + command.PostsRecommendation, + command.EventsIAmInterestedInNotification, + command.EventsIAmSignedUpToNotification, + command.PostsOfPeopleIFollowNotification, + command.EventNotificationForPeopleIFollow ); await _userNotificationPreferencesRepository.UpdateNotificationPreferencesAsync(command.StudentId, notificationPreferences); diff --git a/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/UpdateUserNotificationPreferences.cs b/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/UpdateUserNotificationPreferences.cs index a6489237..dccf7605 100644 --- a/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/UpdateUserNotificationPreferences.cs +++ b/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Application/Commands/UpdateUserNotificationPreferences.cs @@ -7,14 +7,43 @@ public class UpdateUserNotificationPreferences : ICommand { public Guid StudentId { get; set; } public bool EmailNotifications { get; set; } - public bool AccountChanges { get; set; } + public bool SystemLogin { get; set; } - public bool NewEvent { get; set; } public bool InterestBasedEvents { get; set; } public bool EventNotifications { get; set; } public bool CommentsNotifications { get; set; } public bool PostsNotifications { get; set; } - public bool FriendsNotifications { get; set; } - } + public bool EventRecommendation { get; set; } + public bool FriendsRecommendation { get; set; } + public bool FriendsPosts { get; set; } + public bool PostsRecommendation { get; set; } + public bool EventsIAmInterestedInNotification { get; set; } + public bool EventsIAmSignedUpToNotification { get; set; } + public bool PostsOfPeopleIFollowNotification { get; set; } + public bool EventNotificationForPeopleIFollow { get; set; } + + public UpdateUserNotificationPreferences(Guid studentId, bool emailNotifications, bool systemLogin, bool interestBasedEvents, + bool eventNotifications, bool commentsNotifications, bool postsNotifications, bool eventRecommendation, + bool friendsRecommendation, bool friendsPosts, bool postsRecommendation, bool eventsIAmInterestedInNotification, + bool eventsIAmSignedUpToNotification, bool postsOfPeopleIFollowNotification, bool eventNotificationForPeopleIFollow) + { + StudentId = studentId; + EmailNotifications = emailNotifications; + SystemLogin = systemLogin; + InterestBasedEvents = interestBasedEvents; + EventNotifications = eventNotifications; + CommentsNotifications = commentsNotifications; + PostsNotifications = postsNotifications; + + EventRecommendation = eventRecommendation; + FriendsRecommendation = friendsRecommendation; + FriendsPosts = friendsPosts; + PostsRecommendation = postsRecommendation; + EventsIAmInterestedInNotification = eventsIAmInterestedInNotification; + EventsIAmSignedUpToNotification = eventsIAmSignedUpToNotification; + PostsOfPeopleIFollowNotification = postsOfPeopleIFollowNotification; + EventNotificationForPeopleIFollow = eventNotificationForPeopleIFollow; + } + } } diff --git a/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Core/Entities/NotificationPreferences.cs b/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Core/Entities/NotificationPreferences.cs index 0ae96e0e..41a2b642 100644 --- a/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Core/Entities/NotificationPreferences.cs +++ b/MiniSpace.Services.Students/src/MiniSpace.Services.Students.Core/Entities/NotificationPreferences.cs @@ -4,56 +4,81 @@ namespace MiniSpace.Services.Students.Core.Entities { public class NotificationPreferences { - public bool AccountChanges { get; private set; } public bool SystemLogin { get; private set; } - public bool NewEvent { get; private set; } public bool InterestBasedEvents { get; private set; } public bool EventNotifications { get; private set; } public bool CommentsNotifications { get; private set; } public bool PostsNotifications { get; private set; } - public bool FriendsNotifications { get; private set; } - + public bool EventRecommendation { get; private set; } + public bool FriendsRecommendation { get; private set; } + public bool FriendsPosts { get; private set; } + public bool PostsRecommendation { get; private set; } + public bool EventsIAmInterestedInNotification { get; private set; } + public bool EventsIAmSignedUpToNotification { get; private set; } + public bool PostsOfPeopleIFollowNotification { get; private set; } + public bool EventNotificationForPeopleIFollow { get; private set; } + public NotificationPreferences() { - - AccountChanges = false; SystemLogin = false; - NewEvent = false; InterestBasedEvents = false; EventNotifications = false; CommentsNotifications = false; PostsNotifications = false; - FriendsNotifications = false; - } + EventRecommendation = false; + FriendsRecommendation = false; + FriendsPosts = false; + PostsRecommendation = false; + EventsIAmInterestedInNotification = false; + EventsIAmSignedUpToNotification = false; + PostsOfPeopleIFollowNotification = false; + EventNotificationForPeopleIFollow = false; + } - public NotificationPreferences(bool accountChanges, bool systemLogin, bool newEvent, bool interestBasedEvents, - bool eventNotifications, bool commentsNotifications, bool postsNotifications, - bool friendsNotifications) + public NotificationPreferences(bool systemLogin, bool interestBasedEvents, bool eventNotifications, + bool commentsNotifications, bool postsNotifications, bool eventRecommendation, + bool friendsRecommendation, bool friendsPosts, bool postsRecommendation, + bool eventsIAmInterestedInNotification, bool eventsIAmSignedUpToNotification, + bool postsOfPeopleIFollowNotification, bool eventNotificationForPeopleIFollow) { - AccountChanges = accountChanges; SystemLogin = systemLogin; - NewEvent = newEvent; InterestBasedEvents = interestBasedEvents; EventNotifications = eventNotifications; CommentsNotifications = commentsNotifications; PostsNotifications = postsNotifications; - FriendsNotifications = friendsNotifications; + + EventRecommendation = eventRecommendation; + FriendsRecommendation = friendsRecommendation; + FriendsPosts = friendsPosts; + PostsRecommendation = postsRecommendation; + EventsIAmInterestedInNotification = eventsIAmInterestedInNotification; + EventsIAmSignedUpToNotification = eventsIAmSignedUpToNotification; + PostsOfPeopleIFollowNotification = postsOfPeopleIFollowNotification; + EventNotificationForPeopleIFollow = eventNotificationForPeopleIFollow; } - public void UpdatePreferences(bool accountChanges, bool systemLogin, bool newEvent, bool interestBasedEvents, - bool eventNotifications, bool commentsNotifications, bool postsNotifications, - bool friendsNotifications) + public void UpdatePreferences(bool systemLogin, bool interestBasedEvents, bool eventNotifications, + bool commentsNotifications, bool postsNotifications, bool eventRecommendation, + bool friendsRecommendation, bool friendsPosts, bool postsRecommendation, + bool eventsIAmInterestedInNotification, bool eventsIAmSignedUpToNotification, + bool postsOfPeopleIFollowNotification, bool eventNotificationForPeopleIFollow) { - AccountChanges = accountChanges; SystemLogin = systemLogin; - NewEvent = newEvent; InterestBasedEvents = interestBasedEvents; EventNotifications = eventNotifications; CommentsNotifications = commentsNotifications; PostsNotifications = postsNotifications; - FriendsNotifications = friendsNotifications; + + EventRecommendation = eventRecommendation; + FriendsRecommendation = friendsRecommendation; + FriendsPosts = friendsPosts; + PostsRecommendation = postsRecommendation; + EventsIAmInterestedInNotification = eventsIAmInterestedInNotification; + EventsIAmSignedUpToNotification = eventsIAmSignedUpToNotification; + PostsOfPeopleIFollowNotification = postsOfPeopleIFollowNotification; + EventNotificationForPeopleIFollow = eventNotificationForPeopleIFollow; } } }