import * as api from "../service/PaymentService";
import { useMutation, useQuery } from "@tanstack/react-query";

export const useGetPayments = (page: number = 1) => {
  return useQuery({
    queryKey: ["payments", page],
    queryFn: () => api.getPayments(page),
  });
};

export const useCreateFine = () => {
  return useMutation({
    mutationFn: api.createFine,
  });
};

export const useGetFines = () => {
  return useQuery({
    queryKey: ["fines"],
    queryFn: api.getFines,
  });
};
