Class DefaultOrderFulfillmentItemService<P extends com.broadleafcommerce.order.client.domain.OrderFulfillmentItem>
- java.lang.Object
-
- com.broadleafcommerce.order.service.DefaultOrderFulfillmentItemService<P>
-
- All Implemented Interfaces:
OrderFulfillmentItemService<P>
public class DefaultOrderFulfillmentItemService<P extends com.broadleafcommerce.order.client.domain.OrderFulfillmentItem> extends Object implements OrderFulfillmentItemService<P>
- Author:
- Nathan Moore (nathandmoore)
-
-
Constructor Summary
Constructors Constructor Description DefaultOrderFulfillmentItemService(OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillmentService, ReturnAuthorizationService<com.broadleafcommerce.order.client.domain.ReturnAuthorization> returnAuthorizationService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<P>findReturnableItems(Map<String,Integer> itemsAlreadyInReturn, Stream<P> items)Returns a list ofOrderFulfillmentItemsthat can be returned with their quantities adjusted to the amount that can still be returned in the case of partial returns already existing.protected Map<String,Integer>getItemsAlreadyInReturn(String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Returns a map of the IDs of items already included in aReturnAuthorizationalong with the quantity being returned since it may be a partial return.protected OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment>getOrderFulfillmentService()protected ReturnAuthorizationService<com.broadleafcommerce.order.client.domain.ReturnAuthorization>getReturnAuthorizationService()List<P>readAllReturnableFulfillmentItemsForGroup(String orderId, String orderFulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Returns a list of allOrderFulfillmentItemsin the specifiedOrderFulfillmentfor which aReturnAuthorizationcan be made, i.e., those whose parentOrderFulfillmenthas a status ofOrderFulfillmentStatus.FULFILLEDand are not already in a return.List<P>readAllReturnableFulfillmentItemsForOrder(String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Returns a list of allOrderFulfillmentItemsfor which aReturnAuthorizationcan be made, i.e., those whose parentOrderFulfillmentshave a status ofOrderFulfillmentStatus.FULFILLEDand are not already in a return.
-
-
-
Constructor Detail
-
DefaultOrderFulfillmentItemService
public DefaultOrderFulfillmentItemService(OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillmentService, ReturnAuthorizationService<com.broadleafcommerce.order.client.domain.ReturnAuthorization> returnAuthorizationService)
-
-
Method Detail
-
readAllReturnableFulfillmentItemsForOrder
public List<P> readAllReturnableFulfillmentItemsForOrder(String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:OrderFulfillmentItemServiceReturns a list of allOrderFulfillmentItemsfor which aReturnAuthorizationcan be made, i.e., those whose parentOrderFulfillmentshave a status ofOrderFulfillmentStatus.FULFILLEDand are not already in a return. This will also update the quantities on the items if any have been partially returned.- Specified by:
readAllReturnableFulfillmentItemsForOrderin interfaceOrderFulfillmentItemService<P extends com.broadleafcommerce.order.client.domain.OrderFulfillmentItem>- Parameters:
orderId- ID of the parentOrdercontextInfo- Additional sandbox and tenant info- Returns:
- Returns a list of all
OrderFulfillmentItemsfor which aReturnAuthorizationcan be made, i.e., those whose parentOrderFulfillmentshave a status ofOrderFulfillmentStatus.FULFILLEDand are not already in a return.
-
readAllReturnableFulfillmentItemsForGroup
public List<P> readAllReturnableFulfillmentItemsForGroup(String orderId, String orderFulfillmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:OrderFulfillmentItemServiceReturns a list of allOrderFulfillmentItemsin the specifiedOrderFulfillmentfor which aReturnAuthorizationcan be made, i.e., those whose parentOrderFulfillmenthas a status ofOrderFulfillmentStatus.FULFILLEDand are not already in a return. This will also update the quantities on the items if any have been partially returned.- Specified by:
readAllReturnableFulfillmentItemsForGroupin interfaceOrderFulfillmentItemService<P extends com.broadleafcommerce.order.client.domain.OrderFulfillmentItem>- Parameters:
orderId- ID of the parentOrderorderFulfillmentId- ID of the parentOrderFulfillmentcontextInfo- Additional sandbox and tenant info- Returns:
- Returns a list of all
OrderFulfillmentItemsin the specifiedOrderFulfillmentfor which aReturnAuthorizationcan be made, i.e., those whose parentOrderFulfillmenthas a status ofOrderFulfillmentStatus.FULFILLEDand are not already in a return.
-
getItemsAlreadyInReturn
protected Map<String,Integer> getItemsAlreadyInReturn(String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Returns a map of the IDs of items already included in aReturnAuthorizationalong with the quantity being returned since it may be a partial return.- Parameters:
orderId- ID of the parent ordercontextInfo- Additional sandbox and tenant info- Returns:
- Returns a map of the IDs of items already included in a
ReturnAuthorizationalong with the quantity being returned since it may be a partial return.
-
findReturnableItems
protected List<P> findReturnableItems(Map<String,Integer> itemsAlreadyInReturn, Stream<P> items)
Returns a list ofOrderFulfillmentItemsthat can be returned with their quantities adjusted to the amount that can still be returned in the case of partial returns already existing.- Parameters:
itemsAlreadyInReturn- Returns a map of the IDs of items already included in aReturnAuthorizationalong with the quantity being returneditems- List of candidate items from an entireOrderor a singleOrderFulfillment- Returns:
- Returns a list of
OrderFulfillmentItemsthat can be returned with their quantities adjusted to the amount that can still be returned.
-
getOrderFulfillmentService
protected OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> getOrderFulfillmentService()
-
getReturnAuthorizationService
protected ReturnAuthorizationService<com.broadleafcommerce.order.client.domain.ReturnAuthorization> getReturnAuthorizationService()
-
-