Interface CommerceQuoteDao

All Superinterfaces:
GenericDao<QuoteModel>
All Known Implementing Classes:
DefaultCommerceQuoteDao

public interface CommerceQuoteDao extends GenericDao<QuoteModel>
DAO interface for handling QuoteModel
  • 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 for
      store - the store to retrieve quotes for
      pageableData - the pagination settings
      quoteStates - 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 expire
      expiredBy - the date before which the quote is going to expire
      quoteStates - the quote states the user can access
      quoteNotificationType - 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 date
      quoteStates - the quote states the user can access
      quoteNotificationType - 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 for
      store - the store to retrieve quotes for
      quoteCode - the quote code to search for
      quoteStates - 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 empty
      ModelNotFoundException - if no results were found
      AmbiguousIdentifierException - 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 for
      store - the store to get the quote count for
      quoteStates - 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