import apiClient from '../../../shared/services/apiClient';

export interface UserSession {
  id: number;
  ip_address?: string;
  user_agent?: string;
  device_info?: string;
  last_activity: string;
  created_at: string;
  expires_at: string;
}

class SessionService {
  async getMySessions() {
    const response = await apiClient.get('/sessions');
    return response.data;
  }

  async revokeSession(sessionId: number) {
    const response = await apiClient.delete(`/sessions/${sessionId}`);
    return response.data;
  }

  async revokeAllSessions() {
    const response = await apiClient.post('/sessions/revoke-all');
    return response.data;
  }
}

export default new SessionService();

