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 ofOrderFulfillmentItems
that 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 aReturnAuthorization
along 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 allOrderFulfillmentItems
in the specifiedOrderFulfillment
for which aReturnAuthorization
can be made, i.e., those whose parentOrderFulfillment
has a status ofOrderFulfillmentStatus.FULFILLED
and are not already in a return.List<P>
readAllReturnableFulfillmentItemsForOrder(String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Returns a list of allOrderFulfillmentItems
for which aReturnAuthorization
can be made, i.e., those whose parentOrderFulfillments
have a status ofOrderFulfillmentStatus.FULFILLED
and 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:OrderFulfillmentItemService
Returns a list of allOrderFulfillmentItems
for which aReturnAuthorization
can be made, i.e., those whose parentOrderFulfillments
have a status ofOrderFulfillmentStatus.FULFILLED
and are not already in a return. This will also update the quantities on the items if any have been partially returned.- Specified by:
readAllReturnableFulfillmentItemsForOrder
in interfaceOrderFulfillmentItemService<P extends com.broadleafcommerce.order.client.domain.OrderFulfillmentItem>
- Parameters:
orderId
- ID of the parentOrder
contextInfo
- Additional sandbox and tenant info- Returns:
- Returns a list of all
OrderFulfillmentItems
for which aReturnAuthorization
can be made, i.e., those whose parentOrderFulfillments
have a status ofOrderFulfillmentStatus.FULFILLED
and 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:OrderFulfillmentItemService
Returns a list of allOrderFulfillmentItems
in the specifiedOrderFulfillment
for which aReturnAuthorization
can be made, i.e., those whose parentOrderFulfillment
has a status ofOrderFulfillmentStatus.FULFILLED
and are not already in a return. This will also update the quantities on the items if any have been partially returned.- Specified by:
readAllReturnableFulfillmentItemsForGroup
in interfaceOrderFulfillmentItemService<P extends com.broadleafcommerce.order.client.domain.OrderFulfillmentItem>
- Parameters:
orderId
- ID of the parentOrder
orderFulfillmentId
- ID of the parentOrderFulfillment
contextInfo
- Additional sandbox and tenant info- Returns:
- Returns a list of all
OrderFulfillmentItems
in the specifiedOrderFulfillment
for which aReturnAuthorization
can be made, i.e., those whose parentOrderFulfillment
has a status ofOrderFulfillmentStatus.FULFILLED
and 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 aReturnAuthorization
along 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
ReturnAuthorization
along 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 ofOrderFulfillmentItems
that 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 aReturnAuthorization
along with the quantity being returneditems
- List of candidate items from an entireOrder
or a singleOrderFulfillment
- Returns:
- Returns a list of
OrderFulfillmentItems
that 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()
-
-