Class DefaultOrderHistoryService<O extends com.broadleafcommerce.order.client.domain.Order,​F extends com.broadleafcommerce.order.client.domain.OrderFulfillment,​R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>

    • Constructor Detail

      • DefaultOrderHistoryService

        public DefaultOrderHistoryService​(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils,
                                          com.broadleafcommerce.common.extension.TypeFactory typeFactory,
                                          OrderProvider<O> orderProvider,
                                          FulfillmentProvider<F> fulfillmentProvider,
                                          ReturnAuthorizationProvider<R> returnAuthorizationProvider)
    • Method Detail

      • readOrderHistoryForCustomer

        public org.springframework.data.domain.Page<OrderWithFulfillmentsAndReturns> readOrderHistoryForCustomer​(@Nullable
                                                                                                                 Integer days,
                                                                                                                 org.springframework.data.domain.Pageable page,
                                                                                                                 @Nullable
                                                                                                                 com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: OrderHistoryService
        Read all orders with its fulfillments and returns for the currently authenticated customer for the past number of days.
        Specified by:
        readOrderHistoryForCustomer in interface OrderHistoryService<O extends com.broadleafcommerce.order.client.domain.Order,​F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
        Parameters:
        days - The number of days to read order history
        page - the requested page of results from the database
        contextInfo - The current context
        Returns:
        The orders with the customer ID in the date range
      • readHistoricalOrdersForCustomer

        protected org.springframework.data.domain.Page<O> readHistoricalOrdersForCustomer​(@Nullable
                                                                                          Integer days,
                                                                                          org.springframework.data.domain.Pageable page,
                                                                                          @Nullable
                                                                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • buildOrderHistoryFilters

        protected cz.jirutka.rsql.parser.ast.Node buildOrderHistoryFilters​(String customerId,
                                                                           Instant start,
                                                                           Instant end)
      • readFulfillmentsIntoOrderHistory

        protected void readFulfillmentsIntoOrderHistory​(List<OrderWithFulfillmentsAndReturns> orderHistory,
                                                        List<String> orderIds,
                                                        @Nullable
                                                        com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • readReturnsIntoOrderHistory

        protected void readReturnsIntoOrderHistory​(List<OrderWithFulfillmentsAndReturns> orderHistory,
                                                   List<String> orderIds,
                                                   @Nullable
                                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • readOrderByIdOrNumber

        public OrderWithFulfillmentsAndReturns readOrderByIdOrNumber​(String orderRef,
                                                                     @Nullable
                                                                     com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: OrderHistoryService
        Retrieve the order with the given order reference (ID or order number) and its fulfillments and returns.
        Specified by:
        readOrderByIdOrNumber in interface OrderHistoryService<O extends com.broadleafcommerce.order.client.domain.Order,​F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
        Parameters:
        orderRef - The ID or number of the order to read
        contextInfo - The current context
        Returns:
        The order with the given ID and its fulfillments and returns.
      • getAuthenticationUtils

        protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
      • getTypeFactory

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