Class DefaultCartHistoryService

java.lang.Object
com.broadleafcommerce.cartoperation.service.DefaultCartHistoryService
All Implemented Interfaces:
CartHistoryService

public class DefaultCartHistoryService extends Object implements CartHistoryService
Author:
Dima Myroniuk (dmyroniuk)
  • Field Details

    • HISTORICAL_STATUSES

      protected static final Set<String> HISTORICAL_STATUSES
  • Constructor Details

  • 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: CartHistoryService
      Find the cart and payments (if it exists) for the provided customer id and order number.
      Specified by:
      retrieveHistoricalCartByOrderNumber in interface CartHistoryService
      Parameters:
      customerId - the id of the customer who owns the cart
      orderNumber - the order number for the cart
      hydratePayments - if true, the payments for the cart will be added to the response
      contextInfo - 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: CartHistoryService
      Find the cart and payments (if it exists) for the provided customer id and cart id.
      Specified by:
      retrieveHistoricalCartByCartId in interface CartHistoryService
      Parameters:
      customer - the resolved CustomerRef for the customer requesting the cart
      cartId - the ID for the cart
      hydratePayments - if true, the payments for the cart will be added to the response
      contextInfo - 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: CartHistoryService
      Finds a single, historical cart for an anonymous customer.
      Specified by:
      retrieveHistoricalCartForAnonymousCustomer in interface CartHistoryService
      Parameters:
      emailAddress - The email address associated with the cart
      orderNumber - The historical cart's order number
      hydratePayments - if true, the payments for the cart will be added to the response
      contextInfo - 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: CartHistoryService
      Finds a single, historical cart for an anonymous customer.
      Specified by:
      retrieveHistoricalCartByIdForAnonymousCustomer in interface CartHistoryService
      Parameters:
      emailAddress - The email address associated with the cart
      cartId - The Cart.getId() historical cart's ID}
      hydratePayments - if true, the payments for the cart will be added to the response
      contextInfo - 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: CartHistoryService
      Retrieves all historical carts for a customer.
      Specified by:
      retrieveHistoricalCartsForCustomer in interface CartHistoryService
      Parameters:
      customer - the resolved CustomerRef for the customer requesting the carts
      startDate - first day of the range
      endDate - last day of the range
      page - Pagination information
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      a SimplePage of Carts
    • buildCartHistoryResponse

      protected CartHistoryResponse buildCartHistoryResponse(boolean hydratePayments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.cart.client.domain.Cart cart)
    • getCartProvider

      protected CartProvider getCartProvider()
    • getPaymentProvider

      protected PaymentProvider<PaymentSummary> getPaymentProvider()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getCartResolverService

      protected CartResolverService getCartResolverService()
    • setCartResolverService

      @Autowired public void setCartResolverService(CartResolverService cartResolverService)
    • getCustomerRefHandlerMethodArgumentResolver

      protected CustomerRefHandlerMethodArgumentResolver getCustomerRefHandlerMethodArgumentResolver()
    • setCustomerRefHandlerMethodArgumentResolver

      @Autowired public void setCustomerRefHandlerMethodArgumentResolver(CustomerRefHandlerMethodArgumentResolver customerRefHandlerMethodArgumentResolver)