import { api } from "@/lib/api-client";
import type { FeesPlan, StudentFeesDetail, FeesTerms } from "@/types/fees";
import type { PaginatedResponse, PaginationParams } from "@/types";

export const feesService = {
  async listFeesPlans(params?: PaginationParams): Promise<PaginatedResponse<FeesPlan>> {
    return api.get<PaginatedResponse<FeesPlan>>("/fees-plans", params as Record<string, string | number | boolean | undefined>);
  },

  async getFeesPlan(id: number): Promise<FeesPlan> {
    return api.get<FeesPlan>(`/fees-plans/${id}`);
  },

  async listStudentFees(params?: PaginationParams): Promise<PaginatedResponse<StudentFeesDetail>> {
    return api.get<PaginatedResponse<StudentFeesDetail>>("/student-fees", params as Record<string, string | number | boolean | undefined>);
  },

  async listFeesTerms(params?: PaginationParams): Promise<PaginatedResponse<FeesTerms>> {
    return api.get<PaginatedResponse<FeesTerms>>("/fees-terms", params as Record<string, string | number | boolean | undefined>);
  },
};
