Skip to content

Commit

Permalink
(#437) users: update domain infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Oct 27, 2024
1 parent 76300bf commit 7b06984
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,10 @@
<ProjectReference Include="../../../Paralax/src/Paralax.CQRS.WebApi/src/Paralax.CQRS.WebApi/Paralax.CQRS.WebApi.csproj" AdditionalProperties="TargetFramework=net8.0" />
</ItemGroup> -->

<!-- <ItemGroup>
<ProjectReference Include="../../../Paralax/src/Paralax.MessageBrokers.RabbitMQ/src/Paralax.MessageBrokers.RabbitMQ/Paralax.MessageBrokers.RabbitMQ.csproj" />
<ProjectReference Include="../../../Paralax/src/Paralax.MessageBrokers/src/Paralax.MessageBrokers/Paralax.MessageBrokers.csproj" />
</ItemGroup> -->


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ public static UserSettings AsEntity(this UserSettingsDocument document)
document.AvailableSettings.ConnectionVisibility,
document.AvailableSettings.FollowersVisibility,
document.AvailableSettings.FollowingVisibility,
document.AvailableSettings.FriendListVisibility,
document.AvailableSettings.FollowersListVisibility,
document.AvailableSettings.FollowingListVisibility,
document.AvailableSettings.MyPostsVisibility,
document.AvailableSettings.ConnectionsPostsVisibility,
document.AvailableSettings.MyRepostsVisibility,
Expand All @@ -252,51 +255,73 @@ public static UserSettings AsEntity(this UserSettingsDocument document)
document.AvailableSettings.DeviceTypeVisibility,
document.AvailableSettings.LastActiveVisibility,
document.AvailableSettings.CountryVisibility,
document.AvailableSettings.CityVisibility
document.AvailableSettings.CityVisibility,

document.AvailableSettings.MessageVisibility,
document.AvailableSettings.ProfileVisibility,
document.AvailableSettings.PostCommentVisibility,
document.AvailableSettings.PostLikeVisibility,
document.AvailableSettings.FriendRequestVisibility,
document.AvailableSettings.TaggedPostVisibility,
document.AvailableSettings.StoryVisibility,
document.AvailableSettings.GroupMembershipVisibility
)
);


public static UserSettingsDocument AsDocument(this UserSettings entity)
=> new UserSettingsDocument
=> new UserSettingsDocument
{
Id = Guid.NewGuid(),
UserId = entity.UserId,
AvailableSettings = new UserAvailableSettingsDocument
{
Id = Guid.NewGuid(),
UserId = entity.UserId,
AvailableSettings = new UserAvailableSettingsDocument
{
CreatedAtVisibility = entity.AvailableSettings.CreatedAtVisibility,
DateOfBirthVisibility = entity.AvailableSettings.DateOfBirthVisibility,
InterestedInEventsVisibility = entity.AvailableSettings.InterestedInEventsVisibility,
SignedUpEventsVisibility = entity.AvailableSettings.SignedUpEventsVisibility,
EducationVisibility = entity.AvailableSettings.EducationVisibility,
WorkPositionVisibility = entity.AvailableSettings.WorkPositionVisibility,
LanguagesVisibility = entity.AvailableSettings.LanguagesVisibility,
InterestsVisibility = entity.AvailableSettings.InterestsVisibility,
ContactEmailVisibility = entity.AvailableSettings.ContactEmailVisibility,
PhoneNumberVisibility = entity.AvailableSettings.PhoneNumberVisibility,
ProfileImageVisibility = entity.AvailableSettings.ProfileImageVisibility,
BannerImageVisibility = entity.AvailableSettings.BannerImageVisibility,
GalleryVisibility = entity.AvailableSettings.GalleryVisibility,
CreatedAtVisibility = entity.AvailableSettings.CreatedAtVisibility,
DateOfBirthVisibility = entity.AvailableSettings.DateOfBirthVisibility,
InterestedInEventsVisibility = entity.AvailableSettings.InterestedInEventsVisibility,
SignedUpEventsVisibility = entity.AvailableSettings.SignedUpEventsVisibility,
EducationVisibility = entity.AvailableSettings.EducationVisibility,
WorkPositionVisibility = entity.AvailableSettings.WorkPositionVisibility,
LanguagesVisibility = entity.AvailableSettings.LanguagesVisibility,
InterestsVisibility = entity.AvailableSettings.InterestsVisibility,
ContactEmailVisibility = entity.AvailableSettings.ContactEmailVisibility,
PhoneNumberVisibility = entity.AvailableSettings.PhoneNumberVisibility,
ProfileImageVisibility = entity.AvailableSettings.ProfileImageVisibility,
BannerImageVisibility = entity.AvailableSettings.BannerImageVisibility,
GalleryVisibility = entity.AvailableSettings.GalleryVisibility,

ConnectionVisibility = entity.AvailableSettings.ConnectionVisibility,
FollowersVisibility = entity.AvailableSettings.FollowersVisibility,
FollowingVisibility = entity.AvailableSettings.FollowingVisibility,
MyPostsVisibility = entity.AvailableSettings.MyPostsVisibility,
ConnectionsPostsVisibility = entity.AvailableSettings.ConnectionsPostsVisibility,
MyRepostsVisibility = entity.AvailableSettings.MyRepostsVisibility,
RepostsOfMyConnectionsVisibility = entity.AvailableSettings.RepostsOfMyConnectionsVisibility,
OrganizationIAmCreatorVisibility = entity.AvailableSettings.OrganizationIAmCreatorVisibility,
OrganizationIFollowVisibility = entity.AvailableSettings.OrganizationIFollowVisibility,
ConnectionVisibility = entity.AvailableSettings.ConnectionVisibility,
FollowersVisibility = entity.AvailableSettings.FollowersVisibility,
FollowingVisibility = entity.AvailableSettings.FollowingVisibility,
FriendListVisibility = entity.AvailableSettings.FriendListVisibility,
FollowersListVisibility = entity.AvailableSettings.FollowersListVisibility,
FollowingListVisibility = entity.AvailableSettings.FollowingListVisibility,
MyPostsVisibility = entity.AvailableSettings.MyPostsVisibility,
ConnectionsPostsVisibility = entity.AvailableSettings.ConnectionsPostsVisibility,
MyRepostsVisibility = entity.AvailableSettings.MyRepostsVisibility,
RepostsOfMyConnectionsVisibility = entity.AvailableSettings.RepostsOfMyConnectionsVisibility,
OrganizationIAmCreatorVisibility = entity.AvailableSettings.OrganizationIAmCreatorVisibility,
OrganizationIFollowVisibility = entity.AvailableSettings.OrganizationIFollowVisibility,

IsOnlineVisibility = entity.AvailableSettings.IsOnlineVisibility,
DeviceTypeVisibility = entity.AvailableSettings.DeviceTypeVisibility,
LastActiveVisibility = entity.AvailableSettings.LastActiveVisibility,
CountryVisibility = entity.AvailableSettings.CountryVisibility,
CityVisibility = entity.AvailableSettings.CityVisibility,
IsOnlineVisibility = entity.AvailableSettings.IsOnlineVisibility,
DeviceTypeVisibility = entity.AvailableSettings.DeviceTypeVisibility,
LastActiveVisibility = entity.AvailableSettings.LastActiveVisibility,
CountryVisibility = entity.AvailableSettings.CountryVisibility,
CityVisibility = entity.AvailableSettings.CityVisibility,

FrontendVersion = entity.AvailableSettings.FrontendVersion,
PreferredLanguage = entity.AvailableSettings.PreferredLanguage,

MessageVisibility = entity.AvailableSettings.MessageVisibility,
ProfileVisibility = entity.AvailableSettings.ProfileVisibility,
PostCommentVisibility = entity.AvailableSettings.PostCommentVisibility,
PostLikeVisibility = entity.AvailableSettings.PostLikeVisibility,
FriendRequestVisibility = entity.AvailableSettings.FriendRequestVisibility,
TaggedPostVisibility = entity.AvailableSettings.TaggedPostVisibility,
StoryVisibility = entity.AvailableSettings.StoryVisibility,
GroupMembershipVisibility = entity.AvailableSettings.GroupMembershipVisibility
}
};

FrontendVersion = entity.AvailableSettings.FrontendVersion,
PreferredLanguage = entity.AvailableSettings.PreferredLanguage
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class UserAvailableSettingsDocument
public Visibility ConnectionVisibility { get; set; }
public Visibility FollowersVisibility { get; set; }
public Visibility FollowingVisibility { get; set; }
public Visibility FriendListVisibility { get; set; } // Who can see the user's friend list
public Visibility FollowersListVisibility { get; set; } // Who can see the user's followers list
public Visibility FollowingListVisibility { get; set; } // Who can see the user's following list
public Visibility MyPostsVisibility { get; set; }
public Visibility ConnectionsPostsVisibility { get; set; }
public Visibility MyRepostsVisibility { get; set; }
Expand All @@ -38,5 +41,14 @@ public class UserAvailableSettingsDocument

public FrontendVersion FrontendVersion { get; set; }
public PreferredLanguage PreferredLanguage { get; set; }

public Visibility MessageVisibility { get; set; } // Who can message the user
public Visibility ProfileVisibility { get; set; } // Overall profile visibility
public Visibility PostCommentVisibility { get; set; } // Who can comment on posts
public Visibility PostLikeVisibility { get; set; } // Who can like posts
public Visibility FriendRequestVisibility { get; set; } // Who can send friend requests
public Visibility TaggedPostVisibility { get; set; } // Who can see posts the user is tagged in
public Visibility StoryVisibility { get; set; } // Who can view stories
public Visibility GroupMembershipVisibility { get; set; } // Who can see user's group memberships
}
}

0 comments on commit 7b06984

Please sign in to comment.