mirror of
https://github.com/Govor-team/Govor.git
synced 2026-11-18 05:15:06 +00:00
Add primitive groups and required channel
Adds server-side group and channel management, private invitations, member moderation, avatar handling, and required-channel configuration. This change also introduces SignalR group profile/member notifications, updates registration to atomically join required channels, and adds EF migration and test coverage for group membership, permissions, and invitation expiry rules.
This commit is contained in:
@@ -28,6 +28,9 @@ namespace Govor.Domain.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
@@ -47,6 +50,9 @@ namespace Govor.Domain.Migrations
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<Guid?>("OwnerUserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("ReactionMode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -55,6 +61,8 @@ namespace Govor.Domain.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("OwnerUserId");
|
||||
|
||||
b.ToTable("ChatGroups");
|
||||
});
|
||||
|
||||
@@ -96,7 +104,10 @@ namespace Govor.Domain.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GroupId");
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("GroupId", "UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("GroupAdmins");
|
||||
});
|
||||
@@ -126,9 +137,15 @@ namespace Govor.Domain.Migrations
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<bool>("IsRevoked")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("MaxParticipants")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("UsedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("UserMakerId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
@@ -136,6 +153,9 @@ namespace Govor.Domain.Migrations
|
||||
|
||||
b.HasIndex("GroupId");
|
||||
|
||||
b.HasIndex("InvitationCode")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("UserMakerId");
|
||||
|
||||
b.ToTable("GroupInvitations");
|
||||
@@ -147,9 +167,6 @@ namespace Govor.Domain.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid?>("ChatGroupId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("GroupId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
@@ -167,12 +184,13 @@ namespace Govor.Domain.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ChatGroupId");
|
||||
|
||||
b.HasIndex("GroupId");
|
||||
|
||||
b.HasIndex("InvitationId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("GroupId", "UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("GroupMemberships");
|
||||
});
|
||||
|
||||
@@ -744,6 +762,31 @@ namespace Govor.Domain.Migrations
|
||||
b.ToTable("UserReactionPacks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.ServerCommunitySettings", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("AllowLeave")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("RequiredChannelId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RequiredChannelId");
|
||||
|
||||
b.ToTable("ServerCommunitySettings");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
AllowLeave = true
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.Users.Admin", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
@@ -965,6 +1008,14 @@ namespace Govor.Domain.Migrations
|
||||
b.ToTable("UserSessions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.ChatGroup", b =>
|
||||
{
|
||||
b.HasOne("Govor.Domain.Models.Users.User", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerUserId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.Friendship", b =>
|
||||
{
|
||||
b.HasOne("Govor.Domain.Models.Users.User", "Addressee")
|
||||
@@ -991,6 +1042,12 @@ namespace Govor.Domain.Migrations
|
||||
.HasForeignKey("GroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Govor.Domain.Models.Users.User", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.GroupInvitation", b =>
|
||||
@@ -1012,12 +1069,8 @@ namespace Govor.Domain.Migrations
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.GroupMembership", b =>
|
||||
{
|
||||
b.HasOne("Govor.Domain.Models.ChatGroup", null)
|
||||
.WithMany("Members")
|
||||
.HasForeignKey("ChatGroupId");
|
||||
|
||||
b.HasOne("Govor.Domain.Models.ChatGroup", "ChatGroup")
|
||||
.WithMany()
|
||||
.WithMany("Members")
|
||||
.HasForeignKey("GroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
@@ -1027,6 +1080,12 @@ namespace Govor.Domain.Migrations
|
||||
.HasForeignKey("InvitationId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("Govor.Domain.Models.Users.User", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ChatGroup");
|
||||
});
|
||||
|
||||
@@ -1156,6 +1215,14 @@ namespace Govor.Domain.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.ServerCommunitySettings", b =>
|
||||
{
|
||||
b.HasOne("Govor.Domain.Models.ChatGroup", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RequiredChannelId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Govor.Domain.Models.Users.Admin", b =>
|
||||
{
|
||||
b.HasOne("Govor.Domain.Models.Users.User", "User")
|
||||
|
||||
Reference in New Issue
Block a user