diff --git a/DysonNetwork.Sphere/Chat/ChatRoom.cs b/DysonNetwork.Sphere/Chat/ChatRoom.cs
index 2a457e8..5fd9d53 100644
--- a/DysonNetwork.Sphere/Chat/ChatRoom.cs
+++ b/DysonNetwork.Sphere/Chat/ChatRoom.cs
@@ -41,11 +41,11 @@ public class ChatRoom : ModelBase, IIdentifiedResource
public string ResourceIdentifier => $"chatroom/{Id}";
}
-public enum ChatMemberRole
+public abstract class ChatMemberRole
{
- Owner = 100,
- Moderator = 50,
- Member = 0
+ public const int Owner = 100;
+ public const int Moderator = 50;
+ public const int Member = 0;
}
public enum ChatMemberNotify
@@ -55,6 +55,18 @@ public enum ChatMemberNotify
None
}
+public enum ChatTimeoutCauseType
+{
+ ByModerator = 0,
+ BySlowMode = 1,
+}
+
+public class ChatTimeoutCause
+{
+ public ChatTimeoutCauseType Type { get; set; }
+ public Guid? SenderId { get; set; }
+}
+
public class ChatMember : ModelBase
{
public Guid Id { get; set; }
@@ -65,12 +77,27 @@ public class ChatMember : ModelBase
[MaxLength(1024)] public string? Nick { get; set; }
- public ChatMemberRole Role { get; set; } = ChatMemberRole.Member;
+ public int Role { get; set; } = ChatMemberRole.Member;
public ChatMemberNotify Notify { get; set; } = ChatMemberNotify.All;
public Instant? LastReadAt { get; set; }
public Instant? JoinedAt { get; set; }
public Instant? LeaveAt { get; set; }
public bool IsBot { get; set; } = false;
+
+ ///
+ /// The break time is the user doesn't receive any message from this member for a while.
+ /// Expect mentioned him or her.
+ ///
+ public Instant? BreakUntil { get; set; }
+ ///
+ /// The timeout is the user can't send any message.
+ /// Set by the moderator of the chat room.
+ ///
+ public Instant? TimeoutUntil { get; set; }
+ ///
+ /// The timeout cause is the reason why the user is timeout.
+ ///
+ [Column(TypeName = "jsonb")] public ChatTimeoutCause? TimeoutCause { get; set; }
}
public class ChatMemberTransmissionObject : ModelBase
@@ -82,11 +109,15 @@ public class ChatMemberTransmissionObject : ModelBase
[MaxLength(1024)] public string? Nick { get; set; }
- public ChatMemberRole Role { get; set; } = ChatMemberRole.Member;
+ public int Role { get; set; } = ChatMemberRole.Member;
public ChatMemberNotify Notify { get; set; } = ChatMemberNotify.All;
public Instant? JoinedAt { get; set; }
public Instant? LeaveAt { get; set; }
public bool IsBot { get; set; } = false;
+
+ public Instant? BreakUntil { get; set; }
+ public Instant? TimeoutUntil { get; set; }
+ public ChatTimeoutCause? TimeoutCause { get; set; }
public static ChatMemberTransmissionObject FromEntity(ChatMember member)
{
@@ -102,6 +133,9 @@ public class ChatMemberTransmissionObject : ModelBase
JoinedAt = member.JoinedAt,
LeaveAt = member.LeaveAt,
IsBot = member.IsBot,
+ BreakUntil = member.BreakUntil,
+ TimeoutUntil = member.TimeoutUntil,
+ TimeoutCause = member.TimeoutCause,
CreatedAt = member.CreatedAt,
UpdatedAt = member.UpdatedAt,
DeletedAt = member.DeletedAt
diff --git a/DysonNetwork.Sphere/Chat/ChatRoomController.cs b/DysonNetwork.Sphere/Chat/ChatRoomController.cs
index c33d878..133e889 100644
--- a/DysonNetwork.Sphere/Chat/ChatRoomController.cs
+++ b/DysonNetwork.Sphere/Chat/ChatRoomController.cs
@@ -195,15 +195,15 @@ public class ChatRoomController(
if (chatRoom.Picture is not null)
await fileRefService.CreateReferenceAsync(
- chatRoom.Picture.Id,
- "chat.room.picture",
+ chatRoom.Picture.Id,
+ "chat.room.picture",
chatRoomResourceId
);
if (chatRoom.Background is not null)
await fileRefService.CreateReferenceAsync(
- chatRoom.Background.Id,
- "chat.room.background",
+ chatRoom.Background.Id,
+ "chat.room.background",
chatRoomResourceId
);
@@ -254,7 +254,8 @@ public class ChatRoomController(
if (picture is null) return BadRequest("Invalid picture id, unable to find the file on cloud.");
// Remove old references for pictures
- var oldPictureRefs = await fileRefService.GetResourceReferencesAsync(chatRoomResourceId, "chat.room.picture");
+ var oldPictureRefs =
+ await fileRefService.GetResourceReferencesAsync(chatRoomResourceId, "chat.room.picture");
foreach (var oldRef in oldPictureRefs)
{
await fileRefService.DeleteReferenceAsync(oldRef.Id);
@@ -262,8 +263,8 @@ public class ChatRoomController(
// Add a new reference
await fileRefService.CreateReferenceAsync(
- picture.Id,
- "chat.room.picture",
+ picture.Id,
+ "chat.room.picture",
chatRoomResourceId
);
@@ -276,7 +277,8 @@ public class ChatRoomController(
if (background is null) return BadRequest("Invalid background id, unable to find the file on cloud.");
// Remove old references for backgrounds
- var oldBackgroundRefs = await fileRefService.GetResourceReferencesAsync(chatRoomResourceId, "chat.room.background");
+ var oldBackgroundRefs =
+ await fileRefService.GetResourceReferencesAsync(chatRoomResourceId, "chat.room.background");
foreach (var oldRef in oldBackgroundRefs)
{
await fileRefService.DeleteReferenceAsync(oldRef.Id);
@@ -284,8 +286,8 @@ public class ChatRoomController(
// Add a new reference
await fileRefService.CreateReferenceAsync(
- background.Id,
- "chat.room.background",
+ background.Id,
+ "chat.room.background",
chatRoomResourceId
);
@@ -404,7 +406,7 @@ public class ChatRoomController(
public class ChatMemberRequest
{
[Required] public Guid RelatedUserId { get; set; }
- [Required] public ChatMemberRole Role { get; set; }
+ [Required] public int Role { get; set; }
}
[HttpPost("invites/{roomId:guid}")]
@@ -551,10 +553,47 @@ public class ChatRoomController(
return NoContent();
}
+ public class ChatMemberNotifyRequest
+ {
+ public ChatMemberNotify? NotifyLevel { get; set; }
+ public Instant? BreakUntil { get; set; }
+ }
+
+ [HttpPatch("{roomId:guid}/members/me/notify")]
+ [Authorize]
+ public async Task> UpdateChatMemberNotify(
+ Guid roomId,
+ Guid memberId,
+ [FromBody] ChatMemberNotifyRequest request
+ )
+ {
+ if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
+
+ var chatRoom = await db.ChatRooms
+ .Where(r => r.Id == roomId)
+ .FirstOrDefaultAsync();
+ if (chatRoom is null) return NotFound();
+
+ var targetMember = await db.ChatMembers
+ .Where(m => m.AccountId == memberId && m.ChatRoomId == roomId)
+ .FirstOrDefaultAsync();
+ if (targetMember is null) return BadRequest("You have not joined this chat room.");
+ if (request.NotifyLevel is not null)
+ targetMember.Notify = request.NotifyLevel.Value;
+ if (request.BreakUntil is not null)
+ targetMember.BreakUntil = request.BreakUntil.Value;
+
+ db.ChatMembers.Update(targetMember);
+ await db.SaveChangesAsync();
+
+ await crs.PurgeRoomMembersCache(roomId);
+
+ return Ok(targetMember);
+ }
+
[HttpPatch("{roomId:guid}/members/{memberId:guid}/role")]
[Authorize]
- public async Task> UpdateChatMemberRole(Guid roomId, Guid memberId,
- [FromBody] ChatMemberRole newRole)
+ public async Task> UpdateChatMemberRole(Guid roomId, Guid memberId, [FromBody] int newRole)
{
if (newRole >= ChatMemberRole.Owner) return BadRequest("Unable to set chat member to owner or greater role.");
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
@@ -597,6 +636,8 @@ public class ChatRoomController(
db.ChatMembers.Update(targetMember);
await db.SaveChangesAsync();
+ await crs.PurgeRoomMembersCache(roomId);
+
als.CreateActionLogFromRequest(
ActionLogType.RealmAdjustRole,
new Dictionary
diff --git a/DysonNetwork.Sphere/Chat/ChatRoomService.cs b/DysonNetwork.Sphere/Chat/ChatRoomService.cs
index 82dfff9..33f3a19 100644
--- a/DysonNetwork.Sphere/Chat/ChatRoomService.cs
+++ b/DysonNetwork.Sphere/Chat/ChatRoomService.cs
@@ -9,14 +9,14 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
public const string ChatRoomGroupPrefix = "ChatRoom_";
private const string RoomMembersCacheKeyPrefix = "ChatRoomMembers_";
private const string ChatMemberCacheKey = "ChatMember_{0}_{1}";
-
+
public async Task> ListRoomMembers(Guid roomId)
{
var cacheKey = RoomMembersCacheKeyPrefix + roomId;
var cachedMembers = await cache.GetAsync>(cacheKey);
if (cachedMembers != null)
return cachedMembers;
-
+
var members = await db.ChatMembers
.Include(m => m.Account)
.ThenInclude(m => m.Profile)
@@ -27,18 +27,18 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
var chatRoomGroup = ChatRoomGroupPrefix + roomId;
await cache.SetWithGroupsAsync(cacheKey, members,
- [chatRoomGroup],
+ [chatRoomGroup],
TimeSpan.FromMinutes(5));
-
+
return members;
}
-
+
public async Task GetRoomMember(Guid accountId, Guid chatRoomId)
{
var cacheKey = string.Format(ChatMemberCacheKey, accountId, chatRoomId);
var member = await cache.GetAsync(cacheKey);
if (member is not null) return member;
-
+
member = await db.ChatMembers
.Include(m => m.Account)
.ThenInclude(m => m.Profile)
@@ -50,12 +50,12 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
if (member == null) return member;
var chatRoomGroup = ChatRoomGroupPrefix + chatRoomId;
await cache.SetWithGroupsAsync(cacheKey, member,
- [chatRoomGroup],
+ [chatRoomGroup],
TimeSpan.FromMinutes(5));
return member;
}
-
+
public async Task PurgeRoomMembersCache(Guid roomId)
{
var chatRoomGroup = ChatRoomGroupPrefix + roomId;
@@ -70,15 +70,15 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
.GroupBy(m => m.ChatRoomId)
.Select(g => new { RoomId = g.Key, CreatedAt = g.Max(m => m.CreatedAt) })
.ToDictionaryAsync(g => g.RoomId, m => m.CreatedAt);
-
+
var now = SystemClock.Instance.GetCurrentInstant();
var sortedRooms = rooms
.OrderByDescending(r => lastMessages.TryGetValue(r.Id, out var time) ? time : now)
.ToList();
-
+
return sortedRooms;
}
-
+
public async Task> LoadDirectMessageMembers(List rooms, Guid userId)
{
var directRoomsId = rooms
@@ -86,7 +86,7 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
.Select(r => r.Id)
.ToList();
if (directRoomsId.Count == 0) return rooms;
-
+
var directMembers = directRoomsId.Count != 0
? await db.ChatMembers
.Where(m => directRoomsId.Contains(m.ChatRoomId))
@@ -97,7 +97,7 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
.GroupBy(m => m.ChatRoomId)
.ToDictionaryAsync(g => g.Key, g => g.ToList())
: new Dictionary>();
-
+
return rooms.Select(r =>
{
if (r.Type == ChatRoomType.DirectMessage && directMembers.TryGetValue(r.Id, out var otherMembers))
@@ -105,7 +105,7 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
return r;
}).ToList();
}
-
+
public async Task LoadDirectMessageMembers(ChatRoom room, Guid userId)
{
if (room.Type != ChatRoomType.DirectMessage) return room;
@@ -115,17 +115,17 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
.Include(m => m.Account)
.Include(m => m.Account.Profile)
.ToListAsync();
-
+
if (members.Count > 0)
room.DirectMembers = members.Select(ChatMemberTransmissionObject.FromEntity).ToList();
return room;
}
-
- public async Task IsMemberWithRole(Guid roomId, Guid accountId, params ChatMemberRole[] requiredRoles)
+
+ public async Task IsMemberWithRole(Guid roomId, Guid accountId, params int[] requiredRoles)
{
if (requiredRoles.Length == 0)
return false;
-
+
var maxRequiredRole = requiredRoles.Max();
var member = await db.ChatMembers
.FirstOrDefaultAsync(m => m.ChatRoomId == roomId && m.AccountId == accountId);
diff --git a/DysonNetwork.Sphere/Migrations/20250609153232_EnrichChatMembers.Designer.cs b/DysonNetwork.Sphere/Migrations/20250609153232_EnrichChatMembers.Designer.cs
new file mode 100644
index 0000000..33a984e
--- /dev/null
+++ b/DysonNetwork.Sphere/Migrations/20250609153232_EnrichChatMembers.Designer.cs
@@ -0,0 +1,3357 @@
+//
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using DysonNetwork.Sphere;
+using DysonNetwork.Sphere.Account;
+using DysonNetwork.Sphere.Chat;
+using DysonNetwork.Sphere.Storage;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NetTopologySuite.Geometries;
+using NodaTime;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using NpgsqlTypes;
+
+#nullable disable
+
+namespace DysonNetwork.Sphere.Migrations
+{
+ [DbContext(typeof(AppDatabase))]
+ [Migration("20250609153232_EnrichChatMembers")]
+ partial class EnrichChatMembers
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.3")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("ActivatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("activated_at");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("IsSuperuser")
+ .HasColumnType("boolean")
+ .HasColumnName("is_superuser");
+
+ b.Property("Language")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("character varying(32)")
+ .HasColumnName("language");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("name");
+
+ b.Property("Nick")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("nick");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_accounts");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("ix_accounts_name");
+
+ b.ToTable("accounts", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property>("Config")
+ .HasColumnType("jsonb")
+ .HasColumnName("config");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("EnabledAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("enabled_at");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expired_at");
+
+ b.Property("Secret")
+ .HasMaxLength(8196)
+ .HasColumnType("character varying(8196)")
+ .HasColumnName("secret");
+
+ b.Property("Trustworthy")
+ .HasColumnType("integer")
+ .HasColumnName("trustworthy");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_account_auth_factors");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_account_auth_factors_account_id");
+
+ b.ToTable("account_auth_factors", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("content");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("IsPrimary")
+ .HasColumnType("boolean")
+ .HasColumnName("is_primary");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("VerifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("verified_at");
+
+ b.HasKey("Id")
+ .HasName("pk_account_contacts");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_account_contacts_account_id");
+
+ b.ToTable("account_contacts", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.ActionLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("Action")
+ .IsRequired()
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("action");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("IpAddress")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasColumnName("ip_address");
+
+ b.Property("Location")
+ .HasColumnType("geometry")
+ .HasColumnName("location");
+
+ b.Property>("Meta")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("meta");
+
+ b.Property("SessionId")
+ .HasColumnType("uuid")
+ .HasColumnName("session_id");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("UserAgent")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("user_agent");
+
+ b.HasKey("Id")
+ .HasName("pk_action_logs");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_action_logs_account_id");
+
+ b.HasIndex("SessionId")
+ .HasDatabaseName("ix_action_logs_session_id");
+
+ b.ToTable("action_logs", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.Badge", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("Caption")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("caption");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expired_at");
+
+ b.Property("Label")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("label");
+
+ b.Property>("Meta")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("meta");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("type");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_badges");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_badges_account_id");
+
+ b.ToTable("badges", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("Level")
+ .HasColumnType("integer")
+ .HasColumnName("level");
+
+ b.Property("RewardExperience")
+ .HasColumnType("integer")
+ .HasColumnName("reward_experience");
+
+ b.Property("RewardPoints")
+ .HasColumnType("numeric")
+ .HasColumnName("reward_points");
+
+ b.Property>("Tips")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("tips");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_account_check_in_results");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_account_check_in_results_account_id");
+
+ b.ToTable("account_check_in_results", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("AffectedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("affected_at");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expires_at");
+
+ b.Property>("Meta")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("meta");
+
+ b.Property("Spell")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("spell");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_magic_spells");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_magic_spells_account_id");
+
+ b.HasIndex("Spell")
+ .IsUnique()
+ .HasDatabaseName("ix_magic_spells_spell");
+
+ b.ToTable("magic_spells", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("Content")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("content");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property>("Meta")
+ .HasColumnType("jsonb")
+ .HasColumnName("meta");
+
+ b.Property("Priority")
+ .HasColumnType("integer")
+ .HasColumnName("priority");
+
+ b.Property("Subtitle")
+ .HasMaxLength(2048)
+ .HasColumnType("character varying(2048)")
+ .HasColumnName("subtitle");
+
+ b.Property("Title")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("title");
+
+ b.Property("Topic")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("topic");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("ViewedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("viewed_at");
+
+ b.HasKey("Id")
+ .HasName("pk_notifications");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_notifications_account_id");
+
+ b.ToTable("notifications", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("DeviceId")
+ .IsRequired()
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("device_id");
+
+ b.Property("DeviceToken")
+ .IsRequired()
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("device_token");
+
+ b.Property("LastUsedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("last_used_at");
+
+ b.Property("Provider")
+ .HasColumnType("integer")
+ .HasColumnName("provider");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_notification_push_subscriptions");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_notification_push_subscriptions_account_id");
+
+ b.HasIndex("DeviceToken", "DeviceId", "AccountId")
+ .IsUnique()
+ .HasDatabaseName("ix_notification_push_subscriptions_device_token_device_id_acco");
+
+ b.ToTable("notification_push_subscriptions", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("Background")
+ .HasColumnType("jsonb")
+ .HasColumnName("background");
+
+ b.Property("BackgroundId")
+ .HasMaxLength(32)
+ .HasColumnType("character varying(32)")
+ .HasColumnName("background_id");
+
+ b.Property("Bio")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("bio");
+
+ b.Property("Birthday")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("birthday");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("Experience")
+ .HasColumnType("integer")
+ .HasColumnName("experience");
+
+ b.Property("FirstName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("first_name");
+
+ b.Property("Gender")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("gender");
+
+ b.Property("LastName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("last_name");
+
+ b.Property("LastSeenAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("last_seen_at");
+
+ b.Property("MiddleName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("middle_name");
+
+ b.Property("Picture")
+ .HasColumnType("jsonb")
+ .HasColumnName("picture");
+
+ b.Property("PictureId")
+ .HasMaxLength(32)
+ .HasColumnType("character varying(32)")
+ .HasColumnName("picture_id");
+
+ b.Property("Pronouns")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("pronouns");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_account_profiles");
+
+ b.HasIndex("AccountId")
+ .IsUnique()
+ .HasDatabaseName("ix_account_profiles_account_id");
+
+ b.ToTable("account_profiles", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
+ {
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("RelatedId")
+ .HasColumnType("uuid")
+ .HasColumnName("related_id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expired_at");
+
+ b.Property("Status")
+ .HasColumnType("smallint")
+ .HasColumnName("status");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("AccountId", "RelatedId")
+ .HasName("pk_account_relationships");
+
+ b.HasIndex("RelatedId")
+ .HasDatabaseName("ix_account_relationships_related_id");
+
+ b.ToTable("account_relationships", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("Attitude")
+ .HasColumnType("integer")
+ .HasColumnName("attitude");
+
+ b.Property("ClearedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("cleared_at");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("IsInvisible")
+ .HasColumnType("boolean")
+ .HasColumnName("is_invisible");
+
+ b.Property("IsNotDisturb")
+ .HasColumnType("boolean")
+ .HasColumnName("is_not_disturb");
+
+ b.Property("Label")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("label");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_account_statuses");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_account_statuses_account_id");
+
+ b.ToTable("account_statuses", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property>("Audiences")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("audiences");
+
+ b.Property>("BlacklistFactors")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("blacklist_factors");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("DeviceId")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("device_id");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expired_at");
+
+ b.Property("FailedAttempts")
+ .HasColumnType("integer")
+ .HasColumnName("failed_attempts");
+
+ b.Property("IpAddress")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasColumnName("ip_address");
+
+ b.Property("Location")
+ .HasColumnType("geometry")
+ .HasColumnName("location");
+
+ b.Property("Nonce")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("nonce");
+
+ b.Property("Platform")
+ .HasColumnType("integer")
+ .HasColumnName("platform");
+
+ b.Property>("Scopes")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("scopes");
+
+ b.Property("StepRemain")
+ .HasColumnType("integer")
+ .HasColumnName("step_remain");
+
+ b.Property("StepTotal")
+ .HasColumnType("integer")
+ .HasColumnName("step_total");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("UserAgent")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasColumnName("user_agent");
+
+ b.HasKey("Id")
+ .HasName("pk_auth_challenges");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_auth_challenges_account_id");
+
+ b.ToTable("auth_challenges", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("ChallengeId")
+ .HasColumnType("uuid")
+ .HasColumnName("challenge_id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expired_at");
+
+ b.Property("Label")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("label");
+
+ b.Property("LastGrantedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("last_granted_at");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_auth_sessions");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_auth_sessions_account_id");
+
+ b.HasIndex("ChallengeId")
+ .HasDatabaseName("ix_auth_sessions_challenge_id");
+
+ b.ToTable("auth_sessions", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AccountId")
+ .HasColumnType("uuid")
+ .HasColumnName("account_id");
+
+ b.Property("BreakUntil")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("break_until");
+
+ b.Property("ChatRoomId")
+ .HasColumnType("uuid")
+ .HasColumnName("chat_room_id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("IsBot")
+ .HasColumnType("boolean")
+ .HasColumnName("is_bot");
+
+ b.Property("JoinedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("joined_at");
+
+ b.Property("LastReadAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("last_read_at");
+
+ b.Property("LeaveAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("leave_at");
+
+ b.Property("Nick")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("nick");
+
+ b.Property("Notify")
+ .HasColumnType("integer")
+ .HasColumnName("notify");
+
+ b.Property("Role")
+ .HasColumnType("integer")
+ .HasColumnName("role");
+
+ b.Property("TimeoutCause")
+ .HasColumnType("jsonb")
+ .HasColumnName("timeout_cause");
+
+ b.Property("TimeoutUntil")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("timeout_until");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_chat_members");
+
+ b.HasAlternateKey("ChatRoomId", "AccountId")
+ .HasName("ak_chat_members_chat_room_id_account_id");
+
+ b.HasIndex("AccountId")
+ .HasDatabaseName("ix_chat_members_account_id");
+
+ b.ToTable("chat_members", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("Background")
+ .HasColumnType("jsonb")
+ .HasColumnName("background");
+
+ b.Property("BackgroundId")
+ .HasMaxLength(32)
+ .HasColumnType("character varying(32)")
+ .HasColumnName("background_id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("Description")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("description");
+
+ b.Property("IsCommunity")
+ .HasColumnType("boolean")
+ .HasColumnName("is_community");
+
+ b.Property("IsPublic")
+ .HasColumnType("boolean")
+ .HasColumnName("is_public");
+
+ b.Property("Name")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("name");
+
+ b.Property("Picture")
+ .HasColumnType("jsonb")
+ .HasColumnName("picture");
+
+ b.Property("PictureId")
+ .HasMaxLength(32)
+ .HasColumnType("character varying(32)")
+ .HasColumnName("picture_id");
+
+ b.Property("RealmId")
+ .HasColumnType("uuid")
+ .HasColumnName("realm_id");
+
+ b.Property("Type")
+ .HasColumnType("integer")
+ .HasColumnName("type");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_chat_rooms");
+
+ b.HasIndex("RealmId")
+ .HasDatabaseName("ix_chat_rooms_realm_id");
+
+ b.ToTable("chat_rooms", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property>("Attachments")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("attachments");
+
+ b.Property("ChatRoomId")
+ .HasColumnType("uuid")
+ .HasColumnName("chat_room_id");
+
+ b.Property("Content")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("content");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("EditedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("edited_at");
+
+ b.Property("ForwardedMessageId")
+ .HasColumnType("uuid")
+ .HasColumnName("forwarded_message_id");
+
+ b.Property>("MembersMentioned")
+ .HasColumnType("jsonb")
+ .HasColumnName("members_mentioned");
+
+ b.Property>("Meta")
+ .HasColumnType("jsonb")
+ .HasColumnName("meta");
+
+ b.Property("Nonce")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("character varying(36)")
+ .HasColumnName("nonce");
+
+ b.Property("RepliedMessageId")
+ .HasColumnType("uuid")
+ .HasColumnName("replied_message_id");
+
+ b.Property("SenderId")
+ .HasColumnType("uuid")
+ .HasColumnName("sender_id");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("type");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_chat_messages");
+
+ b.HasIndex("ChatRoomId")
+ .HasDatabaseName("ix_chat_messages_chat_room_id");
+
+ b.HasIndex("ForwardedMessageId")
+ .HasDatabaseName("ix_chat_messages_forwarded_message_id");
+
+ b.HasIndex("RepliedMessageId")
+ .HasDatabaseName("ix_chat_messages_replied_message_id");
+
+ b.HasIndex("SenderId")
+ .HasDatabaseName("ix_chat_messages_sender_id");
+
+ b.ToTable("chat_messages", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("Attitude")
+ .HasColumnType("integer")
+ .HasColumnName("attitude");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("MessageId")
+ .HasColumnType("uuid")
+ .HasColumnName("message_id");
+
+ b.Property("SenderId")
+ .HasColumnType("uuid")
+ .HasColumnName("sender_id");
+
+ b.Property("Symbol")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("symbol");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_chat_reactions");
+
+ b.HasIndex("MessageId")
+ .HasDatabaseName("ix_chat_reactions_message_id");
+
+ b.HasIndex("SenderId")
+ .HasDatabaseName("ix_chat_reactions_sender_id");
+
+ b.ToTable("chat_reactions", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("EndedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("ended_at");
+
+ b.Property("ProviderName")
+ .HasColumnType("text")
+ .HasColumnName("provider_name");
+
+ b.Property("RoomId")
+ .HasColumnType("uuid")
+ .HasColumnName("room_id");
+
+ b.Property("SenderId")
+ .HasColumnType("uuid")
+ .HasColumnName("sender_id");
+
+ b.Property("SessionId")
+ .HasColumnType("text")
+ .HasColumnName("session_id");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("UpstreamConfigJson")
+ .HasColumnType("jsonb")
+ .HasColumnName("upstream");
+
+ b.HasKey("Id")
+ .HasName("pk_chat_realtime_call");
+
+ b.HasIndex("RoomId")
+ .HasDatabaseName("ix_chat_realtime_call_room_id");
+
+ b.HasIndex("SenderId")
+ .HasDatabaseName("ix_chat_realtime_call_sender_id");
+
+ b.ToTable("chat_realtime_call", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomApp", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("name");
+
+ b.Property("PublisherId")
+ .HasColumnType("uuid")
+ .HasColumnName("publisher_id");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("slug");
+
+ b.Property("Status")
+ .HasColumnType("integer")
+ .HasColumnName("status");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("VerifiedAs")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("verified_as");
+
+ b.Property("VerifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("verified_at");
+
+ b.HasKey("Id")
+ .HasName("pk_custom_apps");
+
+ b.HasIndex("PublisherId")
+ .HasDatabaseName("ix_custom_apps_publisher_id");
+
+ b.ToTable("custom_apps", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Developer.CustomAppSecret", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("AppId")
+ .HasColumnType("uuid")
+ .HasColumnName("app_id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expired_at");
+
+ b.Property("Remarks")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)")
+ .HasColumnName("remarks");
+
+ b.Property("Secret")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("secret");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_custom_app_secrets");
+
+ b.HasIndex("AppId")
+ .HasDatabaseName("ix_custom_app_secrets_app_id");
+
+ b.ToTable("custom_app_secrets", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("deleted_at");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasColumnName("key");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.HasKey("Id")
+ .HasName("pk_permission_groups");
+
+ b.ToTable("permission_groups", (string)null);
+ });
+
+ modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b =>
+ {
+ b.Property("GroupId")
+ .HasColumnType("uuid")
+ .HasColumnName("group_id");
+
+ b.Property