import { api } from '..';

type MetricsByPortalProps = {
  nomeSistema: string;
  totalAcessos: number;
  horasLogadas: number;
};

type GetMetricsByPortalParams = {
  ano: number;
  cpf: string;
};

export async function getMetricsByPortal({
  ano,
  cpf,
}: GetMetricsByPortalParams): Promise<MetricsByPortalProps[]> {
  const { data } = await api.get(
    `/userAccessMetricsByPortal?ano=${ano}&cpf=${cpf}`,
  );

  return data;
}
