import { api } from "@/config/axios";
import {
  CouponsResponse,
  WalletResponse,
  TransactionsResponse,
} from "../types/Types";

export const getMyCoupons = async (): Promise<CouponsResponse> => {
  const { data } = await api.get<CouponsResponse>("/public/coupons/me");
  return data;
};

export const getUserWallet = async (): Promise<WalletResponse> => {
  const { data } = await api.get<WalletResponse>("/public/user/wallet");
  return data;
};

export const convertScoreToWallet = async () => {
  const { data } = await api.post("/public/user/convert-score-to-wallet");
  return data;
};

export const getTransactions = async (): Promise<TransactionsResponse> => {
  const { data } = await api.get<TransactionsResponse>("/public/payments");
  return data;
};
