Class DefaultRefundEventItemService<P extends RefundEventItem>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.billing.service.impl.DefaultRefundEventItemService<P>
- All Implemented Interfaces:
RefundEventItemService<P>,com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
public class DefaultRefundEventItemService<P extends RefundEventItem>
extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
implements RefundEventItemService<P>
- Author:
- Jacob Mitash
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRefundEventItemService(RefundEventItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptioncalculateRefundTotal(Collection<P> items) Calculates the total amount to refund for a collection of refund event items.calculateRefundTotal(P item) Calculates the total amount to refund for a single refund event item.voidcalculateTax(P refundEventItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Calculate and apply tax values for a refund event item based off of it's corresponding billing event item and refund amounts.readAllByContextId(Iterable<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) readByBillingEventItemId(String billingEventItemId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all refund event items belonging to a billing item.readByBillingEventItemIds(Set<String> billingEventItemIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all refund event items belonging to the billing items.readByRefundEventId(String refundEventId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all refund event items belonging to a refund event.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.RefundEventItemService
calculateTax, create, findByBillingItemId, findByBillingItemIds, findById, findByRefundId, update
-
Field Details
-
billingEventItemService
@Autowired protected BillingEventItemService<BillingEventItem,BillingEventItemWithTaxDetails> billingEventItemService -
itemAdjustmentService
@Autowired protected BillingEventItemAdjustmentService<BillingEventItemAdjustment> itemAdjustmentService -
properties
-
-
Constructor Details
-
DefaultRefundEventItemService
public DefaultRefundEventItemService(RefundEventItemRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
-
-
Method Details
-
readAllByContextId
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 RefundEventItem>- Overrides:
readAllByContextIdin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends RefundEventItem>
-
readByBillingEventItemId
public Set<P> readByBillingEventItemId(String billingEventItemId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventItemServiceFinds all refund event items belonging to a billing item.- Specified by:
readByBillingEventItemIdin interfaceRefundEventItemService<P extends RefundEventItem>
-
readByBillingEventItemIds
public Set<P> readByBillingEventItemIds(Set<String> billingEventItemIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventItemServiceFinds all refund event items belonging to the billing items.- Specified by:
readByBillingEventItemIdsin interfaceRefundEventItemService<P extends RefundEventItem>- Returns:
- refund event items belonging to the items
-
readByRefundEventId
public Set<P> readByRefundEventId(String refundEventId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventItemServiceFinds all refund event items belonging to a refund event.- Specified by:
readByRefundEventIdin interfaceRefundEventItemService<P extends RefundEventItem>- Returns:
- refund event items belonging to the refund event
-
calculateTax
public void calculateTax(P refundEventItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:RefundEventItemServiceCalculate and apply tax values for a refund event item based off of it's corresponding billing event item and refund amounts.- Specified by:
calculateTaxin interfaceRefundEventItemService<P extends RefundEventItem>
-
calculateRefundTotal
Description copied from interface:RefundEventItemServiceCalculates the total amount to refund for a collection of refund event items. This is essentially the sum ofRefundEventItemService.calculateRefundTotal(RefundEventItem)for every item in the collection.- Specified by:
calculateRefundTotalin interfaceRefundEventItemService<P extends RefundEventItem>- Parameters:
items- the items to calculate a refund total of- Returns:
- the total refund amount for the given items
-
calculateRefundTotal
Description copied from interface:RefundEventItemServiceCalculates the total amount to refund for a single refund event item.- Specified by:
calculateRefundTotalin interfaceRefundEventItemService<P extends RefundEventItem>- Parameters:
item- the item to calculate the refund total of- Returns:
- the total refund amount for the given item
-