import { api } from '..';

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

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

export async function getMetricsBySystems({
  ano,
  cpf,
}: GetMetricsBySystemsParams): Promise<MetricsBySystemsProps[]> {
  const { data } = await api.get(
    `/userAccessMetricsBySystem?ano=${ano}&cpf=${cpf}`,
  );

  return data;
}
