feat(guild): repositories for Guild aggregate

This commit is contained in:
gamer147
2026-06-27 11:17:51 -04:00
parent 7f245b50d6
commit 3fdc20d21f
11 changed files with 614 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using SVSim.Database.Entities.Guild;
namespace SVSim.Database.Repositories.Guild;
public interface IGuildChatMessageRepository
{
/// <summary>Atomically allocate the next per-guild message_id and insert.</summary>
Task<GuildChatMessage> AppendAsync(GuildChatMessage msg, CancellationToken ct = default);
/// <summary>Window query. direction: 1=OLD (asc-walk older), 2=NEW (newer), 3=BOTH (around).
/// `start` may be 0 meaning "latest". Returns ordered oldest-to-newest.</summary>
Task<IReadOnlyList<GuildChatMessage>> GetWindowAsync(int guildId, int start, int direction, int limit, CancellationToken ct = default);
Task<int> GetMaxMessageIdAsync(int guildId, CancellationToken ct = default);
Task DeleteAllForGuildAsync(int guildId, CancellationToken ct = default);
/// <summary>For /guild_chat/delete_deck: clears the deck payload + body without removing the message row,
/// so the slot remains in the timeline ("[deleted]"). Returns false if not found / not deletable by caller.</summary>
Task<bool> ClearDeckAsync(int guildId, int messageId, long callerViewerId, CancellationToken ct = default);
}