import type {TableInput, TableOutput} from "@/models/table"; import type {Fund, FundTransaction} from "@/models/fund"; import useAxios from "@/utils/useAxios"; import type {Transaction} from "@/models/transaction"; export const getFundTable = async (tbl?: TableInput): Promise> => { return await useAxios.post>(`/customer/fund/table`, tbl) } export const getFundTransactionTable = async (tbl?: TableInput): Promise> => { return await useAxios.post>(`/customer/fund/transaction/table`, tbl) } export const getFundById = async (id: number) => await useAxios.get(`/customer/fund/${id}`) export const createFund = async (obj: Fund): Promise => { return await useAxios.post(`/customer/fund`, obj) } export const editFund = async (id: number, obj: Fund): Promise => { return await useAxios.put(`/customer/fund/${id}`, obj) } export const fundDeposit = async (obj: FundTransaction): Promise => { return await useAxios.post(`/customer/fund/deposit`, obj) } export const fundWithdraw = async (obj: FundTransaction): Promise => { return await useAxios.post(`/customer/fund/withdraw`, obj) } export const deleteFund = async (id?: number) => await useAxios.delete(`/customer/fund/${id}`)