namespace SVSim.Database.Services.Guild; /// /// Single dispatch surface for guild business operations. Enforces: /// - one viewer ≤1 guild /// - MaxMemberNum / MaxSubLeaderNum caps (from GuildConfig) /// - role-based permissions per docs/superpowers/specs/2026-06-27-guild-functionality-design.md /// - leader-leaves-with-members blocked /// - auto-routing single-member leader leave -> breakup /// - clear pending invites + cancel pending join_requests on successful join /// - emit system chat events via IGuildChatService /// public interface IGuildService { Task GetMyGuildAsync(long viewerId, CancellationToken ct = default); Task GetActiveAsync(int guildId, CancellationToken ct = default); Task> SearchAsync(string name, int activity, int joinCondition, int memberBucket, CancellationToken ct = default); Task CreateAsync(long viewerId, CreateGuildRequest req, CancellationToken ct = default); Task UpdateAsync(long viewerId, UpdateGuildRequest req, CancellationToken ct = default); Task UpdateDescriptionAsync(long viewerId, string description, CancellationToken ct = default); Task UpdateEmblemAsync(long viewerId, long emblemId, CancellationToken ct = default); Task BreakupAsync(long viewerId, CancellationToken ct = default); Task InviteAsync(long callerViewerId, long targetViewerId, CancellationToken ct = default); Task CancelInviteAsync(long callerViewerId, long targetViewerId, CancellationToken ct = default); Task RejectInviteAsync(long callerViewerId, int guildId, CancellationToken ct = default); Task JoinAsync(long viewerId, int guildId, CancellationToken ct = default); Task CancelJoinRequestAsync(long viewerId, int guildId, CancellationToken ct = default); Task AcceptJoinRequestAsync(long callerViewerId, long applicantViewerId, CancellationToken ct = default); Task RejectJoinRequestAsync(long callerViewerId, long applicantViewerId, CancellationToken ct = default); Task LeaveAsync(long viewerId, CancellationToken ct = default); Task RemoveAsync(long callerViewerId, long targetViewerId, CancellationToken ct = default); Task ChangeRoleAsync(long callerViewerId, long targetViewerId, int newRoleId, CancellationToken ct = default); Task> ListPendingInvitesForMeAsync(long viewerId, CancellationToken ct = default); Task> ListPendingJoinRequestsForMyGuildAsync(long viewerId, CancellationToken ct = default); }