Interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
-
- All Known Implementing Classes:
ExternalReturnAuthorizationProvider
public interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
Provider for interfacing with operations involving return authorizations. Typically utilizesWebClient
to make requests to an external REST API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description R
create(R returnAuthorization, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Creates aReturnAuthorization
.void
delete(String returnAuthorizationId, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deletes aReturnAuthorization
with the given ID.List<R>
readAllByOrderId(String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve all of theReturnAuthorizations
with the given order ID.R
readById(String returnAuthorizationId, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve theReturnAuthorization
with the given ID.Map<String,List<R>>
readByOrderIds(Set<String> orderIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
FetchesReturnAuthorization
s for a Set of order ids.R
replace(R returnAuthorization, String returnAuthorizationId, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Replace theReturnAuthorization
with the given ID.List<R>
replaceOrCreateAll(Collection<R> returnAuthorizations, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Replace all of the givenReturnAuthorizations
which already exist, or create them.
-
-
-
Method Detail
-
readAllByOrderId
List<R> readAllByOrderId(String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve all of theReturnAuthorizations
with the given order ID.- Parameters:
orderId
- the order ID of the return authorizations to retrievecontextInfo
- context information around sandbox and multitenant state.- Returns:
- the return authorizations with the given order ID
-
readById
R readById(String returnAuthorizationId, String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve theReturnAuthorization
with the given ID.- Parameters:
returnAuthorizationId
- the ID of the return authorization to retrieveorderId
- the ID of the order containing the return authorizationcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the return authorization with the given ID
-
create
R create(R returnAuthorization, String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Creates aReturnAuthorization
.- Parameters:
returnAuthorization
- the return authorization to replace withorderId
- the ID of the order containing the return authorizationcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the return authorization with the given ID
-
replace
R replace(R returnAuthorization, String returnAuthorizationId, String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Replace theReturnAuthorization
with the given ID.- Parameters:
returnAuthorization
- the return authorization to createreturnAuthorizationId
- the ID of the return authorization to retrieveorderId
- the ID of the order containing the return authorizationcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the return authorization with the given ID
-
delete
void delete(String returnAuthorizationId, String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deletes aReturnAuthorization
with the given ID.- Parameters:
returnAuthorizationId
- the ID of the return authorization to deleteorderId
- the ID of the order containing the return authorizationcontextInfo
- context information around sandbox and multitenant state.
-
replaceOrCreateAll
List<R> replaceOrCreateAll(Collection<R> returnAuthorizations, String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Replace all of the givenReturnAuthorizations
which already exist, or create them.- Parameters:
returnAuthorizations
- the return authorizations to replace or createorderId
- the ID of the order containing the return authorizationcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the replaced and created return authorizations
-
readByOrderIds
Map<String,List<R>> readByOrderIds(Set<String> orderIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
FetchesReturnAuthorization
s for a Set of order ids. Returns a map with the order id as the key and a list ofReturnAuthorization
s as the value.- Parameters:
orderIds
- Set of Order IDs.contextInfo
- Optional ContextInfo.- Returns:
- A map with Order ID as the key and a list of return authorizations as the value.
-
-