//! LQP REST API endpoints.
//!
//! Defines the endpoint paths for the League Client API.

/// Gameflow phase endpoint.
pub const GAMEFLOW_PHASE: &str = "/lol-gameflow/v1/gameflow-phase";
/// Game session endpoint.
pub const SESSION: &str = "/lol-gameflow/v1/session";
/// Champion select session endpoint.
pub const CHAMPION_SELECT: &str = "/lol-champ-select/v1/session";
/// Current summoner endpoint.
pub const SUMMONER: &str = "/lol-summoner/v1/current-summoner";
/// End-of-game stats endpoint.
pub const GAME_STATS: &str = "/lol-end-of-game/v1/eog-stats-block";
/// Current champion in champ select.
pub const CHAMPION_SUMMARY: &str = "/lol-champ-select/v1/current-champion";
/// Current rune page endpoint.
pub const RUNE_PAGES: &str = "/lol-perks/v1/currentpage";
/// All rune pages endpoint.
pub const ALL_RUNE_PAGES: &str = "/lol-perks/v1/pages";
/// Match history endpoint.
pub const MATCH_HISTORY: &str = "/lol-match-history/v1/products/lol/current-summoner/matches";
/// Live client data endpoint (all game data).
pub const LIVE_CLIENT_DATA: &str = "/liveclientdata/allgamedata";
/// Ranked stats endpoint (for LP tracking).
pub const RANKED_STATS: &str = "/lol-ranked/v1/ranked-stats";
/// Current ranked stats for the local player.
pub const CURRENT_RANKED_STATS: &str = "/lol-ranked/v1/current-ranked-stats";
/// LP change notification endpoint.
pub const LP_CHANGE_NOTIFICATION: &str = "/lol-ranked/v1/current-lp-change-notification";
/// Live client active player endpoint.
pub const LIVE_CLIENT_DATA_ACTIVE_PLAYER: &str = "/liveclientdata/activeplayer";
/// Live client player list endpoint.
pub const LIVE_CLIENT_DATA_PLAYER_LIST: &str = "/liveclientdata/playerlist";
/// Live client event data endpoint (kills, deaths, objectives).
pub const LIVE_CLIENT_DATA_EVENTS: &str = "/liveclientdata/eventdata";
/// Local player selection in champion select.
pub const CHAMPION_SELECT_LOCAL_PLAYER: &str = "/lol-champ-select/v1/session/my-selection";

/// Live Client Data server base URL (runs on port 2999).
pub const LIVE_CLIENT_DATA_BASE_URL: &str = "https://127.0.0.1:2999";

/// LQP WebSocket endpoints to subscribe to.
pub const SUBSCRIBE_ENDPOINTS: &[&str] = &[
    GAMEFLOW_PHASE,
    SESSION,
    "/lol-matchmaking/v1/ready-check",
    "/lol-game-events/v1/game-events",
    CHAMPION_SELECT,
    "/lol-lobby/v2/lobby",
    GAME_STATS,
    RANKED_STATS,
    LP_CHANGE_NOTIFICATION,
];

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_endpoints_are_valid() {
        // All endpoints should start with /
        assert!(GAMEFLOW_PHASE.starts_with('/'));
        assert!(SESSION.starts_with('/'));
        assert!(CHAMPION_SELECT.starts_with('/'));
    }

    #[test]
    fn test_subscribe_endpoints_not_empty() {
        assert!(!SUBSCRIBE_ENDPOINTS.is_empty());
    }
}
