Commit bd08c8c3 by Liv Haapala Committed by Liv Haapala

Adding reservable boolean to place and added feature to map that users can't sel…

…ect places that have reservable set to false. Also fixed a bug in HttpRequests so that they fetch domain from Host headers correctly and not only when the host header is first header.
1 parent dcfdb057
...@@ -26,6 +26,9 @@ import javax.ejb.EJB; ...@@ -26,6 +26,9 @@ import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped; import javax.enterprise.context.ConversationScoped;
import javax.inject.Named; import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.DiscountBeanLocal; import fi.codecrew.moya.beans.DiscountBeanLocal;
import fi.codecrew.moya.model.Discount; import fi.codecrew.moya.model.Discount;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
...@@ -38,6 +41,8 @@ public class ProductShopItemHelper extends GenericCDIView { ...@@ -38,6 +41,8 @@ public class ProductShopItemHelper extends GenericCDIView {
/** /**
* *
*/ */
private static final Logger logger = LoggerFactory.getLogger(ProductShopItemHelper.class);
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@EJB @EJB
...@@ -85,6 +90,7 @@ public class ProductShopItemHelper extends GenericCDIView { ...@@ -85,6 +90,7 @@ public class ProductShopItemHelper extends GenericCDIView {
if (limitValue != null) { if (limitValue != null) {
productsLeft = limitValue.subtract(item.getCount()); productsLeft = limitValue.subtract(item.getCount());
logger.debug("limitValue: {}", limitValue.toString());
if (productsLeft.compareTo(BigDecimal.ZERO) < 0) { if (productsLeft.compareTo(BigDecimal.ZERO) < 0) {
this.setProductShopItemCount(item, limitValue); this.setProductShopItemCount(item, limitValue);
...@@ -96,6 +102,9 @@ public class ProductShopItemHelper extends GenericCDIView { ...@@ -96,6 +102,9 @@ public class ProductShopItemHelper extends GenericCDIView {
return true; return true;
} }
} }
logger.debug("productsLeft: {}", productsLeft.toString());
item.setLimit(productsLeft); item.setLimit(productsLeft);
return false; return false;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!