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
ConstructorsConstructorDescriptionDefaultOrderFulfillmentItemService
(OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillmentService, ReturnAuthorizationService<com.broadleafcommerce.order.client.domain.ReturnAuthorization> returnAuthorizationService) -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.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.getItemsAlreadyInReturnTenantContext
(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, based on all records within the tenant context.protected OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment>
protected ReturnAuthorizationService<com.broadleafcommerce.order.client.domain.ReturnAuthorization>
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.readAllReturnableFulfillmentItemsForGroupTenantContext
(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.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.readAllReturnableFulfillmentItemsForOrderTenantContext
(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 Details
-
DefaultOrderFulfillmentItemService
public DefaultOrderFulfillmentItemService(OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillmentService, ReturnAuthorizationService<com.broadleafcommerce.order.client.domain.ReturnAuthorization> returnAuthorizationService)
-
-
Method Details
-
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.
-
readAllReturnableFulfillmentItemsForOrderTenantContext
public List<P> readAllReturnableFulfillmentItemsForOrderTenantContext(String orderId, 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.Calls to services like
ReturnAuthorizationService
andOrderFulfillmentService
differ from the standard narrowing behavior which only returns tenant-level (non-application-associated) records when fetching from a tenant context. This implementation involves all records within the tenant regardless of whether they're associated to an application.- Specified by:
readAllReturnableFulfillmentItemsForOrderTenantContext
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, based on all records within the tenant.
-
readAllReturnableFulfillmentItemsForGroupTenantContext
public List<P> readAllReturnableFulfillmentItemsForGroupTenantContext(String orderId, String orderFulfillmentId, 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.Calls to services like
ReturnAuthorizationService
andOrderFulfillmentService
differ from the standard narrowing behavior which only returns tenant-level (non-application-associated) records when fetching from a tenant context. This implementation involves all records within the tenant regardless of whether they're associated to an application.- Specified by:
readAllReturnableFulfillmentItemsForGroupTenantContext
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, based on all records within the tenant.
-
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.
-
getItemsAlreadyInReturnTenantContext
protected Map<String,Integer> getItemsAlreadyInReturnTenantContext(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, based on all records within the tenant context.- 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, based on all records within the tenant.
-
findReturnableItems
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()
-