Interface CartProvider
-
- All Known Implementing Classes:
ExternalCartProvider
public interface CartProviderProvider for interfacing with operations directly involving aCart. Typically utilizesWebClientto make requests to an external REST API.- Author:
- Chad Harchar (charchar)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description com.broadleafcommerce.cart.client.domain.CartcreateCart(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Create a new cart.com.broadleafcommerce.cart.client.domain.CartcreateNonRequestCart(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Create a new cart, without updating the original request cart.voiddeleteCartItem(String cartId, com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Deprecated.in favor of updating the entire cart withupdateCart(Cart, ContextInfo)com.broadleafcommerce.cart.client.domain.CartpatchCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Patch the cart.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCartById(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the cart.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCartByOrderNumber(String customerId, String orderNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Find the cart (if it exists) for the provided customer id and order number.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCsrOwnedCart(String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve theDefaultCartStatuses.CSR_OWNEDcart for the provided customer.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCustomerCartByStatus(String customerId, String status, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Finds a cart with the given status belonging to the provided customer.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveHistoricalCartForAnonymousCustomer(String emailAddress, String orderNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Finds a single, historical cart for an anonymous customer.SimplePage<com.broadleafcommerce.cart.client.domain.Cart>retrieveHistoricalCartsForCustomer(String customerId, Date startDate, Date endDate, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Find all carts notDefaultCartStatuses.IN_PROCESS,DefaultCartStatuses.CSR_OWNED, orDefaultCartStatuses.NAMEDfor the provided customer and dates.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveInProcessCart(String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve theDefaultCartStatuses.IN_PROCESScart for the provided customer.com.broadleafcommerce.cart.client.domain.CartupdateCart(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Update the cart.com.broadleafcommerce.cart.client.domain.CartItemupdateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Deprecated.in favor of updating the entire cart withupdateCart(Cart, ContextInfo)
-
-
-
Method Detail
-
retrieveInProcessCart
Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveInProcessCart(String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve theDefaultCartStatuses.IN_PROCESScart for the provided customer.- Parameters:
customerId- The id of the customer for which we are attempting to find anDefaultCartStatuses.IN_PROCESScart.contextInfo- Context information around sandbox and multitenant state.- Returns:
- Retrieve the
DefaultCartStatuses.IN_PROCESScart for the provided customer.
-
retrieveCsrOwnedCart
Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCsrOwnedCart(String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve theDefaultCartStatuses.CSR_OWNEDcart for the provided customer.- Parameters:
customerId- The id of the customer for which we are attempting to find anDefaultCartStatuses.CSR_OWNEDcart.contextInfo- Context information around sandbox and multitenant state.- Returns:
- Retrieve the
DefaultCartStatuses.CSR_OWNEDcart for the provided customer.
-
retrieveCustomerCartByStatus
Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCustomerCartByStatus(String customerId, String status, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Finds a cart with the given status belonging to the provided customer.- Parameters:
customerId- the customer IDstatus- the statuscontextInfo- the context info- Returns:
- a cart if it exists
-
retrieveCartByOrderNumber
Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartByOrderNumber(String customerId, String orderNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find the cart (if it exists) for the provided customer id and order number.- Parameters:
customerId- the id of the customer who owns the cartorderNumber- the order number for the cartcontextInfo- Context information around sandbox and multitenant state.- Returns:
- a cart (if it exists) with the given order number that belongs to the provided customer
-
retrieveHistoricalCartsForCustomer
SimplePage<com.broadleafcommerce.cart.client.domain.Cart> retrieveHistoricalCartsForCustomer(String customerId, @Nullable Date startDate, @Nullable Date endDate, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find all carts notDefaultCartStatuses.IN_PROCESS,DefaultCartStatuses.CSR_OWNED, orDefaultCartStatuses.NAMEDfor the provided customer and dates.- Parameters:
customerId- the id of the customer who owns the cartsstartDate- the starting date to filter carts byendDate- the ending date to filter carts bypage- the requested page of results from the databasecontextInfo- Context information around sandbox and multitenant state.- Returns:
- all carts not
DefaultCartStatuses.IN_PROCESSorDefaultCartStatuses.NAMEDfor the provided customer and dates.
-
retrieveHistoricalCartForAnonymousCustomer
Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveHistoricalCartForAnonymousCustomer(String emailAddress, String orderNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Finds a single, historical cart for an anonymous customer.- Parameters:
emailAddress- Theemail address associated with the cartorderNumber- Thehistorical cart's order numbercontextInfo- Context information around sandbox and multitenant state.- Returns:
- The single, historical cart for an anonymous customer
-
retrieveCartById
Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartById(String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve the cart.- Parameters:
cartId- The id of the cart on which to perform the operation.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The cart for the provided id.
-
createNonRequestCart
com.broadleafcommerce.cart.client.domain.Cart createNonRequestCart(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Create a new cart, without updating the original request cart.- Parameters:
cart- The cart to createcontextInfo- Context information around sandbox and multitenant state.- Returns:
- The created cart.
-
createCart
com.broadleafcommerce.cart.client.domain.Cart createCart(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Create a new cart.- Parameters:
cart- The cart to createcontextInfo- Context information around sandbox and multitenant state.- Returns:
- The created cart.
-
updateCart
com.broadleafcommerce.cart.client.domain.Cart updateCart(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Update the cart.- Parameters:
cart- The cart on which to perform the operation.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The updated cart.
-
patchCart
com.broadleafcommerce.cart.client.domain.Cart patchCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Patch the cart. A patch does not replace the cart, but partially updates it using any non-null fields.- Parameters:
cart- The cart on which to perform the operation.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The patched cart.
-
updateCartItem
@Deprecated com.broadleafcommerce.cart.client.domain.CartItem updateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.in favor of updating the entire cart withupdateCart(Cart, ContextInfo)Update the cart item.- Parameters:
cart- the cart the item belongs tocartItem- The cart item on which to perform the operation.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The updated cart item.
-
deleteCartItem
@Deprecated void deleteCartItem(String cartId, com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.in favor of updating the entire cart withupdateCart(Cart, ContextInfo)Delete the cart item.- Parameters:
cartId- the ID of the card the item belongs tocartItem- The cart item on which to perform the operation.contextInfo- Context information around sandbox and multitenant state.
-
-