Class DefaultReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
-
- com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
-
- com.broadleafcommerce.order.service.DefaultReturnAuthorizationService<P>
-
- Type Parameters:
P
- The projection domain type, a subtype ofReturnAuthorization
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
,ReturnAuthorizationService<P>
public class DefaultReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements ReturnAuthorizationService<P>
Default implementation ofReturnAuthorizationService
-
-
Constructor Summary
Constructors Constructor Description DefaultReturnAuthorizationService(ReturnAuthorizationRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<P>
createReturnAuthorizations(List<P> returnAuthorizations, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
protected ReturnAuthorizationRepository<com.broadleafcommerce.data.tracking.core.Trackable>
getRepository()
org.springframework.data.domain.Page<P>
readAllByOrderId(String orderId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve return authorizations for the given order ID.List<P>
readAllByOrderIdAndStatusNot(String orderId, String status, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads allReturnAuthorizations
byorderId
filtering out ones withstatus
.org.springframework.data.domain.Page<P>
readAllByOrderIds(Collection<String> orderIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve return authorizations for the given collection of order IDs.List<P>
replaceOrCreateAll(Collection<P> returnAuthorizations, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Replace all of the given return authorizations which already exist, or create them.protected List<P>
replaceReturnAuthorizations(List<P> returnAuthorizations, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
-
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
-
-
-
Constructor Detail
-
DefaultReturnAuthorizationService
public DefaultReturnAuthorizationService(ReturnAuthorizationRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
-
Method Detail
-
readAllByOrderId
public org.springframework.data.domain.Page<P> readAllByOrderId(String orderId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:ReturnAuthorizationService
Retrieve return authorizations for the given order ID.- Specified by:
readAllByOrderId
in interfaceReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
- Parameters:
orderId
- the ID of the order to search forfilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.page
- the requested page of results from the databasecontextInfo
- context information around sandbox and multitenant state- Returns:
- a page of the return authorizations associated with the given order ID
-
readAllByOrderIds
public org.springframework.data.domain.Page<P> readAllByOrderIds(Collection<String> orderIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:ReturnAuthorizationService
Retrieve return authorizations for the given collection of order IDs.- Specified by:
readAllByOrderIds
in interfaceReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
- Parameters:
orderIds
- the IDs of the orders to search forfilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.page
- the requested page of results from the databasecontextInfo
- context information around sandbox and multitenant state- Returns:
- a page of the return authorizations associated with the given order IDs
-
replaceOrCreateAll
@Transactional public List<P> replaceOrCreateAll(Collection<P> returnAuthorizations, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Description copied from interface:ReturnAuthorizationService
Replace all of the given return authorizations which already exist, or create them.- Specified by:
replaceOrCreateAll
in interfaceReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
- Parameters:
returnAuthorizations
- the return authorizations to replace or createcontext
- context information surrounding sandboxing and multitenant state- Returns:
- the replaced and created return authorizations
-
readAllByOrderIdAndStatusNot
public List<P> readAllByOrderIdAndStatusNot(String orderId, String status, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:ReturnAuthorizationService
Reads allReturnAuthorizations
byorderId
filtering out ones withstatus
.- Specified by:
readAllByOrderIdAndStatusNot
in interfaceReturnAuthorizationService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
- Parameters:
orderId
- ID of the parentOrder
status
- Status of the returns to filter bycontextInfo
- Additional sandbox and tenant info- Returns:
- All
ReturnAuthorizations
associated to the givenorderId
.
-
replaceReturnAuthorizations
protected List<P> replaceReturnAuthorizations(List<P> returnAuthorizations, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
createReturnAuthorizations
protected List<P> createReturnAuthorizations(List<P> returnAuthorizations, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
getRepository
protected ReturnAuthorizationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
- Overrides:
getRepository
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
-
-