Interface CustomizedCartRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>

  • All Known Subinterfaces:
    CartRepository<D>, JpaCartRepository<D>
    All Known Implementing Classes:
    JpaCustomizedCartRepository

    public interface CustomizedCartRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
    Advanced functionality related to cart maintenance and filtering.
    • Method Detail

      • findByStatusAndCustomerId

        @Policy(operationTypes=READ)
        Optional<D> findByStatusAndCustomerId​(String status,
                                              String customerId,
                                              @Nullable
                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds a cart with the given status for the customer ID provided. By default, if multiple are found, this selects the cart with the latest createDate.
        Parameters:
        status - the status to find carts of
        customerId - the customer ID to find carts with
        contextInfo - the context to use for filtering the results
        Returns:
        the cart with requested details, or empty if none was found.
      • findByStatusAndCustomerIdAndAccountId

        @Policy(operationTypes=READ)
        Optional<D> findByStatusAndCustomerIdAndAccountId​(String status,
                                                          String customerId,
                                                          @Nullable
                                                          String accountId,
                                                          @Nullable
                                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds a cart with the given status for the customer ID and account ID provided. By default, if multiple are found, this selects the cart with the latest createDate.
        Parameters:
        status - the status to find carts of
        customerId - the customer ID to find carts with
        accountId - the account ID to find carts with
        contextInfo - the context to use for filtering the results
        Returns:
        the cart with requested details, or empty if none was found.
      • findByStatusAndCustomerRefCustomerId

        @Deprecated
        @Policy(operationTypes=READ)
        Optional<D> findByStatusAndCustomerRefCustomerId​(String status,
                                                         String customerId,
                                                         @Nullable
                                                         com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds a cart with the given status for the customer ID provided. By default, if multiple are found, this selects the cart with the latest createDate.
        Parameters:
        status - the status to find carts of
        customerId - the customer ID to find carts with
        contextInfo - the context to use for filtering the results
        Returns:
        the cart with requested details, or empty if none was found.
      • findAllByStatusesAndCustomerId

        @Policy(operationTypes=READ)
        org.springframework.data.domain.Page<D> findAllByStatusesAndCustomerId​(Set<String> statuses,
                                                                               String customerId,
                                                                               @Nullable
                                                                               org.springframework.data.domain.Pageable page,
                                                                               @Nullable
                                                                               com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds all carts with the given status within the requested page
        Parameters:
        statuses - the status of the carts to consider
        customerId - the ID of the customer to find carts for
        page - the requested page of results from the database
        contextInfo - context information related to multitenancy
        Returns:
        a page of carts with the requested details
      • findAllByStatusesAndCustomerIdAndAccountId

        @Policy(operationTypes=READ)
        org.springframework.data.domain.Page<D> findAllByStatusesAndCustomerIdAndAccountId​(Set<String> statuses,
                                                                                           String customerId,
                                                                                           @Nullable
                                                                                           String accountId,
                                                                                           @Nullable
                                                                                           org.springframework.data.domain.Pageable page,
                                                                                           @Nullable
                                                                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds all carts with the given status within the requested page. Account id can be null to find customer's personal non-account carts.
        Parameters:
        statuses - the status of the carts to consider
        customerId - the ID of the customer to find carts for
        page - the requested page of results from the database
        contextInfo - context information related to multitenancy
        Returns:
        a page of carts with the requested details
      • findAllByStatusesAndCustomerRefCustomerId

        @Deprecated
        @Policy(operationTypes=READ)
        org.springframework.data.domain.Page<D> findAllByStatusesAndCustomerRefCustomerId​(Set<String> statuses,
                                                                                          String customerId,
                                                                                          @Nullable
                                                                                          org.springframework.data.domain.Pageable page,
                                                                                          @Nullable
                                                                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds all carts with the given status within the requested page
        Parameters:
        statuses - the status of the carts to consider
        customerId - the ID of the customer to find carts for
        page - the requested page of results from the database
        contextInfo - context information related to multitenancy
        Returns:
        a page of carts with the requested details
      • findHistoricalByCustomerIdAndDates

        @Policy(operationTypes=READ)
        org.springframework.data.domain.Page<D> findHistoricalByCustomerIdAndDates​(String customerId,
                                                                                   Date startDate,
                                                                                   Date endDate,
                                                                                   @Nullable
                                                                                   org.springframework.data.domain.Pageable page,
                                                                                   @Nullable
                                                                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Find all carts that are DefaultCartStatuses.CANCELLED or DefaultCartStatuses.SUBMITTED for the provided customer and dates.
        Parameters:
        customerId - the id of the customer who owns the carts
        startDate - the starting date to filter carts by
        endDate - the ending date to filter carts by
        page - the requested page of results from the database
        contextInfo - context information related to multitenancy
        Returns:
        all carts that are DefaultCartStatuses.CANCELLED or DefaultCartStatuses.SUBMITTED for the provided customer and dates.
      • findHistoricalByCustomerRefCustomerIdAndDates

        @Deprecated
        @Policy(operationTypes=READ)
        org.springframework.data.domain.Page<D> findHistoricalByCustomerRefCustomerIdAndDates​(String customerId,
                                                                                              Date startDate,
                                                                                              Date endDate,
                                                                                              @Nullable
                                                                                              org.springframework.data.domain.Pageable page,
                                                                                              @Nullable
                                                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Find all carts that are DefaultCartStatuses.SUBMITTED or DefaultCartStatuses.CANCELLED for the provided customer and dates.
        Parameters:
        customerId - the id of the customer who owns the carts
        startDate - the starting date to filter carts by
        endDate - the ending date to filter carts by
        page - the requested page of results from the database
        contextInfo - context information related to multitenancy
        Returns:
        all carts that are DefaultCartStatuses.SUBMITTED or DefaultCartStatuses.CANCELLED for the provided customer and dates.
      • deleteAbandonedAnonymousCarts

        @Policy(operationTypes=DELETE)
        int deleteAbandonedAnonymousCarts​(Instant deletePoint,
                                          Collection<String> statuses,
                                          @Nullable
                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Delete anonymous carts that have not been updated since the given date.
        Parameters:
        deletePoint - Find carts that have not been updated since this Instant.
        statuses - Find carts that have one of these statuses.
        contextInfo - context information related to multitenancy.
        Returns:
        The number of carts deleted.
      • findPageMatchingTenantByStatus

        @Policy(operationTypes=READ)
        org.springframework.data.domain.Page<D> findPageMatchingTenantByStatus​(String status,
                                                                               @Nullable
                                                                               org.springframework.data.domain.Pageable pageable,
                                                                               @Nullable
                                                                               com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds a page of the carts with the given status and matching the tenant from the given ContextInfo.
        Parameters:
        status - the status of the cart
        pageable - the requested page of results from the database
        contextInfo - context information related to multitenancy
        Returns:
        A page of the carts with the given status and matching the tenant from the given ContextInfo.
      • findAllMatchingTenantByIds

        @Policy(operationTypes=READ)
        List<D> findAllMatchingTenantByIds​(List<String> ids,
                                           @Nullable
                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Finds a list of the carts with the given ids and matching the tenant from the given ContextInfo.
        Parameters:
        ids - the ids of the cart
        contextInfo - context information related to multitenancy
        Returns:
        Finds a list of the carts with the given ids and matching the tenant from the given ContextInfo.