import axios from "../../../config/axios";
import type {
  CreateFineType,
  PaymentResponse,
  GetFinesResponse,
} from "../types/Types";

export const getPayments = async (
  page: number = 1
): Promise<PaymentResponse> => {
  const { data } = await axios.get(`/admin/financial/payments?page=${page}`);
  return data;
};

export const createFine = async (params: CreateFineType) => {
  const { data } = await axios.post(`/admin/fine/rule`, params);
  return data;
};

export const getFines = async (): Promise<GetFinesResponse> => {
  const { data } = await axios.get(`/admin/fine/rule`);
  return data;
};
