Class DefaultCartHistoryService
java.lang.Object
com.broadleafcommerce.cartoperation.service.DefaultCartHistoryService
- All Implemented Interfaces:
CartHistoryService
- Author:
- Dima Myroniuk (dmyroniuk)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCartHistoryService(CartProvider cartProvider, PaymentProvider<PaymentSummary> paymentProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected CartHistoryResponsebuildCartHistoryResponse(boolean hydratePayments, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.cart.client.domain.Cart cart) protected CartProviderprotected CartResolverServiceprotected CustomerRefHandlerMethodArgumentResolverprotected PaymentProvider<PaymentSummary>protected com.broadleafcommerce.common.extension.TypeFactoryretrieveHistoricalCartByCartId(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer, @NonNull String cartId, boolean hydratePayments, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find the cart and payments (if it exists) for the provided customer id and cart id.retrieveHistoricalCartByIdForAnonymousCustomer(@NonNull String emailAddress, @NonNull String cartId, boolean hydratePayments, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds a single, historical cart for an anonymous customer.retrieveHistoricalCartByOrderNumber(@NonNull String customerId, @NonNull String orderNumber, boolean hydratePayments, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find the cart and payments (if it exists) for the provided customer id and order number.retrieveHistoricalCartForAnonymousCustomer(@NonNull String emailAddress, @NonNull String orderNumber, boolean hydratePayments, 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(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer, Date startDate, Date endDate, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves all historical carts for a customer.voidsetCartResolverService(CartResolverService cartResolverService) voidsetCustomerRefHandlerMethodArgumentResolver(CustomerRefHandlerMethodArgumentResolver customerRefHandlerMethodArgumentResolver)
-
Field Details
-
HISTORICAL_STATUSES
-
-
Constructor Details
-
DefaultCartHistoryService
public DefaultCartHistoryService(CartProvider cartProvider, PaymentProvider<PaymentSummary> paymentProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
retrieveHistoricalCartByOrderNumber
public CartHistoryResponse retrieveHistoricalCartByOrderNumber(@NonNull @NonNull String customerId, @NonNull @NonNull String orderNumber, boolean hydratePayments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartHistoryServiceFind the cart and payments (if it exists) for the provided customer id and order number.- Specified by:
retrieveHistoricalCartByOrderNumberin interfaceCartHistoryService- Parameters:
customerId- the id of the customer who owns the cartorderNumber- the order number for the carthydratePayments- if true, the payments for the cart will be added to the responsecontextInfo- Context information around sandbox and multitenant state.- Returns:
- a cart and payments (if it exists) with the given order number that belongs to the provided customer
-
retrieveHistoricalCartByCartId
public CartHistoryResponse retrieveHistoricalCartByCartId(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer, @NonNull @NonNull String cartId, boolean hydratePayments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartHistoryServiceFind the cart and payments (if it exists) for the provided customer id and cart id.- Specified by:
retrieveHistoricalCartByCartIdin interfaceCartHistoryService- Parameters:
customer- the resolvedCustomerReffor the customer requesting the cartcartId- the ID for the carthydratePayments- if true, the payments for the cart will be added to the responsecontextInfo- Context information around sandbox and multitenant state.- Returns:
- a cart and payments (if it exists) with the given order number that belongs to the provided customer
-
retrieveHistoricalCartForAnonymousCustomer
public CartHistoryResponse retrieveHistoricalCartForAnonymousCustomer(@NonNull @NonNull String emailAddress, @NonNull @NonNull String orderNumber, boolean hydratePayments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartHistoryServiceFinds a single, historical cart for an anonymous customer.- Specified by:
retrieveHistoricalCartForAnonymousCustomerin interfaceCartHistoryService- Parameters:
emailAddress- Theemail address associated with the cartorderNumber- Thehistorical cart's order numberhydratePayments- if true, the payments for the cart will be added to the responsecontextInfo- Context information around sandbox and multitenant state.- Returns:
- The single, historical cart for an anonymous customer
-
retrieveHistoricalCartByIdForAnonymousCustomer
public CartHistoryResponse retrieveHistoricalCartByIdForAnonymousCustomer(@NonNull @NonNull String emailAddress, @NonNull @NonNull String cartId, boolean hydratePayments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartHistoryServiceFinds a single, historical cart for an anonymous customer.- Specified by:
retrieveHistoricalCartByIdForAnonymousCustomerin interfaceCartHistoryService- Parameters:
emailAddress- Theemail address associated with the cartcartId- TheCart.getId()historical cart's ID}hydratePayments- if true, the payments for the cart will be added to the responsecontextInfo- Context information around sandbox and multitenant state.- Returns:
- The single, historical cart for an anonymous customer
-
retrieveHistoricalCartsForCustomer
public SimplePage<com.broadleafcommerce.cart.client.domain.Cart> retrieveHistoricalCartsForCustomer(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable Date startDate, @Nullable Date endDate, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartHistoryServiceRetrieves all historical carts for a customer.- Specified by:
retrieveHistoricalCartsForCustomerin interfaceCartHistoryService- Parameters:
customer- the resolvedCustomerReffor the customer requesting the cartsstartDate- first day of the rangeendDate- last day of the rangepage- Pagination informationcontextInfo- Context information around sandbox and multitenant state.- Returns:
- a
SimplePageofCarts
-
buildCartHistoryResponse
protected CartHistoryResponse buildCartHistoryResponse(boolean hydratePayments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.cart.client.domain.Cart cart) -
getCartProvider
-
getPaymentProvider
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCartResolverService
-
setCartResolverService
-
getCustomerRefHandlerMethodArgumentResolver
-
setCustomerRefHandlerMethodArgumentResolver
@Autowired public void setCustomerRefHandlerMethodArgumentResolver(CustomerRefHandlerMethodArgumentResolver customerRefHandlerMethodArgumentResolver)
-