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
PriceList
s. Backed by a
PriceListRepository
.- Author:
- Chad Harchar (charchar), Nathan Moore (nathanmoore)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.pricing.client.domain.PriceListRef
convertPriceListToPriceListRef
(PriceList priceList) Create a lightweight PriceListRef from a PriceList object.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) 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) 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.Returns the fields that the PriceModifier components can use for calculations.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
.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
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Method Details
-
readAllByType
-
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
-
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
-
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
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
-