import axios from "../../../config/axios";
import {
  CreateLegalUserType,
  CreateRealUserType,
} from "../types/FinancialTypes";

export const createLegalUser = async (params: CreateLegalUserType) => {
  const { data } = await axios.post(`/users/legal`, params);
  return data;
};

export const createRealUser = async (params: CreateRealUserType) => {
  const { data } = await axios.post(`/users/real`, params);
  return data;
};

export const getProvines = async () => {
  const { data } = await axios.get(`/address/provinces/list?limit=50`);
  return data;
};

export const getCities = async (id: string) => {
  const { data } = await axios.get(`/address/provinces/${id}/cities?limit=50`);
  return data;
};

export const getFinancialInfo = async () => {
  const { data } = await axios.get(`/users/me/financial-info`);
  return data;
};

export const getLegalInfo = async () => {
  const { data } = await axios.get(`/users/legal`);
  return data;
};

export const getRealInfo = async () => {
  const { data } = await axios.get(`/users/real`);
  return data;
};
