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>
- java.lang.Object
-
- com.broadleafcommerce.orderoperation.service.DefaultOrderHistoryService<O,F,R>
-
- All Implemented Interfaces:
OrderHistoryService<O,OrderWithFulfillmentsAndReturns>
public 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> extends Object implements OrderHistoryService<O,OrderWithFulfillmentsAndReturns>
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
CUSTOMER_ID
protected static String
ORDER_ID
protected static String
SUBMIT_DATE
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected cz.jirutka.rsql.parser.ast.Node
buildOrderHistoryFilters(String customerId, Instant start, Instant end)
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
getAuthenticationUtils()
protected FulfillmentProvider<F>
getFulfillmentProvider()
protected OrderProvider<O>
getOrderProvider()
protected ReturnAuthorizationProvider<R>
getReturnAuthorizationProvider()
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
protected void
readFulfillmentsIntoOrderHistory(List<OrderWithFulfillmentsAndReturns> orderHistory, List<String> orderIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected org.springframework.data.domain.Page<O>
readHistoricalOrdersForCustomer(Integer days, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
OrderWithFulfillmentsAndReturns
readOrderByIdOrNumber(String orderRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve the order with the given order reference (ID or order number) and its fulfillments and returns.org.springframework.data.domain.Page<OrderWithFulfillmentsAndReturns>
readOrderHistoryForCustomer(Integer days, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Read all orders with its fulfillments and returns for the currently authenticated customer for the past number of days.protected void
readReturnsIntoOrderHistory(List<OrderWithFulfillmentsAndReturns> orderHistory, List<String> orderIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
-
-
Field Detail
-
CUSTOMER_ID
protected static final String CUSTOMER_ID
- See Also:
- Constant Field Values
-
SUBMIT_DATE
protected static final String SUBMIT_DATE
- See Also:
- Constant Field Values
-
ORDER_ID
protected static final String ORDER_ID
- See Also:
- Constant Field Values
-
-
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 interfaceOrderHistoryService<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 historypage
- the requested page of results from the databasecontextInfo
- 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 interfaceOrderHistoryService<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 readcontextInfo
- 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()
-
getOrderProvider
protected OrderProvider<O> getOrderProvider()
-
getFulfillmentProvider
protected FulfillmentProvider<F> getFulfillmentProvider()
-
getReturnAuthorizationProvider
protected ReturnAuthorizationProvider<R> getReturnAuthorizationProvider()
-
-