import { httpGetRequest, httpPutRequest, httpPostRequest, APIUrlGenerator } from "@/utils/baseHttpService";
import { API_ROUTES } from "@/constant/routes";
import { WalletStatusResponse, UpdateWalletStatusRequest, UpdateWalletStatusResponse } from "./_models";
import { WalletCreditRequest, WalletCreditResponse } from "./_credit-models";

export const getWalletStatus = async (): Promise<WalletStatusResponse> => {
  const response = await httpGetRequest<WalletStatusResponse>(
    APIUrlGenerator(API_ROUTES.GET_WALLET_STATUS)
  );
  return response.data;
};

export const updateWalletStatus = async (
  payload: UpdateWalletStatusRequest
): Promise<UpdateWalletStatusResponse> => {
  const response = await httpPutRequest<UpdateWalletStatusResponse>(
    APIUrlGenerator(API_ROUTES.UPDATE_WALLET_STATUS),
    payload
  );
  return response.data;
};

export const creditWallet = async (
  payload: WalletCreditRequest
): Promise<WalletCreditResponse> => {
  const response = await httpPostRequest<WalletCreditResponse>(
    APIUrlGenerator(API_ROUTES.WALLET_CREDIT),
    payload
  );
  return response.data;
};







