import { api } from "../utils/axiosClient";

const ExpenseRepository = {
  //#region Expense
  GetExpenseList: (pageSize, pageNumber, filter, searchString) => {
    const payloadJsonString = JSON.stringify(filter);
    return api.get(
      `/api/expense/list?pageSize=${pageSize}&pageNumber=${pageNumber}&filter=${payloadJsonString}&searchString=${searchString}`
    );
  },
  GetExpenseDetails: (id) => api.get(`/api/Expense/details/${id}`),
  CreateExpense: (data) => api.post("/api/Expense/create", data),
  UpdateExpense: (id, data) => api.put(`/api/Expense/edit/${id}`, data),
  DeleteExpense: (id) => api.delete(`/api/Expense/delete/${id}`),
  ActionOnExpense: (data) => api.post("/api/expense/action", data),
  GetExpenseFilter: () => api.get("/api/Expense/filter"),

  //#endregion



  //#region Payment Request
  GetPaymentRequestList: (
    pageSize,
    pageNumber,
    filter,
    isActive,
    searchString
  ) => {
    const payloadJsonString = JSON.stringify(filter);
    return api.get(
      `/api/Expense/get/payment-requests/list?isActive=${isActive}&pageSize=${pageSize}&pageNumber=${pageNumber}&filter=${payloadJsonString}&searchString=${searchString}`
    );
  },
  CreatePaymentRequest: (data) =>
    api.post("/api/expense/payment-request/create", data),
  UpdatePaymentRequest: (id, data) =>
    api.put(`/api/Expense/payment-request/edit/${id}`, data),
  GetPaymentRequest: (id) =>
    api.get(`/api/Expense/get/payment-request/details/${id}`),
  GetPaymentRequestFilter: () => api.get("/api/Expense/payment-request/filter"),
  ActionOnPaymentRequest: (data) =>
    api.post("/api/Expense/payment-request/action", data),
  DeletePaymentRequest: () => api.get("delete here come"),
  CreatePaymentRequestExpense: (data) =>
    api.post("/api/Expense/payment-request/expense/create", data),
  GetPayee: () => api.get('/api/Expense/payment-request/payee'),
  //#endregion



  //#region Recurring Expense
  GetRecurringExpenseList: (pageSize, pageNumber, filter, isActive, searchString) => {
    const payloadJsonString = JSON.stringify(filter);
    return api.get(
      `/api/expense/get/recurring-payment/list?pageSize=${pageSize}&pageNumber=${pageNumber}&filter=${payloadJsonString}&isActive=${isActive}&searchString=${searchString}`
    );
  },
  CreateRecurringExpense: (data) =>
    api.post("/api/Expense/recurring-payment/create", data),
  UpdateRecurringExpense: (id, data) =>
    api.put(`/api/Expense/recurring-payment/edit/${id}`, data),
  GetRecurringExpense: (id) =>
    api.get(`/api/Expense/get/recurring-payment/details/${id}`),
  //#endregion




  //#region Advance Payment
  GetTranctionList: (employeeId) =>
    api.get(`/api/Expense/get/transactions/${employeeId}`),
  getAllTranctionList: (searchString) =>
    api.get(`/api/Expense/get/advance-payment/employee/list?searchString=${searchString}`),
  //#endregion


};

export default ExpenseRepository;
