Class DefaultRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.billing.service.impl.DefaultRefundEventService<P,Q>
- All Implemented Interfaces:
RefundEventService<P,,Q> com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
public class DefaultRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
implements RefundEventService<P,Q>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected BillingPropertiesprotected RefundEventItemService<RefundEventItem>protected com.broadleafcommerce.common.extension.TypeFactory -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRefundEventService(RefundEventRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionabortRefundEvent(String refundEventId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Pass the refundEventId and CurrencyCode to abort theJpaRefundEvententityprotected Map<RefundStatusEnum,Integer> buildWithDetails(List<P> refundEventList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected BigDecimalcalculateRefundEventTax(RefundEvent refundEvent, BillingEvent billingEvent) protected BigDecimalcreate(Q refundEventWithDetail, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Pass theRefundEventWithDetailsto create the @link RefundEvent} andRefundEventDetailentitiesreadAllByContextId(Iterable<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) readByBillingEventIds(Set<String> billingEventIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds Refund Events with Billing Event ID in the list of IDs.Pass theRefundEventId to find theJpaRefundEvententityreadWithDetailById(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Pass theRefundEventId to find theJpaRefundEvententityreadWithDetailsByBillingEventId(String billingEventId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Pass the billing event ID find all theJpaRefundEvententitiesreadWithDetailsByBillingEventIds(Set<String> billingEventIds, boolean deepFind, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds Refund Events Details with Billing Event ID in the list of IDs.protected QsetRefundStatusFromRefundDetails(Q refundEventDetailsPatch) updateRefundEventStatusFromRefundEventDetails(String refundEventId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidvalidateNewRefundValues(RefundEventWithDetails refundEvent, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidvalidateRefundAmount(RefundEventItem requestedRefundItem, BillingEventItem billingEventItem, List<BillingEventItemAdjustment> adjustments) protected voidvalidateRefundQuantity(RefundEventItem requestedRefundItem, BillingEventItem billingEventItem, List<RefundEventItem> existingRefundItems) Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from interface com.broadleafcommerce.billing.service.RefundEventService
abortRefundEvent, abortRefundEvent, createRefundEvent, findAllByBillingEventIds, findAllByBillingEventIds, findAllRefundsByBillingEventId, findById, findRefundEventByRefundId, updateRefundEvent, updateRefundEventStatusFromRefundEventDetails
-
Field Details
-
ABORTED
- See Also:
-
refundEventDetailService
@Autowired protected RefundEventDetailService<RefundEventDetail,RefundDetailsWithRefundAndBillingEvent> refundEventDetailService -
billingEventService
@Autowired protected BillingEventService<BillingEvent,BillingEventDTO, billingEventServiceCreateBillingEventRequest> -
refundEventItemService
-
billingEventItemService
@Autowired protected BillingEventItemService<BillingEventItem,BillingEventItemWithTaxDetails> billingEventItemService -
billingEventItemAdjustmentService
@Autowired protected BillingEventItemAdjustmentService<BillingEventItemAdjustment> billingEventItemAdjustmentService -
typeFactory
@Autowired protected com.broadleafcommerce.common.extension.TypeFactory typeFactory -
properties
-
-
Constructor Details
-
DefaultRefundEventService
@Autowired public DefaultRefundEventService(RefundEventRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
-
-
Method Details
-
readAllByContextId
@NonNull public Iterable<P> readAllByContextId(Iterable<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
readAllByContextIdin interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends RefundEvent>- Overrides:
readAllByContextIdin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends RefundEvent>
-
readWithDetailsByBillingEventId
public List<Q> readWithDetailsByBillingEventId(String billingEventId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventServicePass the billing event ID find all theJpaRefundEvententities- Specified by:
readWithDetailsByBillingEventIdin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
readById
public Optional<Q> readById(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventServicePass theRefundEventId to find theJpaRefundEvententity- Specified by:
readByIdin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
readWithDetailById
public Q readWithDetailById(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventServicePass theRefundEventId to find theJpaRefundEvententity- Specified by:
readWithDetailByIdin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
create
@Transactional(rollbackFor=InvalidRefundException.class) public Q create(Q refundEventWithDetail, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InvalidRefundException Description copied from interface:RefundEventServicePass theRefundEventWithDetailsto create the @link RefundEvent} andRefundEventDetailentities- Specified by:
createin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails> - Throws:
InvalidRefundException
-
update
@Transactional public Q update(Q withDetails, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventService- Specified by:
updatein interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
abortRefundEvent
@Transactional public Q abortRefundEvent(String refundEventId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventServicePass the refundEventId and CurrencyCode to abort theJpaRefundEvententity- Specified by:
abortRefundEventin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
updateRefundEventStatusFromRefundEventDetails
public P updateRefundEventStatusFromRefundEventDetails(String refundEventId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
updateRefundEventStatusFromRefundEventDetailsin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
readByBillingEventIds
public List<P> readByBillingEventIds(Set<String> billingEventIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventServiceFinds Refund Events with Billing Event ID in the list of IDs.- Specified by:
readByBillingEventIdsin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
readWithDetailsByBillingEventIds
public List<Q> readWithDetailsByBillingEventIds(Set<String> billingEventIds, boolean deepFind, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventServiceFinds Refund Events Details with Billing Event ID in the list of IDs.- Specified by:
readWithDetailsByBillingEventIdsin interfaceRefundEventService<P extends RefundEvent,Q extends RefundEventWithDetails>
-
buildWithDetails
-
setRefundStatusFromRefundDetails
-
validateNewRefundValues
protected void validateNewRefundValues(RefundEventWithDetails refundEvent, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InvalidRefundException - Throws:
InvalidRefundException
-
validateRefundQuantity
protected void validateRefundQuantity(RefundEventItem requestedRefundItem, BillingEventItem billingEventItem, List<RefundEventItem> existingRefundItems) throws InvalidRefundException - Throws:
InvalidRefundException
-
validateRefundAmount
protected void validateRefundAmount(RefundEventItem requestedRefundItem, BillingEventItem billingEventItem, List<BillingEventItemAdjustment> adjustments) throws InvalidRefundException - Throws:
InvalidRefundException
-
calculateRefundEventTax
-
calculateRefundEventTotal
-
buildStatusCountsMap
-