Interface PriceListService<P extends PriceList>
-
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
- All Known Implementing Classes:
DefaultPriceListService
public interface PriceListService<P extends PriceList> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Base service API forPriceList
s. Backed by aPriceListRepository
.- Author:
- Chad Harchar (charchar), Nathan Moore (nathanmoore)
- See Also:
DefaultPriceListService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.broadleafcommerce.pricing.client.domain.PriceListRef
convertPriceListToPriceListRef(PriceList priceList)
Create a lightweight PriceListRef from a PriceList object.List<P>
readAllByCurrencyIn(List<javax.money.CurrencyUnit> currencies, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads all price lists targeting the given currency.org.springframework.data.domain.Page<P>
readAllByIds(Iterable<String> id, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
org.springframework.data.domain.Page<P>
readAllByName(String name, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
List<P>
readAllByPriceRefs(Collection<com.broadleafcommerce.pricing.client.domain.PriceListRef> priceListRefs, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Returns list of PriceLists for the provided priceListRefs.org.springframework.data.domain.Page<P>
readAllByType(String type, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
org.springframework.data.domain.Page<P>
readAllByTypeAndName(String type, String name, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
List<P>
readAllByUserTargetsIn(Iterable<UserTarget> userTargets, List<javax.money.CurrencyUnit> currencies, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads all price lists wherePriceList.getUserTargets()
intersects with the providedUserTarget
s.Set<String>
readAllModifiableFieldsForType(String type)
Returns the fields that the PriceModifier components can use for calculations.ModifiableFields
readModifiableFieldsForType(String type)
List<com.broadleafcommerce.pricing.client.domain.PriceListRef>
retrievePriceListRefsForPriceContext(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext)
Retrieves allPriceListRefs
that apply to a givenPriceContext
.List<P>
retrievePriceListsForPriceContext(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext)
Retrieves allPriceListRefs
that apply to a givenPriceContext
.-
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
-
-
-
-
Method Detail
-
readAllByType
@NonNull org.springframework.data.domain.Page<P> readAllByType(@NonNull String type, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
readAllByTypeAndName
@NonNull org.springframework.data.domain.Page<P> readAllByTypeAndName(@NonNull String type, @NonNull String name, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
readAllByName
@NonNull org.springframework.data.domain.Page<P> readAllByName(@NonNull String name, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
readAllByPriceRefs
@NonNull List<P> readAllByPriceRefs(Collection<com.broadleafcommerce.pricing.client.domain.PriceListRef> priceListRefs, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Returns list of PriceLists for the provided priceListRefs.- Parameters:
priceListRefs
-context
-- Returns:
-
readAllByUserTargetsIn
@NonNull List<P> readAllByUserTargetsIn(@NonNull Iterable<UserTarget> userTargets, @NonNull List<javax.money.CurrencyUnit> currencies, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads all price lists wherePriceList.getUserTargets()
intersects with the providedUserTarget
s.- Parameters:
userTargets
- users the returnedPriceList
should targetcurrencies
- the list ofCurrencyUnit
s by which to filtercontextInfo
- Context information regarding the current API request- Returns:
- all
PriceList
s targeting the providedUserTarget
s.
-
readAllByCurrencyIn
@NonNull List<P> readAllByCurrencyIn(@NonNull List<javax.money.CurrencyUnit> currencies, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads all price lists targeting the given currency.- Parameters:
currencies
- the list ofCurrencyUnit
s by which to filtercontextInfo
- Context information regarding the current API request- Returns:
- all
PriceList
s targeting the provided currency
-
readAllByIds
@NonNull org.springframework.data.domain.Page<P> readAllByIds(@NonNull Iterable<String> id, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
retrievePriceListRefsForPriceContext
@NonNull List<com.broadleafcommerce.pricing.client.domain.PriceListRef> retrievePriceListRefsForPriceContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext)
Retrieves all
PriceListRefs
that apply to a givenPriceContext
.This method will look first for any customer- or account-specific
PriceLists
since these will trump any others (seePriceList.getUserTargets()
. Then, it will filter byPriceList.getCurrency()
. If none, then it will filter first on currency then onPriceList.getPriceContextCriteria()
. In all cases, if applicable, it will filter and sort on priority.
-
retrievePriceListsForPriceContext
@NonNull List<P> retrievePriceListsForPriceContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext)
Retrieves all
PriceListRefs
that apply to a givenPriceContext
.This method will look first for any customer- or account-specific
PriceLists
since these will trump any others (seePriceList.getUserTargets()
. Then, it will filter byPriceList.getCurrency()
. If none, then it will filter first on currency then onPriceList.getPriceContextCriteria()
. In all cases, if applicable, it will filter and sort on priority.
-
readAllModifiableFieldsForType
Set<String> readAllModifiableFieldsForType(String type)
Returns the fields that the PriceModifier components can use for calculations.- Parameters:
type
-- Returns:
-
convertPriceListToPriceListRef
com.broadleafcommerce.pricing.client.domain.PriceListRef convertPriceListToPriceListRef(PriceList priceList)
Create a lightweight PriceListRef from a PriceList object.- Parameters:
priceList
-- Returns:
-
readModifiableFieldsForType
ModifiableFields readModifiableFieldsForType(String type)
-
-