@Override
  public PurchaseDetails[] getDetailsByPurchaseIds(
      Integer max, Integer offset, List<Long> purchaseIds) throws RequestException {
    Map requestVariables = paginationMapFactory.create(max, offset);
    requestVariables.put("purchaseIds", purchaseIds.toString());

    ResponseEntity<PurchaseDetails[]> responseEntity =
        restTemplate.getForEntity(
            urlGetDetailsPurchases, PurchaseDetails[].class, requestVariables);

    if (responseEntity.getStatusCode() != HttpStatus.OK) {
      throw new RequestException("Could not load the details purchase list");
    }

    return responseEntity.getBody();
  }
  @Override
  public Purchase[] getPurchasesByCompanyId(Integer max, Integer offset, Long comapanyId)
      throws RequestException {
    Map requestVariables = paginationMapFactory.create(max, offset);
    requestVariables.put("comapanyId", comapanyId.toString());

    ResponseEntity<Purchase[]> responseEntity =
        restTemplate.getForEntity(
            urlGetCompanyPurchases, Purchase[].class, requestVariables, comapanyId);

    if (responseEntity.getStatusCode() != HttpStatus.OK) {
      throw new RequestException("Could not load the purchase list");
    }

    return responseEntity.getBody();
  }