using SurrealDb.Net.Models;
using RelayShared.Services;
namespace RelayServer.Models;
///
/// Surreal record for the `channels` table. One row per channel.
///
/// Lifecycle: created by HandleCreateChannel (or seeded by ServerBootstrapService at boot).
/// Soft-deleted by HandleDeleteChannel (IsDeleted flipped, row stays for audit).
///
public class Channels : Record
{
/// Sidebar display name. Lowercased and dash-separated for new channels.
public required string Name { get; set; }
/// Creation timestamp. Drives sidebar sort order.
public required DateTime CreatedAt { get; set; }
/// Drives client rendering and server routing — Text/Voice/File/Forum/Stage.
public ChannelType Type { get; set; } = ChannelType.Text;
/// Sidebar category header (e.g. "General"). Empty means default group.
public string Group { get; set; } = string.Empty;
///
/// True for announcement-style channels (#welcome, #files). Non-admins are blocked from
/// posting via PermissionService.CanSendMessagesAsync.
///
public bool IsReadOnly { get; set; }
/// Soft-delete flag. Filtered out of channel-list builds in BuildChannelListForUser.
public bool IsDeleted { get; set; }
///
/// Surreal record id of a File channel ("channels:xyz"). When set, ChatSocketBehavior's
/// MirrorAttachmentIfNeeded auto-copies non-gif attachments into the linked channel.
///
public string? LinkedFileChannelId { get; set; }
}