using EchoHub.Core.DTOs; namespace EchoHub.Core.Contracts; public interface IChannelService { // Channel CRUD Task> GetChannelsAsync(Guid userId, int offset, int limit); Task CreateChannelAsync(Guid creatorUserId, string name, string? topic, bool isPublic, string? password = null, string? encryptionSalt = null, string? wrappedRoomKey = null); Task UpdateTopicAsync(Guid callerUserId, string channelName, string? topic); Task SetChannelPasswordAsync(Guid callerUserId, string channelName, string? password); Task RekeyChannelAsync(Guid callerUserId, string channelName, string oldPassword, string newPassword, string newEncryptionSalt, string newWrappedRoomKey); Task DeleteChannelAsync(Guid callerUserId, string channelName); // Channel queries Task<(string? Topic, bool Exists)> GetChannelTopicAsync(string channelName); Task> GetChannelListAsync(); Task GetChannelByNameAsync(string channelName); Task GetChannelMetaAsync(string channelName); Task GetChannelCryptoAsync(string channelName); Task<(string? EncryptionSalt, string? WrappedRoomKey)> GetChannelKeyEnvelopeAsync(string channelName); // Membership Task<(bool Success, string? Error, bool PasswordRequired)> EnsureChannelMembershipAsync(Guid userId, string channelName, string? password = null); } public record ChannelListItem(string Name, string? Topic, int OnlineCount, bool IsPublic = true, bool IsProtected = false);