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 for PriceLists. Backed by a PriceListRepository.
    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 where PriceList.getUserTargets() intersects with the provided UserTargets.
      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 all PriceListRefs that apply to a given PriceContext.
      List<P> retrievePriceListsForPriceContext​(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext)
      Retrieves all PriceListRefs that apply to a given PriceContext.
      • 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 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 where PriceList.getUserTargets() intersects with the provided UserTargets.
        Parameters:
        userTargets - users the returned PriceList should target
        currencies - the list of CurrencyUnits by which to filter
        contextInfo - Context information regarding the current API request
        Returns:
        all PriceLists targeting the provided UserTargets.
      • 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 of CurrencyUnits by which to filter
        contextInfo - Context information regarding the current API request
        Returns:
        all PriceLists 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 given PriceContext.

        This method will look first for any customer- or account-specific PriceLists since these will trump any others (see PriceList.getUserTargets(). Then, it will filter by PriceList.getCurrency(). If none, then it will filter first on currency then on PriceList.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 given PriceContext.

        This method will look first for any customer- or account-specific PriceLists since these will trump any others (see PriceList.getUserTargets(). Then, it will filter by PriceList.getCurrency(). If none, then it will filter first on currency then on PriceList.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: