Search in sources :

Example 6 with Product

use of com.salesmanager.core.model.catalog.product.Product in project shopizer by shopizer-ecommerce.

the class ProductFacadeImpl method updateProductQuantity.

@Override
public ReadableProduct updateProductQuantity(ReadableProduct product, int quantity, Language language) throws Exception {
    Product persistable = productService.getById(product.getId());
    if (persistable == null) {
        throw new Exception("product is null for id " + product.getId());
    }
    java.util.Set<ProductAvailability> availabilities = persistable.getAvailabilities();
    for (ProductAvailability availability : availabilities) {
        availability.setProductQuantity(quantity);
    }
    productService.update(persistable);
    ReadableProduct readableProduct = new ReadableProduct();
    ReadableProductPopulator populator = new ReadableProductPopulator();
    populator.setPricingService(pricingService);
    populator.setimageUtils(imageUtils);
    populator.populate(persistable, readableProduct, persistable.getMerchantStore(), language);
    return readableProduct;
}
Also used : ProductAvailability(com.salesmanager.core.model.catalog.product.availability.ProductAvailability) ReadableProductPopulator(com.salesmanager.shop.populator.catalog.ReadableProductPopulator) PersistableProduct(com.salesmanager.shop.model.catalog.product.PersistableProduct) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) Product(com.salesmanager.core.model.catalog.product.Product) LightPersistableProduct(com.salesmanager.shop.model.catalog.product.LightPersistableProduct) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) ServiceException(com.salesmanager.core.business.exception.ServiceException) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) OperationNotAllowedException(com.salesmanager.shop.store.api.exception.OperationNotAllowedException)

Example 7 with Product

use of com.salesmanager.core.model.catalog.product.Product in project shopizer by shopizer-ecommerce.

the class ShoppingOrderController method displayCheckout.

@SuppressWarnings("unused")
@RequestMapping("/checkout.html")
public String displayCheckout(@CookieValue("cart") String cookie, Model model, HttpServletRequest request, HttpServletResponse response, Locale locale) throws Exception {
    Language language = (Language) request.getAttribute("LANGUAGE");
    MerchantStore store = (MerchantStore) request.getAttribute(Constants.MERCHANT_STORE);
    Customer customer = (Customer) request.getSession().getAttribute(Constants.CUSTOMER);
    model.addAttribute("googleMapsKey", googleMapsKey);
    /**
     * Shopping cart
     *
     * ShoppingCart should be in the HttpSession
     * Otherwise the cart id is in the cookie
     * Otherwise the customer is in the session and a cart exist in the DB
     * Else -> Nothing to display
     */
    // check if an existing order exist
    ShopOrder order = null;
    order = super.getSessionAttribute(Constants.ORDER, request);
    // Get the cart from the DB
    String shoppingCartCode = (String) request.getSession().getAttribute(Constants.SHOPPING_CART);
    com.salesmanager.core.model.shoppingcart.ShoppingCart cart = null;
    if (StringUtils.isBlank(shoppingCartCode)) {
        if (cookie == null) {
            // session expired and cookie null, nothing to do
            return "redirect:/shop/cart/shoppingCart.html";
        }
        String[] merchantCookie = cookie.split("_");
        String merchantStoreCode = merchantCookie[0];
        if (!merchantStoreCode.equals(store.getCode())) {
            return "redirect:/shop/cart/shoppingCart.html";
        }
        shoppingCartCode = merchantCookie[1];
    }
    cart = shoppingCartFacade.getShoppingCartModel(shoppingCartCode, store);
    if (cart == null && customer != null) {
        cart = shoppingCartFacade.getShoppingCartModel(customer, store);
    }
    boolean allAvailables = true;
    boolean requiresShipping = false;
    boolean freeShoppingCart = true;
    // Filter items, delete unavailable
    Set<com.salesmanager.core.model.shoppingcart.ShoppingCartItem> availables = new HashSet<ShoppingCartItem>();
    if (cart == null) {
        return "redirect:/shop/cart/shoppingCart.html";
    }
    // Take out items no more available
    Set<com.salesmanager.core.model.shoppingcart.ShoppingCartItem> items = cart.getLineItems();
    for (com.salesmanager.core.model.shoppingcart.ShoppingCartItem item : items) {
        Long id = item.getProduct().getId();
        Product p = productService.getById(id);
        if (p.isAvailable()) {
            availables.add(item);
        } else {
            allAvailables = false;
        }
        FinalPrice finalPrice = pricingService.calculateProductPrice(p);
        if (finalPrice.getFinalPrice().longValue() > 0) {
            freeShoppingCart = false;
        }
        if (p.isProductShipeable()) {
            requiresShipping = true;
        }
    }
    cart.setLineItems(availables);
    if (!allAvailables) {
        shoppingCartFacade.saveOrUpdateShoppingCart(cart);
    }
    super.setSessionAttribute(Constants.SHOPPING_CART, cart.getShoppingCartCode(), request);
    if (shoppingCartCode == null && cart == null) {
        // error
        return "redirect:/shop/cart/shoppingCart.html";
    }
    if (customer != null) {
        if (cart.getCustomerId() != customer.getId().longValue()) {
            return "redirect:/shop/shoppingCart.html";
        }
    } else {
        customer = orderFacade.initEmptyCustomer(store);
        AnonymousCustomer anonymousCustomer = (AnonymousCustomer) request.getAttribute(Constants.ANONYMOUS_CUSTOMER);
        if (anonymousCustomer != null && anonymousCustomer.getBilling() != null) {
            Billing billing = customer.getBilling();
            billing.setCity(anonymousCustomer.getBilling().getCity());
            Map<String, Country> countriesMap = countryService.getCountriesMap(language);
            Country anonymousCountry = countriesMap.get(anonymousCustomer.getBilling().getCountry());
            if (anonymousCountry != null) {
                billing.setCountry(anonymousCountry);
            }
            Map<String, Zone> zonesMap = zoneService.getZones(language);
            Zone anonymousZone = zonesMap.get(anonymousCustomer.getBilling().getZone());
            if (anonymousZone != null) {
                billing.setZone(anonymousZone);
            }
            if (anonymousCustomer.getBilling().getPostalCode() != null) {
                billing.setPostalCode(anonymousCustomer.getBilling().getPostalCode());
            }
            customer.setBilling(billing);
        }
    }
    if (CollectionUtils.isEmpty(items)) {
        return "redirect:/shop/shoppingCart.html";
    }
    if (order == null) {
        // TODO
        order = orderFacade.initializeOrder(store, customer, cart, language);
    }
    /**
     * hook for displaying or not delivery address configuration
     */
    ShippingMetaData shippingMetaData = shippingService.getShippingMetaData(store);
    model.addAttribute("shippingMetaData", shippingMetaData);
    /**
     * shipping *
     */
    ShippingQuote quote = null;
    if (requiresShipping) {
        // System.out.println("** Berfore default shipping quote **");
        // Get all applicable shipping quotes
        quote = orderFacade.getShippingQuote(customer, cart, order, store, language);
        model.addAttribute("shippingQuote", quote);
    }
    if (quote != null) {
        String shippingReturnCode = quote.getShippingReturnCode();
        if (StringUtils.isBlank(shippingReturnCode) || shippingReturnCode.equals(ShippingQuote.NO_POSTAL_CODE)) {
            if (order.getShippingSummary() == null) {
                ShippingSummary summary = orderFacade.getShippingSummary(quote, store, language);
                order.setShippingSummary(summary);
                // TODO DTO
                request.getSession().setAttribute(Constants.SHIPPING_SUMMARY, summary);
            }
            if (order.getSelectedShippingOption() == null) {
                order.setSelectedShippingOption(quote.getSelectedShippingOption());
            }
            // save quotes in HttpSession
            List<ShippingOption> options = quote.getShippingOptions();
            // TODO DTO
            request.getSession().setAttribute(Constants.SHIPPING_OPTIONS, options);
            if (!CollectionUtils.isEmpty(options)) {
                for (ShippingOption shipOption : options) {
                    StringBuilder moduleName = new StringBuilder();
                    moduleName.append("module.shipping.").append(shipOption.getShippingModuleCode());
                    String carrier = messages.getMessage(moduleName.toString(), locale);
                    String note = messages.getMessage(moduleName.append(".note").toString(), locale, "");
                    shipOption.setDescription(carrier);
                    shipOption.setNote(note);
                    // option name
                    if (!StringUtils.isBlank(shipOption.getOptionCode())) {
                        // try to get the translate
                        StringBuilder optionCodeBuilder = new StringBuilder();
                        try {
                            optionCodeBuilder.append("module.shipping.").append(shipOption.getShippingModuleCode());
                            String optionName = messages.getMessage(optionCodeBuilder.toString(), locale);
                            shipOption.setOptionName(optionName);
                        } catch (Exception e) {
                            // label not found
                            LOGGER.warn("displayCheckout No shipping code found for " + optionCodeBuilder.toString());
                        }
                    }
                }
            }
        }
        if (quote.getDeliveryAddress() != null) {
            ReadableCustomerDeliveryAddressPopulator addressPopulator = new ReadableCustomerDeliveryAddressPopulator();
            addressPopulator.setCountryService(countryService);
            addressPopulator.setZoneService(zoneService);
            ReadableDelivery deliveryAddress = new ReadableDelivery();
            addressPopulator.populate(quote.getDeliveryAddress(), deliveryAddress, store, language);
            model.addAttribute("deliveryAddress", deliveryAddress);
            super.setSessionAttribute(Constants.KEY_SESSION_ADDRESS, deliveryAddress, request);
        }
        // get shipping countries
        List<Country> shippingCountriesList = orderFacade.getShipToCountry(store, language);
        model.addAttribute("countries", shippingCountriesList);
    } else {
        // get all countries
        List<Country> countries = countryService.getCountries(language);
        model.addAttribute("countries", countries);
    }
    if (quote != null && quote.getShippingReturnCode() != null && quote.getShippingReturnCode().equals(ShippingQuote.NO_SHIPPING_MODULE_CONFIGURED)) {
        LOGGER.error("Shipping quote error " + quote.getShippingReturnCode());
        model.addAttribute("errorMessages", messages.getMessage(quote.getShippingReturnCode(), locale, quote.getShippingReturnCode()));
    }
    if (quote != null && !StringUtils.isBlank(quote.getQuoteError())) {
        LOGGER.error("Shipping quote error " + quote.getQuoteError());
        model.addAttribute("errorMessages", quote.getQuoteError());
    }
    if (quote != null && quote.getShippingReturnCode() != null && quote.getShippingReturnCode().equals(ShippingQuote.NO_SHIPPING_TO_SELECTED_COUNTRY)) {
        LOGGER.error("Shipping quote error " + quote.getShippingReturnCode());
        model.addAttribute("errorMessages", quote.getShippingReturnCode());
    }
    /**
     * end shipping *
     */
    // get payment methods
    List<PaymentMethod> paymentMethods = paymentService.getAcceptedPaymentMethods(store);
    // not free and no payment methods
    if (CollectionUtils.isEmpty(paymentMethods) && !freeShoppingCart) {
        LOGGER.error("No payment method configured");
        model.addAttribute("errorMessages", messages.getMessage("payment.not.configured", locale, "No payments configured"));
    }
    if (!CollectionUtils.isEmpty(paymentMethods)) {
        // select default payment method
        PaymentMethod defaultPaymentSelected = null;
        for (PaymentMethod paymentMethod : paymentMethods) {
            if (paymentMethod.isDefaultSelected()) {
                defaultPaymentSelected = paymentMethod;
                break;
            }
        }
        if (defaultPaymentSelected == null) {
            // forced default selection
            defaultPaymentSelected = paymentMethods.get(0);
            defaultPaymentSelected.setDefaultSelected(true);
        }
        order.setDefaultPaymentMethodCode(defaultPaymentSelected.getPaymentMethodCode());
    }
    // readable shopping cart items for order summary box
    ShoppingCartData shoppingCart = shoppingCartFacade.getShoppingCartData(cart, language);
    model.addAttribute("cart", shoppingCart);
    order.setCartCode(shoppingCart.getCode());
    // order total
    OrderTotalSummary orderTotalSummary = orderFacade.calculateOrderTotal(store, order, language);
    order.setOrderTotalSummary(orderTotalSummary);
    // if order summary has to be re-used
    super.setSessionAttribute(Constants.ORDER_SUMMARY, orderTotalSummary, request);
    // display hacks
    if (!StringUtils.isBlank(googleMapsKey)) {
        model.addAttribute("fieldDisabled", "true");
        model.addAttribute("cssClass", "");
    } else {
        model.addAttribute("fieldDisabled", "false");
        model.addAttribute("cssClass", "required");
    }
    model.addAttribute("order", order);
    model.addAttribute("paymentMethods", paymentMethods);
    /**
     * template *
     */
    StringBuilder template = new StringBuilder().append(ControllerConstants.Tiles.Checkout.checkout).append(".").append(store.getStoreTemplate());
    return template.toString();
}
Also used : AnonymousCustomer(com.salesmanager.shop.model.customer.AnonymousCustomer) Customer(com.salesmanager.core.model.customer.Customer) PersistableCustomer(com.salesmanager.shop.model.customer.PersistableCustomer) OrderTotalSummary(com.salesmanager.core.model.order.OrderTotalSummary) AnonymousCustomer(com.salesmanager.shop.model.customer.AnonymousCustomer) Product(com.salesmanager.core.model.catalog.product.Product) ShoppingCartItem(com.salesmanager.core.model.shoppingcart.ShoppingCartItem) Language(com.salesmanager.core.model.reference.language.Language) ReadableCustomerDeliveryAddressPopulator(com.salesmanager.shop.populator.customer.ReadableCustomerDeliveryAddressPopulator) ShippingSummary(com.salesmanager.core.model.shipping.ShippingSummary) ReadableShippingSummary(com.salesmanager.shop.model.order.shipping.ReadableShippingSummary) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) HashSet(java.util.HashSet) FinalPrice(com.salesmanager.core.model.catalog.product.price.FinalPrice) Zone(com.salesmanager.core.model.reference.zone.Zone) ReadableDelivery(com.salesmanager.shop.model.customer.ReadableDelivery) ShoppingCartData(com.salesmanager.shop.model.shoppingcart.ShoppingCartData) ServiceException(com.salesmanager.core.business.exception.ServiceException) ShippingOption(com.salesmanager.core.model.shipping.ShippingOption) ShopOrder(com.salesmanager.shop.model.order.ShopOrder) ReadableShopOrder(com.salesmanager.shop.model.order.ReadableShopOrder) ShippingMetaData(com.salesmanager.core.model.shipping.ShippingMetaData) ShippingQuote(com.salesmanager.core.model.shipping.ShippingQuote) Billing(com.salesmanager.core.model.common.Billing) Country(com.salesmanager.core.model.reference.country.Country) PaymentMethod(com.salesmanager.core.model.payments.PaymentMethod) ShoppingCartItem(com.salesmanager.core.model.shoppingcart.ShoppingCartItem) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 8 with Product

use of com.salesmanager.core.model.catalog.product.Product in project shopizer by shopizer-ecommerce.

the class ProductVariantApi method calculateVariant.

/**
 * Calculates the price based on selected options if any
 * @param id
 * @param options
 * @param merchantStore
 * @param language
 * @param response
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/products/{id}/variant", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
@ApiOperation(httpMethod = "POST", value = "Get product price variation based on selected product", notes = "", produces = "application/json", response = ReadableProductPrice.class)
@ResponseBody
@ApiImplicitParams({ @ApiImplicitParam(name = "store", dataType = "String", defaultValue = "DEFAULT"), @ApiImplicitParam(name = "lang", dataType = "String", defaultValue = "en") })
public ReadableProductPrice calculateVariant(@PathVariable final Long id, @RequestBody ReadableSelectedProductVariant options, @ApiIgnore MerchantStore merchantStore, @ApiIgnore Language language, HttpServletResponse response) throws Exception {
    Product product = productService.getById(id);
    if (product == null) {
        response.sendError(404, "Product not fount for id " + id);
        return null;
    }
    List<ReadableProductVariantValue> ids = options.getOptions();
    if (CollectionUtils.isEmpty(ids)) {
        return null;
    }
    List<ReadableProductVariantValue> variants = options.getOptions();
    List<ProductAttribute> attributes = new ArrayList<ProductAttribute>();
    Set<ProductAttribute> productAttributes = product.getAttributes();
    for (ProductAttribute attribute : productAttributes) {
        Long option = attribute.getProductOption().getId();
        Long optionValue = attribute.getProductOptionValue().getId();
        for (ReadableProductVariantValue v : variants) {
            if (v.getOption().longValue() == option.longValue() && v.getValue().longValue() == optionValue.longValue()) {
                attributes.add(attribute);
            }
        }
    }
    FinalPrice price = pricingService.calculateProductPrice(product, attributes);
    ReadableProductPrice readablePrice = new ReadableProductPrice();
    ReadableFinalPricePopulator populator = new ReadableFinalPricePopulator();
    populator.setPricingService(pricingService);
    populator.populate(price, readablePrice, merchantStore, language);
    return readablePrice;
}
Also used : ArrayList(java.util.ArrayList) Product(com.salesmanager.core.model.catalog.product.Product) ProductAttribute(com.salesmanager.core.model.catalog.product.attribute.ProductAttribute) ReadableFinalPricePopulator(com.salesmanager.shop.populator.catalog.ReadableFinalPricePopulator) ReadableProductPrice(com.salesmanager.shop.model.catalog.product.ReadableProductPrice) ReadableProductVariantValue(com.salesmanager.shop.model.catalog.product.attribute.ReadableProductVariantValue) FinalPrice(com.salesmanager.core.model.catalog.product.price.FinalPrice) ApiImplicitParams(io.swagger.annotations.ApiImplicitParams) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 9 with Product

use of com.salesmanager.core.model.catalog.product.Product in project shopizer by shopizer-ecommerce.

the class LandingController method displayLanding.

@RequestMapping(value = { Constants.SHOP_URI + "/home.html", Constants.SHOP_URI + "/", Constants.SHOP_URI }, method = RequestMethod.GET)
public String displayLanding(Model model, HttpServletRequest request, HttpServletResponse response, Locale locale) throws Exception {
    Language language = (Language) request.getAttribute(Constants.LANGUAGE);
    MerchantStore store = (MerchantStore) request.getAttribute(Constants.MERCHANT_STORE);
    request.setAttribute(Constants.LINK_CODE, HOME_LINK_CODE);
    Content content = contentService.getByCode(LANDING_PAGE, store, language);
    /**
     * Rebuild breadcrumb *
     */
    BreadcrumbItem item = new BreadcrumbItem();
    item.setItemType(BreadcrumbItemType.HOME);
    item.setLabel(messages.getMessage(Constants.HOME_MENU_KEY, locale));
    item.setUrl(Constants.HOME_URL);
    Breadcrumb breadCrumb = new Breadcrumb();
    breadCrumb.setLanguage(language);
    List<BreadcrumbItem> items = new ArrayList<BreadcrumbItem>();
    items.add(item);
    breadCrumb.setBreadCrumbs(items);
    request.getSession().setAttribute(Constants.BREADCRUMB, breadCrumb);
    request.setAttribute(Constants.BREADCRUMB, breadCrumb);
    if (content != null) {
        ContentDescription description = content.getDescription();
        model.addAttribute("page", description);
        PageInformation pageInformation = new PageInformation();
        pageInformation.setPageTitle(description.getName());
        pageInformation.setPageDescription(description.getMetatagDescription());
        pageInformation.setPageKeywords(description.getMetatagKeywords());
        request.setAttribute(Constants.REQUEST_PAGE_INFORMATION, pageInformation);
    }
    ReadableProductPopulator populator = new ReadableProductPopulator();
    populator.setPricingService(pricingService);
    populator.setimageUtils(imageUtils);
    // featured items
    List<ProductRelationship> relationships = productRelationshipService.getByType(store, ProductRelationshipType.FEATURED_ITEM, language);
    List<ReadableProduct> featuredItems = new ArrayList<ReadableProduct>();
    Date today = new Date();
    for (ProductRelationship relationship : relationships) {
        Product product = relationship.getRelatedProduct();
        if (product.isAvailable() && DateUtil.dateBeforeEqualsDate(product.getDateAvailable(), today)) {
            ReadableProduct proxyProduct = populator.populate(product, new ReadableProduct(), store, language);
            featuredItems.add(proxyProduct);
        }
    }
    String tmpl = store.getStoreTemplate();
    if (StringUtils.isBlank(tmpl)) {
        tmpl = "generic";
    }
    model.addAttribute("featuredItems", featuredItems);
    /**
     * template *
     */
    StringBuilder template = new StringBuilder().append("landing.").append(tmpl);
    return template.toString();
}
Also used : BreadcrumbItem(com.salesmanager.shop.model.shop.BreadcrumbItem) ArrayList(java.util.ArrayList) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) Product(com.salesmanager.core.model.catalog.product.Product) Breadcrumb(com.salesmanager.shop.model.shop.Breadcrumb) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) Date(java.util.Date) Language(com.salesmanager.core.model.reference.language.Language) PageInformation(com.salesmanager.shop.model.shop.PageInformation) ReadableProductPopulator(com.salesmanager.shop.populator.catalog.ReadableProductPopulator) ProductRelationship(com.salesmanager.core.model.catalog.product.relationship.ProductRelationship) Content(com.salesmanager.core.model.content.Content) ContentDescription(com.salesmanager.core.model.content.ContentDescription) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 10 with Product

use of com.salesmanager.core.model.catalog.product.Product in project shopizer by shopizer-ecommerce.

the class CustomerProductReviewController method displayProductReview.

@PreAuthorize("hasRole('AUTH_CUSTOMER')")
@RequestMapping(value = "/review.html", method = RequestMethod.GET)
public String displayProductReview(@RequestParam Long productId, Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
    MerchantStore store = getSessionAttribute(Constants.MERCHANT_STORE, request);
    Language language = super.getLanguage(request);
    // get product
    Product product = productService.getById(productId);
    if (product == null) {
        return "redirect:" + Constants.SHOP_URI;
    }
    if (product.getMerchantStore().getId().intValue() != store.getId().intValue()) {
        return "redirect:" + Constants.SHOP_URI;
    }
    // create readable product
    ReadableProduct readableProduct = new ReadableProduct();
    ReadableProductPopulator readableProductPopulator = new ReadableProductPopulator();
    readableProductPopulator.setPricingService(pricingService);
    readableProductPopulator.setimageUtils(imageUtils);
    readableProductPopulator.populate(product, readableProduct, store, language);
    model.addAttribute("product", readableProduct);
    Customer customer = customerFacade.getCustomerByUserName(request.getRemoteUser(), store);
    List<ProductReview> reviews = productReviewService.getByProduct(product, language);
    for (ProductReview r : reviews) {
        if (r.getCustomer().getId().longValue() == customer.getId().longValue()) {
            ReadableProductReviewPopulator reviewPopulator = new ReadableProductReviewPopulator();
            ReadableProductReview rev = new ReadableProductReview();
            reviewPopulator.populate(r, rev, store, language);
            model.addAttribute("customerReview", rev);
            break;
        }
    }
    ProductReview review = new ProductReview();
    review.setCustomer(customer);
    review.setProduct(product);
    ReadableProductReview productReview = new ReadableProductReview();
    ReadableProductReviewPopulator reviewPopulator = new ReadableProductReviewPopulator();
    reviewPopulator.populate(review, productReview, store, language);
    model.addAttribute("review", productReview);
    model.addAttribute("reviews", reviews);
    /**
     * template *
     */
    StringBuilder template = new StringBuilder().append(ControllerConstants.Tiles.Customer.review).append(".").append(store.getStoreTemplate());
    return template.toString();
}
Also used : Language(com.salesmanager.core.model.reference.language.Language) ReadableProductPopulator(com.salesmanager.shop.populator.catalog.ReadableProductPopulator) Customer(com.salesmanager.core.model.customer.Customer) ReadableProductReview(com.salesmanager.shop.model.catalog.product.ReadableProductReview) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) Product(com.salesmanager.core.model.catalog.product.Product) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ReadableProductReview(com.salesmanager.shop.model.catalog.product.ReadableProductReview) ProductReview(com.salesmanager.core.model.catalog.product.review.ProductReview) PersistableProductReview(com.salesmanager.shop.model.catalog.product.PersistableProductReview) ReadableProductReviewPopulator(com.salesmanager.shop.populator.catalog.ReadableProductReviewPopulator) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Product (com.salesmanager.core.model.catalog.product.Product)120 ReadableProduct (com.salesmanager.shop.model.catalog.product.ReadableProduct)53 ArrayList (java.util.ArrayList)45 Language (com.salesmanager.core.model.reference.language.Language)42 MerchantStore (com.salesmanager.core.model.merchant.MerchantStore)41 ResourceNotFoundException (com.salesmanager.shop.store.api.exception.ResourceNotFoundException)36 ServiceException (com.salesmanager.core.business.exception.ServiceException)35 ServiceRuntimeException (com.salesmanager.shop.store.api.exception.ServiceRuntimeException)35 ProductAvailability (com.salesmanager.core.model.catalog.product.availability.ProductAvailability)33 ReadableProductPopulator (com.salesmanager.shop.populator.catalog.ReadableProductPopulator)33 PersistableProduct (com.salesmanager.shop.model.catalog.product.PersistableProduct)29 ProductAttribute (com.salesmanager.core.model.catalog.product.attribute.ProductAttribute)28 List (java.util.List)25 Date (java.util.Date)23 LightPersistableProduct (com.salesmanager.shop.model.catalog.product.LightPersistableProduct)22 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)21 Category (com.salesmanager.core.model.catalog.category.Category)20 Collectors (java.util.stream.Collectors)20 FinalPrice (com.salesmanager.core.model.catalog.product.price.FinalPrice)19 ConversionException (com.salesmanager.core.business.exception.ConversionException)17