// src/services/adminApi.js
import api from "./api";

// ==================== پرداخت‌ها ====================
export const getPayments = (params) => api.get("/academy/payments", { params });
export const updatePaymentStatus = (data) => api.put("/academy/payments/status", data);
export const getPaymentStats = () => api.get("/academy/payments/stats");

// ==================== دوره‌ها ====================
export const getCourses = (params) => api.get("/academy/courses", { params });
export const getCourseById = (id) => api.get(`/academy/courses/${id}`);
export const createCourse = (data) => api.post("/academy/courses", data);
export const updateCourse = (id, data) => api.put(`/academy/courses/${id}`, data);
export const updateCourseStatus = (data) => api.put("/academy/academy/courses/status", data);
export const deleteCourse = (courseId) => api.delete(`/academy/courses/${courseId}`);
export const getCourseStats = () => api.get("/academy/courses/stats");

// ==================== دوره‌های خریداری شده ====================
export const getPurchasedCourses = (params) => api.get("/academy/purchased", { params });
export const getPurchasedStats = () => api.get("/academy/purchased/stats");

// ==================== آکادمی‌ها ====================
export const getAcademies = (params) => api.get("/academy/academies", { params });
export const getAcademyById = (id) => api.get(`/academy/academies/${id}`);
export const createAcademy = (data) => api.post("/academy/academies", data);
export const updateAcademy = (id, data) => api.put(`/academy/academies/${id}`, data);
export const updateAcademyStatus = (data) => api.put("/academy/academies/status", data);
export const deleteAcademy = (id) => api.delete(`/academy/academies/${id}`);
export const getAcademyStats = () => api.get("/academy/academies/stats");

// ==================== تنظیمات ====================
// مسیرهای قدیمی (برای سازگاری)
export const getSettings = () => api.get("/academy/settings/all");
export const updateSettings = (data) => api.put("/academy/settings/all", data);

// مسیرهای جدید (جداگانه)
export const getCoursePrices = () => api.get("/academy/settings/course-prices");
export const updateCoursePrice = (data) => api.put("/academy/settings/course-price", data);
export const getTax = () => api.get("/academy/settings/tax");
export const updateTax = (data) => api.put("/academy/settings/tax", data);
export const getAllSettings = () => api.get("/academy/settings/all");
export const updateAllSettings = (data) => api.put("/academy/settings/all", data);