use crate::auth::jwt::Claims;
use crate::config::AppState;
use axum::{
    extract::{Extension, Path, State},
    http::StatusCode,
    Json,
};
use serde::Serialize;

#[derive(Debug, Serialize)]
pub struct SessionInfo {
    pub id: String,
    pub device_info: Option<String>,
    pub ip_address: Option<String>,
    pub created_at: String,
    pub last_active: String,
    pub is_current: bool,
}

pub async fn get_sessions(
    State(_state): State<AppState>,
    Extension(_claims): Extension<Claims>,
) -> Result<Json<Vec<SessionInfo>>, StatusCode> {
    // For now, return empty array as session management is optional
    Ok(Json(vec![]))
}

pub async fn revoke_session(
    State(_state): State<AppState>,
    Extension(_claims): Extension<Claims>,
    Path(_id): Path<String>,
) -> Result<StatusCode, StatusCode> {
    // Session revocation is optional for MVP
    Ok(StatusCode::NO_CONTENT)
}

pub async fn revoke_all_sessions(
    State(_state): State<AppState>,
    Extension(_claims): Extension<Claims>,
) -> Result<StatusCode, StatusCode> {
    // Session revocation is optional for MVP
    Ok(StatusCode::NO_CONTENT)
}
