Commit 1802125e by G

transactions history query and type

parent 17c764b4
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: <api response>
type_paiement: number;
// biome-ignore lint/style/useNamingConvention: <api response>
type_paiement_label: PaymentCode;
marchand: string;
// biome-ignore lint/style/useNamingConvention: <api response>
marchand_name: string;
service: string;
montant: number;
date: string;
commentaire: string;
etat: boolean;
status: "SUCCESS" | "INITIATED" | "FAILED";
reference: string;
// biome-ignore lint/style/useNamingConvention: <api response>
transaction_id: number;
// biome-ignore lint/style/useNamingConvention: <api response>
marchand_code: string;
}
export const getTransactionsHistory = async (): Promise<Transaction[]> => {
log.http("getTransactionsHistory");
try {
const response = await axiosRequest<Transaction[]>({
url: "/transactions/",
});
log.http("getTransactionsHistory |", JSON.stringify(response, null, 2));
return response;
} catch (error) {
log.error("getTransactionsHistory |", error);
throw error;
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment