User user = userService.getCurrentUser();
Map<String, OffersPerProduct> offersPerProduct = new HashMap<String, OffersPerProduct>();
ArticlesOAM oam = provider.get();
List<Offer> offers = oam.getOffers(user.getEmail());
for (Offer offer : offers) {
OffersPerProduct perProduct = new OffersPerProduct(
KeyFactory.keyToString(offer.getKey()),
KeyFactory.keyToString(offer.getProduct().getKey()),
offer.getProduct().getName(), convertToMap(offer.getProductOffered()));
offersPerProduct.put(perProduct.getOfferKey(), perProduct);
}
return new GetOffersResult(offersPerProduct);
}