@Test public void testGetSkuPriceCartItemsPriceListAndSaleTaxInfoNet() throws Exception { final ShopService shopService = context.mock(ShopService.class, "shopService"); final ShoppingCart cart = context.mock(ShoppingCart.class, "cart"); final ShoppingContext cartCtx = context.mock(ShoppingContext.class, "cartCtx"); final Shop shop = context.mock(Shop.class, "shop"); final CartItem item = context.mock(CartItem.class, "item"); context.checking(new Expectations() {{ allowing(cart).getShoppingContext(); will(returnValue(cartCtx)); allowing(cartCtx).isHidePrices(); will(returnValue(false)); allowing(cartCtx).getShopId(); will(returnValue(234L)); allowing(cart).getCurrencyCode(); will(returnValue("EUR")); allowing(item).getProductSkuCode(); will(returnValue("ABC")); allowing(item).getQty(); will(returnValue(BigDecimal.TEN)); allowing(item).getListPrice(); will(returnValue(new BigDecimal("100.00"))); allowing(item).getSalePrice(); will(returnValue(new BigDecimal("80.00"))); allowing(item).getNetPrice(); will(returnValue(new BigDecimal("66.67"))); allowing(item).getGrossPrice(); will(returnValue(new BigDecimal("80.00"))); allowing(item).getPrice(); will(returnValue(new BigDecimal("80.00"))); allowing(item).getTaxRate(); will(returnValue(new BigDecimal("20.00"))); allowing(item).isTaxExclusiveOfPrice(); will(returnValue(false)); allowing(item).getTaxCode(); will(returnValue("VAT20")); allowing(shopService).getById(234L); will(returnValue(shop)); allowing(cartCtx).isTaxInfoEnabled(); will(returnValue(true)); allowing(cartCtx).isTaxInfoUseNet(); will(returnValue(true)); allowing(cartCtx).isTaxInfoShowAmount(); will(returnValue(false)); }}); final ProductServiceFacade facade = new ProductServiceFacadeImpl(null, null, null, null, null, null, null, null, null, null, null, shopService, null); final PriceModel modelPrice = facade.getSkuPrice(cart, item, false); assertNotNull(modelPrice); assertEquals("ABC", modelPrice.getRef()); assertEquals("EUR", modelPrice.getCurrency()); assertEquals("10", modelPrice.getQuantity().toPlainString()); assertEquals("83.33", modelPrice.getRegularPrice().toPlainString()); assertEquals("66.67", modelPrice.getSalePrice().toPlainString()); assertTrue(modelPrice.isTaxInfoEnabled()); assertTrue(modelPrice.isTaxInfoUseNet()); assertFalse(modelPrice.isTaxInfoShowAmount()); assertEquals("VAT20", modelPrice.getPriceTaxCode()); assertEquals("20.00", modelPrice.getPriceTaxRate().toPlainString()); assertFalse(modelPrice.isPriceTaxExclusive()); assertEquals("13.33", modelPrice.getPriceTax().toPlainString()); final PriceModel modelTotal = facade.getSkuPrice(cart, item, true); assertNotNull(modelTotal); assertEquals("ABC", modelTotal.getRef()); assertEquals("EUR", modelTotal.getCurrency()); assertEquals("10", modelTotal.getQuantity().toPlainString()); assertEquals("833.30", modelTotal.getRegularPrice().toPlainString()); assertEquals("666.70", modelTotal.getSalePrice().toPlainString()); assertTrue(modelTotal.isTaxInfoEnabled()); assertTrue(modelTotal.isTaxInfoUseNet()); assertFalse(modelTotal.isTaxInfoShowAmount()); assertEquals("VAT20", modelTotal.getPriceTaxCode()); assertEquals("20.00", modelTotal.getPriceTaxRate().toPlainString()); assertFalse(modelTotal.isPriceTaxExclusive()); assertEquals("133.30", modelTotal.getPriceTax().toPlainString()); context.assertIsSatisfied(); }
@Override public Pair<PriceModel, CustomerWishList.PriceChange> getSkuPrice(final ShoppingCart cart, final CustomerWishList item) { if (cart.getShoppingContext().isHidePrices()) { return new Pair<>( getNullProductPriceModel(cart.getCurrencyCode()), new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null) ); } final String sku = item.getSkuCode(); final String supplier = item.getSupplierCode(); final BigDecimal qty = item.getQuantity(); final SkuPrice priceNow = resolveMinimalPrice(cart, null, sku, qty, supplier); final String addedPriceCurr = item.getRegularPriceCurrencyWhenAdded(); final Pair<BigDecimal, BigDecimal> price; final CustomerWishList.PriceChange priceInfo; if (isPriceValid(priceNow)) { if (cart.getCurrencyCode().equals(addedPriceCurr)) { final BigDecimal addedPrice = item.getRegularPriceWhenAdded(); final Pair<BigDecimal, BigDecimal> listAndSale = priceNow.getSalePriceForCalculation(); final BigDecimal saleNow = MoneyUtils.secondOrFirst(listAndSale); if (MoneyUtils.isFirstEqualToSecond(addedPrice, saleNow)) { if (MoneyUtils.isFirstBiggerThanSecond(listAndSale.getFirst(), addedPrice)) { price = new Pair<>(listAndSale.getFirst(), addedPrice); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.ONSALE, MoneyUtils.getDiscountDisplayValue(listAndSale.getFirst(), addedPrice) ); } else { price = new Pair<>(addedPrice, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else if (MoneyUtils.isFirstBiggerThanSecond(addedPrice, saleNow)) { price = new Pair<>(addedPrice, saleNow); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.DECREASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow) ); } else if (MoneyUtils.isPositive(addedPrice)) { price = listAndSale; priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.INCRSEASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow).negate() ); } else { price = listAndSale; priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else { price = priceNow.getSalePriceForCalculation(); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.DIFFCURRENCY, null); } } else { price = new Pair<>(null, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.OFFLINE, null); } final PriceModel model = getSkuPrice( cart, sku, BigDecimal.ONE, priceNow.isPriceUponRequest(), priceNow.isPriceOnOffer(), price.getFirst(), price.getSecond(), supplier ); return new Pair<>(model, priceInfo); }
ProductServiceFacadeImpl implements ProductServiceFacade { @Override public Pair<PriceModel, CustomerWishList.PriceChange> getSkuPrice(final ShoppingCart cart, final CustomerWishList item) { if (cart.getShoppingContext().isHidePrices()) { return new Pair<>( getNullProductPriceModel(cart.getCurrencyCode()), new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null) ); } final String sku = item.getSkuCode(); final String supplier = item.getSupplierCode(); final BigDecimal qty = item.getQuantity(); final SkuPrice priceNow = resolveMinimalPrice(cart, null, sku, qty, supplier); final String addedPriceCurr = item.getRegularPriceCurrencyWhenAdded(); final Pair<BigDecimal, BigDecimal> price; final CustomerWishList.PriceChange priceInfo; if (isPriceValid(priceNow)) { if (cart.getCurrencyCode().equals(addedPriceCurr)) { final BigDecimal addedPrice = item.getRegularPriceWhenAdded(); final Pair<BigDecimal, BigDecimal> listAndSale = priceNow.getSalePriceForCalculation(); final BigDecimal saleNow = MoneyUtils.secondOrFirst(listAndSale); if (MoneyUtils.isFirstEqualToSecond(addedPrice, saleNow)) { if (MoneyUtils.isFirstBiggerThanSecond(listAndSale.getFirst(), addedPrice)) { price = new Pair<>(listAndSale.getFirst(), addedPrice); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.ONSALE, MoneyUtils.getDiscountDisplayValue(listAndSale.getFirst(), addedPrice) ); } else { price = new Pair<>(addedPrice, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else if (MoneyUtils.isFirstBiggerThanSecond(addedPrice, saleNow)) { price = new Pair<>(addedPrice, saleNow); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.DECREASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow) ); } else if (MoneyUtils.isPositive(addedPrice)) { price = listAndSale; priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.INCRSEASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow).negate() ); } else { price = listAndSale; priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else { price = priceNow.getSalePriceForCalculation(); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.DIFFCURRENCY, null); } } else { price = new Pair<>(null, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.OFFLINE, null); } final PriceModel model = getSkuPrice( cart, sku, BigDecimal.ONE, priceNow.isPriceUponRequest(), priceNow.isPriceOnOffer(), price.getFirst(), price.getSecond(), supplier ); return new Pair<>(model, priceInfo); } }
ProductServiceFacadeImpl implements ProductServiceFacade { @Override public Pair<PriceModel, CustomerWishList.PriceChange> getSkuPrice(final ShoppingCart cart, final CustomerWishList item) { if (cart.getShoppingContext().isHidePrices()) { return new Pair<>( getNullProductPriceModel(cart.getCurrencyCode()), new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null) ); } final String sku = item.getSkuCode(); final String supplier = item.getSupplierCode(); final BigDecimal qty = item.getQuantity(); final SkuPrice priceNow = resolveMinimalPrice(cart, null, sku, qty, supplier); final String addedPriceCurr = item.getRegularPriceCurrencyWhenAdded(); final Pair<BigDecimal, BigDecimal> price; final CustomerWishList.PriceChange priceInfo; if (isPriceValid(priceNow)) { if (cart.getCurrencyCode().equals(addedPriceCurr)) { final BigDecimal addedPrice = item.getRegularPriceWhenAdded(); final Pair<BigDecimal, BigDecimal> listAndSale = priceNow.getSalePriceForCalculation(); final BigDecimal saleNow = MoneyUtils.secondOrFirst(listAndSale); if (MoneyUtils.isFirstEqualToSecond(addedPrice, saleNow)) { if (MoneyUtils.isFirstBiggerThanSecond(listAndSale.getFirst(), addedPrice)) { price = new Pair<>(listAndSale.getFirst(), addedPrice); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.ONSALE, MoneyUtils.getDiscountDisplayValue(listAndSale.getFirst(), addedPrice) ); } else { price = new Pair<>(addedPrice, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else if (MoneyUtils.isFirstBiggerThanSecond(addedPrice, saleNow)) { price = new Pair<>(addedPrice, saleNow); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.DECREASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow) ); } else if (MoneyUtils.isPositive(addedPrice)) { price = listAndSale; priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.INCRSEASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow).negate() ); } else { price = listAndSale; priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else { price = priceNow.getSalePriceForCalculation(); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.DIFFCURRENCY, null); } } else { price = new Pair<>(null, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.OFFLINE, null); } final PriceModel model = getSkuPrice( cart, sku, BigDecimal.ONE, priceNow.isPriceUponRequest(), priceNow.isPriceOnOffer(), price.getFirst(), price.getSecond(), supplier ); return new Pair<>(model, priceInfo); } ProductServiceFacadeImpl(final ProductService productService,
                                    final ProductSkuService productSkuService,
                                    final ProductAssociationService productAssociationService,
                                    final SearchQueryFactory searchQueryFactory,
                                    final ProductAvailabilityStrategy productAvailabilityStrategy,
                                    final ProductQuantityStrategy productQuantityStrategy,
                                    final PricingPolicyProvider pricingPolicyProvider,
                                    final PriceResolver priceResolver,
                                    final ShoppingCartCalculator shoppingCartCalculator,
                                    final PromotionService promotionService,
                                    final CategoryServiceFacade categoryServiceFacade,
                                    final ShopService shopService,
                                    final BrandService brandService); }
ProductServiceFacadeImpl implements ProductServiceFacade { @Override public Pair<PriceModel, CustomerWishList.PriceChange> getSkuPrice(final ShoppingCart cart, final CustomerWishList item) { if (cart.getShoppingContext().isHidePrices()) { return new Pair<>( getNullProductPriceModel(cart.getCurrencyCode()), new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null) ); } final String sku = item.getSkuCode(); final String supplier = item.getSupplierCode(); final BigDecimal qty = item.getQuantity(); final SkuPrice priceNow = resolveMinimalPrice(cart, null, sku, qty, supplier); final String addedPriceCurr = item.getRegularPriceCurrencyWhenAdded(); final Pair<BigDecimal, BigDecimal> price; final CustomerWishList.PriceChange priceInfo; if (isPriceValid(priceNow)) { if (cart.getCurrencyCode().equals(addedPriceCurr)) { final BigDecimal addedPrice = item.getRegularPriceWhenAdded(); final Pair<BigDecimal, BigDecimal> listAndSale = priceNow.getSalePriceForCalculation(); final BigDecimal saleNow = MoneyUtils.secondOrFirst(listAndSale); if (MoneyUtils.isFirstEqualToSecond(addedPrice, saleNow)) { if (MoneyUtils.isFirstBiggerThanSecond(listAndSale.getFirst(), addedPrice)) { price = new Pair<>(listAndSale.getFirst(), addedPrice); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.ONSALE, MoneyUtils.getDiscountDisplayValue(listAndSale.getFirst(), addedPrice) ); } else { price = new Pair<>(addedPrice, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else if (MoneyUtils.isFirstBiggerThanSecond(addedPrice, saleNow)) { price = new Pair<>(addedPrice, saleNow); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.DECREASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow) ); } else if (MoneyUtils.isPositive(addedPrice)) { price = listAndSale; priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.INCRSEASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow).negate() ); } else { price = listAndSale; priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else { price = priceNow.getSalePriceForCalculation(); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.DIFFCURRENCY, null); } } else { price = new Pair<>(null, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.OFFLINE, null); } final PriceModel model = getSkuPrice( cart, sku, BigDecimal.ONE, priceNow.isPriceUponRequest(), priceNow.isPriceOnOffer(), price.getFirst(), price.getSecond(), supplier ); return new Pair<>(model, priceInfo); } ProductServiceFacadeImpl(final ProductService productService,
                                    final ProductSkuService productSkuService,
                                    final ProductAssociationService productAssociationService,
                                    final SearchQueryFactory searchQueryFactory,
                                    final ProductAvailabilityStrategy productAvailabilityStrategy,
                                    final ProductQuantityStrategy productQuantityStrategy,
                                    final PricingPolicyProvider pricingPolicyProvider,
                                    final PriceResolver priceResolver,
                                    final ShoppingCartCalculator shoppingCartCalculator,
                                    final PromotionService promotionService,
                                    final CategoryServiceFacade categoryServiceFacade,
                                    final ShopService shopService,
                                    final BrandService brandService); @Override ProductSku getSkuById(final Long skuId); @Override Product getProductById(final Long productId); @Override ProductSku getProductSkuBySkuCode(final String skuCode); @Override ProductAttributesModel getProductAttributes(final long productId,
                                                       final long skuId,
                                                       final long productTypeId); @Override ProductCompareModel getCompareAttributes(final List<Long> productId,
                                                    final List<Long> skuId); @Override @Cacheable(value = "productService-productAssociations") List<ProductSearchResultDTO> getProductAssociations(final long productId,
                                                               final long shopId,
                                                               final long customerShopId,
                                                               final String associationType); @Override @Cacheable(value = "productService-featuredProducts") List<ProductSearchResultDTO> getFeaturedProducts(final long categoryId,
                                                            final long shopId,
                                                            final long customerShopId); @Override @Cacheable(value = "productService-newProducts") List<ProductSearchResultDTO> getNewProducts(final long categoryId,
                                                       final long shopId,
                                                       final long customerShopId); @Override @Cacheable(value = "productService-taggedProducts") List<ProductSearchResultDTO> getTaggedProducts(final long categoryId,
                                                          final long shopId,
                                                          final long customerShopId,
                                                          final String tag); @Override List<ProductSearchResultDTO> getListProductSKUs(final List<String> SKUs,
                                                           final long categoryId,
                                                           final long shopId,
                                                           final long customerShopId); @Override List<ProductSearchResultDTO> getListProducts(final List<String> productIds,
                                                        final long categoryId,
                                                        final long shopId,
                                                        final long customerShopId); @Override ProductSearchResultPageDTO getListProducts(final NavigationContext context,
                                                      final int firstResult,
                                                      final int maxResults,
                                                      final String sortFieldName,
                                                      final boolean descendingSort); @Override ProductAvailabilityModel getProductAvailability(final ProductSearchResultDTO product,
                                                           final long customerShopId); @Override ProductAvailabilityModel getProductAvailability(final ProductSkuSearchResultDTO sku,
                                                           final long customerShopId); @Override ProductAvailabilityModel getProductAvailability(final Product product,
                                                           final long customerShopId,
                                                           final String supplier); @Override ProductAvailabilityModel getProductAvailability(final ProductSku product,
                                                           final long customerShopId,
                                                           final String supplier); @Override ProductAvailabilityModel getProductAvailability(final String skuCode,
                                                           final long customerShopId,
                                                           final String supplier); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final Product product,
                                            final long customerShopId,
                                            final String supplier); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final ProductSku product,
                                            final long customerShopId,
                                            final String supplier); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final ProductSearchResultDTO product,
                                            final long customerShopId); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final ProductSkuSearchResultDTO sku,
                                            final long customerShopId); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final String sku,
                                            final String supplier,
                                            final long customerShopId); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final String sku,
                                            final String supplier,
                                            final BigDecimal min,
                                            final BigDecimal max,
                                            final BigDecimal step,
                                            final long customerShopId); @Override Pair<PriceModel, CustomerWishList.PriceChange> getSkuPrice(final ShoppingCart cart,
                                                                      final CustomerWishList item); @Override PriceModel getSkuPrice(final ShoppingCart cart,
                                  final Long productId,
                                  final String skuCode,
                                  final BigDecimal quantity,
                                  final String supplier); @Override PriceModel getSkuPrice(final ShoppingCart cart,
                                  final String ref,
                                  final BigDecimal quantity,
                                  final BigDecimal listPrice,
                                  final BigDecimal salePrice,
                                  final String supplier); @Override PriceModel getSkuPrice(final ShoppingCart cart,
                                  final CartItem item,
                                  final boolean total); @Override PriceModel getSkuPrice(final String currency,
                                  final boolean showTax,
                                  final boolean showTaxNet,
                                  final boolean showTaxAmount,
                                  final CartItem item,
                                  final boolean total,
                                  final boolean hide); @Override List<PriceModel> getSkuPrices(final ShoppingCart cart,
                                         final Long productId,
                                         final String skuCode,
                                         final String supplier); @Override PriceModel getCartItemsTotal(final ShoppingCart cart); @Override Map<String, PromotionModel> getPromotionModel(final String appliedPromo); @Override Map<String, PromotionModel> getPromotionModel(final String appliedPromo, final boolean includeOffline); @Override Brand getBrandById(final long brandId); }
ProductServiceFacadeImpl implements ProductServiceFacade { @Override public Pair<PriceModel, CustomerWishList.PriceChange> getSkuPrice(final ShoppingCart cart, final CustomerWishList item) { if (cart.getShoppingContext().isHidePrices()) { return new Pair<>( getNullProductPriceModel(cart.getCurrencyCode()), new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null) ); } final String sku = item.getSkuCode(); final String supplier = item.getSupplierCode(); final BigDecimal qty = item.getQuantity(); final SkuPrice priceNow = resolveMinimalPrice(cart, null, sku, qty, supplier); final String addedPriceCurr = item.getRegularPriceCurrencyWhenAdded(); final Pair<BigDecimal, BigDecimal> price; final CustomerWishList.PriceChange priceInfo; if (isPriceValid(priceNow)) { if (cart.getCurrencyCode().equals(addedPriceCurr)) { final BigDecimal addedPrice = item.getRegularPriceWhenAdded(); final Pair<BigDecimal, BigDecimal> listAndSale = priceNow.getSalePriceForCalculation(); final BigDecimal saleNow = MoneyUtils.secondOrFirst(listAndSale); if (MoneyUtils.isFirstEqualToSecond(addedPrice, saleNow)) { if (MoneyUtils.isFirstBiggerThanSecond(listAndSale.getFirst(), addedPrice)) { price = new Pair<>(listAndSale.getFirst(), addedPrice); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.ONSALE, MoneyUtils.getDiscountDisplayValue(listAndSale.getFirst(), addedPrice) ); } else { price = new Pair<>(addedPrice, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else if (MoneyUtils.isFirstBiggerThanSecond(addedPrice, saleNow)) { price = new Pair<>(addedPrice, saleNow); priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.DECREASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow) ); } else if (MoneyUtils.isPositive(addedPrice)) { price = listAndSale; priceInfo = new CustomerWishList.PriceChange( CustomerWishList.PriceChangeType.INCRSEASED, MoneyUtils.getDiscountDisplayValue(addedPrice, saleNow).negate() ); } else { price = listAndSale; priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.NOCHANGE, null); } } else { price = priceNow.getSalePriceForCalculation(); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.DIFFCURRENCY, null); } } else { price = new Pair<>(null, null); priceInfo = new CustomerWishList.PriceChange(CustomerWishList.PriceChangeType.OFFLINE, null); } final PriceModel model = getSkuPrice( cart, sku, BigDecimal.ONE, priceNow.isPriceUponRequest(), priceNow.isPriceOnOffer(), price.getFirst(), price.getSecond(), supplier ); return new Pair<>(model, priceInfo); } ProductServiceFacadeImpl(final ProductService productService,
                                    final ProductSkuService productSkuService,
                                    final ProductAssociationService productAssociationService,
                                    final SearchQueryFactory searchQueryFactory,
                                    final ProductAvailabilityStrategy productAvailabilityStrategy,
                                    final ProductQuantityStrategy productQuantityStrategy,
                                    final PricingPolicyProvider pricingPolicyProvider,
                                    final PriceResolver priceResolver,
                                    final ShoppingCartCalculator shoppingCartCalculator,
                                    final PromotionService promotionService,
                                    final CategoryServiceFacade categoryServiceFacade,
                                    final ShopService shopService,
                                    final BrandService brandService); @Override ProductSku getSkuById(final Long skuId); @Override Product getProductById(final Long productId); @Override ProductSku getProductSkuBySkuCode(final String skuCode); @Override ProductAttributesModel getProductAttributes(final long productId,
                                                       final long skuId,
                                                       final long productTypeId); @Override ProductCompareModel getCompareAttributes(final List<Long> productId,
                                                    final List<Long> skuId); @Override @Cacheable(value = "productService-productAssociations") List<ProductSearchResultDTO> getProductAssociations(final long productId,
                                                               final long shopId,
                                                               final long customerShopId,
                                                               final String associationType); @Override @Cacheable(value = "productService-featuredProducts") List<ProductSearchResultDTO> getFeaturedProducts(final long categoryId,
                                                            final long shopId,
                                                            final long customerShopId); @Override @Cacheable(value = "productService-newProducts") List<ProductSearchResultDTO> getNewProducts(final long categoryId,
                                                       final long shopId,
                                                       final long customerShopId); @Override @Cacheable(value = "productService-taggedProducts") List<ProductSearchResultDTO> getTaggedProducts(final long categoryId,
                                                          final long shopId,
                                                          final long customerShopId,
                                                          final String tag); @Override List<ProductSearchResultDTO> getListProductSKUs(final List<String> SKUs,
                                                           final long categoryId,
                                                           final long shopId,
                                                           final long customerShopId); @Override List<ProductSearchResultDTO> getListProducts(final List<String> productIds,
                                                        final long categoryId,
                                                        final long shopId,
                                                        final long customerShopId); @Override ProductSearchResultPageDTO getListProducts(final NavigationContext context,
                                                      final int firstResult,
                                                      final int maxResults,
                                                      final String sortFieldName,
                                                      final boolean descendingSort); @Override ProductAvailabilityModel getProductAvailability(final ProductSearchResultDTO product,
                                                           final long customerShopId); @Override ProductAvailabilityModel getProductAvailability(final ProductSkuSearchResultDTO sku,
                                                           final long customerShopId); @Override ProductAvailabilityModel getProductAvailability(final Product product,
                                                           final long customerShopId,
                                                           final String supplier); @Override ProductAvailabilityModel getProductAvailability(final ProductSku product,
                                                           final long customerShopId,
                                                           final String supplier); @Override ProductAvailabilityModel getProductAvailability(final String skuCode,
                                                           final long customerShopId,
                                                           final String supplier); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final Product product,
                                            final long customerShopId,
                                            final String supplier); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final ProductSku product,
                                            final long customerShopId,
                                            final String supplier); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final ProductSearchResultDTO product,
                                            final long customerShopId); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final ProductSkuSearchResultDTO sku,
                                            final long customerShopId); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final String sku,
                                            final String supplier,
                                            final long customerShopId); @Override QuantityModel getProductQuantity(final BigDecimal cartQty,
                                            final String sku,
                                            final String supplier,
                                            final BigDecimal min,
                                            final BigDecimal max,
                                            final BigDecimal step,
                                            final long customerShopId); @Override Pair<PriceModel, CustomerWishList.PriceChange> getSkuPrice(final ShoppingCart cart,
                                                                      final CustomerWishList item); @Override PriceModel getSkuPrice(final ShoppingCart cart,
                                  final Long productId,
                                  final String skuCode,
                                  final BigDecimal quantity,
                                  final String supplier); @Override PriceModel getSkuPrice(final ShoppingCart cart,
                                  final String ref,
                                  final BigDecimal quantity,
                                  final BigDecimal listPrice,
                                  final BigDecimal salePrice,
                                  final String supplier); @Override PriceModel getSkuPrice(final ShoppingCart cart,
                                  final CartItem item,
                                  final boolean total); @Override PriceModel getSkuPrice(final String currency,
                                  final boolean showTax,
                                  final boolean showTaxNet,
                                  final boolean showTaxAmount,
                                  final CartItem item,
                                  final boolean total,
                                  final boolean hide); @Override List<PriceModel> getSkuPrices(final ShoppingCart cart,
                                         final Long productId,
                                         final String skuCode,
                                         final String supplier); @Override PriceModel getCartItemsTotal(final ShoppingCart cart); @Override Map<String, PromotionModel> getPromotionModel(final String appliedPromo); @Override Map<String, PromotionModel> getPromotionModel(final String appliedPromo, final boolean includeOffline); @Override Brand getBrandById(final long brandId);  }