/**
 * API для подписок и оплаты
 */

import apiClient from '@/lib/api-client';

export interface Subscription {
  id: number;
  plan: { id: number; name: string };
  start_date: string;
  end_date: string;
  student_count?: number;
}

export async function getActiveSubscription(): Promise<Subscription | null> {
  try {
    const response = await apiClient.get<any>('/subscriptions/subscriptions/active/');
    return response.data;
  } catch {
    return null;
  }
}
