Interface CommerceQuoteDao
- All Superinterfaces:
GenericDao<QuoteModel>
- All Known Implementing Classes:
DefaultCommerceQuoteDao
DAO interface for handling
QuoteModel-
Method Summary
Modifier and TypeMethodDescriptionfindQuotesByCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, PageableData pageableData, Set<QuoteState> quoteStates) Returns a paged list of maximum version (i.e.findQuotesExpired(Date currentDate, QuoteNotificationType quoteNotificationType, Set<QuoteState> quoteStates) Returns a list of active (last version) quotes filtered by given statuses which are expiredfindQuotesSoonToExpire(Date expiredAfter, Date expiredBy, QuoteNotificationType quoteNotificationType, Set<QuoteState> quoteStates) Returns a list of active (last version) quotes filtered by given statuses which will expire by the specified datefindUniqueQuoteByCodeAndCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, String quoteCode, Set<QuoteState> quoteStates) Returns a unique quote of maximum version (i.e.getQuotesCountForCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, Set<QuoteState> quoteStates) Returns the total number of quotes for the specified user and store.
-
Method Details
-
findQuotesByCustomerAndStore
SearchPageData<QuoteModel> findQuotesByCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, PageableData pageableData, Set<QuoteState> quoteStates) Returns a paged list of maximum version (i.e. active quotes) of each quote for the specified user & store, filtered by accessible quote states.- Parameters:
customerModel- the customer to retrieve quotes forstore- the store to retrieve quotes forpageableData- the pagination settingsquoteStates- the quote states the user can access- Returns:
- the paged search result
- Throws:
IllegalArgumentException- if any of the parameters is null or the set of quote states is empty
-
findQuotesSoonToExpire
SearchResult<QuoteModel> findQuotesSoonToExpire(Date expiredAfter, Date expiredBy, QuoteNotificationType quoteNotificationType, Set<QuoteState> quoteStates) Returns a list of active (last version) quotes filtered by given statuses which will expire by the specified date- Parameters:
expiredAfter- the date after which the quote is going to expireexpiredBy- the date before which the quote is going to expirequoteStates- the quote states the user can accessquoteNotificationType- the quote notification, for which we are getting quotes (quotes which have this notification set will be excluded from the results)- Returns:
- the paged search result
- Throws:
IllegalArgumentException- if any of the parameters is null or the set of quote states is empty
-
findQuotesExpired
SearchResult<QuoteModel> findQuotesExpired(Date currentDate, QuoteNotificationType quoteNotificationType, Set<QuoteState> quoteStates) Returns a list of active (last version) quotes filtered by given statuses which are expired- Parameters:
currentDate- the current datequoteStates- the quote states the user can accessquoteNotificationType- the quote notification, for which we are getting quotes (quotes which have this notification set will be excluded from the results)- Returns:
- the paged search result
- Throws:
IllegalArgumentException- if any of the parameters is null or the set of quote states is empty
-
findUniqueQuoteByCodeAndCustomerAndStore
QuoteModel findUniqueQuoteByCodeAndCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, String quoteCode, Set<QuoteState> quoteStates) Returns a unique quote of maximum version (i.e. active quote) for the specified user, store & code, filtered by accessible quote states.- Parameters:
customerModel- the customer to retrieve quotes forstore- the store to retrieve quotes forquoteCode- the quote code to search forquoteStates- the quote states the user can access- Returns:
- the unique quote matching the search parameters
- Throws:
IllegalArgumentException- if any of the parameters is null or the set of quote states is emptyModelNotFoundException- if no results were foundAmbiguousIdentifierException- if more than one quote matches the search parameters
-
getQuotesCountForCustomerAndStore
Integer getQuotesCountForCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, Set<QuoteState> quoteStates) Returns the total number of quotes for the specified user and store.- Parameters:
customerModel- the customer to get the quote count forstore- the store to get the quote count forquoteStates- the list of states the user can access- Returns:
- the quote count
- Throws:
IllegalArgumentException- if any of the parameters is null or the set of quote states is empty
-