Search in sources :

Example 1 with CartItem

use of io.github.zutherb.appstash.shop.repository.cart.model.CartItem in project the-app by devops-dojo.

the class RedisMicroserviceCartFulfillmentProviderImpl method addItem.

@Override
public CartItemInfo addItem(ProductInfo productInfo) {
    synchronized (lock) {
        CartItemInfo cartItemInfo = createCartItemInfo(productInfo);
        CartItem map = mapToCartItem(cartItemInfo);
        if (StringUtils.isEmpty(cartId)) {
            cartId = strip(cartRepository.create(map), "\"");
        } else {
            cartRepository.add(cartId, map);
        }
        return cartItemInfo;
    }
}
Also used : CartItemInfo(io.github.zutherb.appstash.shop.service.cart.model.CartItemInfo) CartItem(io.github.zutherb.appstash.shop.repository.cart.model.CartItem)

Aggregations

CartItem (io.github.zutherb.appstash.shop.repository.cart.model.CartItem)1 CartItemInfo (io.github.zutherb.appstash.shop.service.cart.model.CartItemInfo)1