namespace Application.Abstractions.Cache;

public static class CacheKeys
{
    public const string Config = "config";
    public const string FaqCategoryActive = "faq:category:active";
    public const string PopupPositionActive = "popup:position:active";

    public static string FaqItemByCode(string code) => $"faq:item:{code}";
    public static string PopupByCode(string code) => $"popup:{code}";
    public static string BannerByCode(string code) => $"banner:{code}";
    public static string DocumentByCode(string code) => $"document:{code}";
    public static string BoardMeta(int boardID) => $"board:meta:{boardID}";
    public const string CryptoCategoryActive = "crypto:category:active";
    public static string CoinBySymbol(string symbol) => $"crypto:coin:{symbol.ToLower()}";

    // Crypto Ticker (market = "KRW-BTC" 형식)
    public static string CryptoTickers(string quote) => $"crypto:tickers:{quote.ToLower()}";
    public static string CryptoTicker(string market) => $"crypto:ticker:{market.ToLower()}";
    public static string CryptoCandle(string market, string type) => $"crypto:candle:{market.ToLower()}:{type}";

    // Crypto REST (초기 로딩용)
    public const string CryptoMarkets = "crypto:markets";
    public static string CryptoTickerDetail(string market) => $"crypto:ticker:detail:{market.ToLower()}";
    public static string CryptoTrades(string market) => $"crypto:trades:{market.ToLower()}";
    public static string CryptoOrderbook(string market) => $"crypto:orderbook:{market.ToLower()}";

    // Crypto WebSocket Live (실시간용)
    public static string CryptoCandleLive(string market, string interval) => $"crypto:candle:live:{market.ToLower()}:{interval}";
    public static string CryptoTradeLive(string market) => $"crypto:trade:live:{market.ToLower()}";
    public static string CryptoOrderbookLive(string market) => $"crypto:orderbook:live:{market.ToLower()}";

    // Chat
    public const string ChatGlobalMessages = "chat:global:messages";
    public const string ChatConnections = "chat:connections";  // Hash — 실시간 접속자
    public const string ChatKickChannel = "chat:kick";         // Pub/Sub — 강제 퇴장

    // YouTube
    public static string YouTubeChannel(string channelId) => $"youtube:channel:{channelId}";
    public static string YouTubeLiveStream(string videoId) => $"youtube:live:{videoId}";
    public const string YouTubePubSubChannels = "youtube:pubsub:channels"; // Set — 구독 중인 채널 ID
}