Skip to content

Commit

Permalink
(#433) users: update infrastructure extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Oct 11, 2024
1 parent 8af5559 commit b4d9a46
Showing 1 changed file with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,28 +146,32 @@ public static UserNotificationsDocument AsDocument(this UserNotifications entity
};

public static NotificationPreferencesDto AsDto(this NotificationPreferences notificationPreferences)
=> new NotificationPreferencesDto
{
SystemLogin = notificationPreferences.SystemLogin,
InterestBasedEvents = notificationPreferences.InterestBasedEvents,
EventNotifications = notificationPreferences.EventNotifications,
CommentsNotifications = notificationPreferences.CommentsNotifications,
PostsNotifications = notificationPreferences.PostsNotifications,
EventRecommendation = notificationPreferences.EventRecommendation,
FriendsRecommendation = notificationPreferences.FriendsRecommendation,
FriendsPosts = notificationPreferences.FriendsPosts,
PostsRecommendation = notificationPreferences.PostsRecommendation,
EventsIAmInterestedInNotification = notificationPreferences.EventsIAmInterestedInNotification,
EventsIAmSignedUpToNotification = notificationPreferences.EventsIAmSignedUpToNotification,
PostsOfPeopleIFollowNotification = notificationPreferences.PostsOfPeopleIFollowNotification,
EventNotificationForPeopleIFollow = notificationPreferences.EventNotificationForPeopleIFollow
};
=> new NotificationPreferencesDto
{
SystemLogin = notificationPreferences.SystemLogin,
InterestBasedEvents = notificationPreferences.InterestBasedEvents,
EventNotifications = notificationPreferences.EventNotifications,
CommentsNotifications = notificationPreferences.CommentsNotifications,
PostsNotifications = notificationPreferences.PostsNotifications,
EventRecommendation = notificationPreferences.EventRecommendation,
FriendsRecommendation = notificationPreferences.FriendsRecommendation,
FriendsPosts = notificationPreferences.FriendsPosts,
PostsRecommendation = notificationPreferences.PostsRecommendation,
EventsIAmInterestedInNotification = notificationPreferences.EventsIAmInterestedInNotification,
EventsIAmSignedUpToNotification = notificationPreferences.EventsIAmSignedUpToNotification,
PostsOfPeopleIFollowNotification = notificationPreferences.PostsOfPeopleIFollowNotification,
EventNotificationForPeopleIFollow = notificationPreferences.EventNotificationForPeopleIFollow,

NewFriendsRequests = notificationPreferences.NewFriendsRequests,
MyRequestsAccepted = notificationPreferences.MyRequestsAccepted,
FriendsPostsNotifications = notificationPreferences.FriendsPostsNotifications
};

public static UserNotificationsDocument AsDocument(this NotificationPreferencesDto dto)
=> new UserNotificationsDocument
{
Id = Guid.NewGuid(),
UserId = dto.StudentId,
UserId = dto.UserId,
NotificationPreferences = new NotificationPreferences(
dto.SystemLogin,
dto.InterestBasedEvents,
Expand All @@ -181,7 +185,11 @@ public static UserNotificationsDocument AsDocument(this NotificationPreferencesD
dto.EventsIAmInterestedInNotification,
dto.EventsIAmSignedUpToNotification,
dto.PostsOfPeopleIFollowNotification,
dto.EventNotificationForPeopleIFollow
dto.EventNotificationForPeopleIFollow,

dto.NewFriendsRequests,
dto.MyRequestsAccepted,
dto.FriendsPostsNotifications
)
};

Expand Down

0 comments on commit b4d9a46

Please sign in to comment.