import axios from "axios";
import { servicesConfig } from "$config/index.js";

const baseConfig = {
  timeout: 30000,
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
  },
};

const sepahBrokerServicesClient = axios.create({
  ...baseConfig,
  baseURL: servicesConfig.sepahBrokerConfig.rootUrl,
});

const sepahBrokerOtpClient = axios.create({
  ...baseConfig,
  baseURL: servicesConfig.sepahBrokerConfig.otpUrl,
});

const sepahBrokerGatewayClient = axios.create({
  ...baseConfig,
  baseURL: servicesConfig.sepahBrokerConfig.gatewayUrl,
});

const sepahBrokerClients = {
  services: sepahBrokerServicesClient,
  otp: sepahBrokerOtpClient,
  gateway: sepahBrokerGatewayClient,
};

export default sepahBrokerClients;
