import { LOG } from "@logger"; import axiosRequest from "../axios-request"; import type { PaymentCode } from "./Types"; const log = LOG.extend("transactions"); export interface Transaction { // biome-ignore lint/style/useNamingConvention: type_paiement: number; // biome-ignore lint/style/useNamingConvention: type_paiement_label: PaymentCode; marchand: string; // biome-ignore lint/style/useNamingConvention: marchand_name: string; service: string; montant: number; date: string; commentaire: string; etat: boolean; status: "SUCCESS" | "INITIATED" | "FAILED"; reference: string; // biome-ignore lint/style/useNamingConvention: transaction_id: number; // biome-ignore lint/style/useNamingConvention: marchand_code: string; } export const getTransactionsHistory = async (): Promise => { log.http("getTransactionsHistory"); try { const response = await axiosRequest({ url: "/transactions/", }); log.http("getTransactionsHistory |", JSON.stringify(response, null, 2)); return response; } catch (error) { log.error("getTransactionsHistory |", error); throw error; } };