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 Summary
Modifier and TypeMethodDescriptionint
deleteAbandonedAnonymousCarts
(Instant deletePoint, Collection<String> statuses, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Delete anonymous carts that have not been updated since the given date.org.springframework.data.domain.Page<D>
findAllByStatusesAndCustomerId
(Set<String> statuses, String customerId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all carts with the given status within the requested pageorg.springframework.data.domain.Page<D>
findAllByStatusesAndCustomerIdAndAccountId
(Set<String> statuses, String customerId, String accountId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all carts with the given status within the requested page.org.springframework.data.domain.Page<D>
findAllByStatusesAndCustomerRefCustomerId
(Set<String> statuses, String customerId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.findAllMatchingTenantByIds
(List<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds a list of the carts with the givenids
and matching the tenant from the givenContextInfo
.org.springframework.data.domain.Page<D>
findAllQuotesByExpirationDateBeforeAndStatusNotIn
(Instant expirationDate, Collection<String> statusesToExclude, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds a list of carts of typeDefaultCartTypes.QUOTE
with expiration date before the provided date-time value, and a status not in the provided 'statuses' collection.findByStatusAndCustomerId
(String status, String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds a cart with the given status for the customer ID provided.findByStatusAndCustomerIdAndAccountId
(String status, String customerId, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds a cart with the given status for the customer ID and account ID provided.findByStatusAndCustomerRefCustomerId
(String status, String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.org.springframework.data.domain.Page<D>
findHistoricalByCustomerIdAndDates
(String customerId, Date startDate, Date endDate, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all carts that areDefaultCartStatuses.CANCELLED
orDefaultCartStatuses.SUBMITTED
for the provided customer and dates.org.springframework.data.domain.Page<D>
findHistoricalByCustomerRefCustomerIdAndDates
(String customerId, Date startDate, Date endDate, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.org.springframework.data.domain.Page<D>
findPageMatchingTenantByStatus
(String status, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds a page of the carts with the givenstatus
and matching the tenant from the givenContextInfo
.
-
Method Details
-
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 latestcreateDate
.- Parameters:
status
- the status to find carts ofcustomerId
- the customer ID to find carts withcontextInfo
- 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 latestcreateDate
.- Parameters:
status
- the status to find carts ofcustomerId
- the customer ID to find carts withaccountId
- the account ID to find carts withcontextInfo
- 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) Deprecated.Finds a cart with the given status for the customer ID provided. By default, if multiple are found, this selects the cart with the latestcreateDate
.- Parameters:
status
- the status to find carts ofcustomerId
- the customer ID to find carts withcontextInfo
- 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 considercustomerId
- the ID of the customer to find carts forpage
- the requested page of results from the databasecontextInfo
- 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 considercustomerId
- the ID of the customer to find carts forpage
- the requested page of results from the databasecontextInfo
- 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) Deprecated.Finds all carts with the given status within the requested page- Parameters:
statuses
- the status of the carts to considercustomerId
- the ID of the customer to find carts forpage
- the requested page of results from the databasecontextInfo
- 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 areDefaultCartStatuses.CANCELLED
orDefaultCartStatuses.SUBMITTED
for the provided customer and dates.- Parameters:
customerId
- the id of the customer who owns the cartsstartDate
- the starting date to filter carts byendDate
- the ending date to filter carts bypage
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- all carts that are
DefaultCartStatuses.CANCELLED
orDefaultCartStatuses.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) Deprecated.Find all carts that areDefaultCartStatuses.SUBMITTED
orDefaultCartStatuses.CANCELLED
for the provided customer and dates.- Parameters:
customerId
- the id of the customer who owns the cartsstartDate
- the starting date to filter carts byendDate
- the ending date to filter carts bypage
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- all carts that are
DefaultCartStatuses.SUBMITTED
orDefaultCartStatuses.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 givenstatus
and matching the tenant from the givenContextInfo
.- Parameters:
status
- the status of the cartpageable
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- A page of the carts with the given
status
and matching the tenant from the givenContextInfo
.
-
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 givenids
and matching the tenant from the givenContextInfo
.- Parameters:
ids
- the ids of the cartcontextInfo
- context information related to multitenancy- Returns:
- Finds a list of the carts with the given
ids
and matching the tenant from the givenContextInfo
.
-
findAllQuotesByExpirationDateBeforeAndStatusNotIn
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllQuotesByExpirationDateBeforeAndStatusNotIn(Instant expirationDate, Collection<String> statusesToExclude, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds a list of carts of typeDefaultCartTypes.QUOTE
with expiration date before the provided date-time value, and a status not in the provided 'statuses' collection.- Parameters:
expirationDate
- the date-time before or on which carts are considered expired.statusesToExclude
- a collection of statuses that are not returned.page
- the requested page of results from the database.contextInfo
- context information related to multitenancy.- Returns:
- a page of expired carts of type
DefaultCartTypes.QUOTE
with a status not in the provided collection.
-
findAllByStatusesAndCustomerId(Set, String, Pageable, ContextInfo)