Interface CommerceQuoteDao

    • Method Detail

      • findQuotesByCustomerAndStore

        SearchPageData<QuoteModel> findQuotesByCustomerAndStore​(CustomerModel customerModel,
                                                                BaseStoreModel store,
                                                                PageableData pageableData,
                                                                java.util.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:
        java.lang.IllegalArgumentException - if any of the parameters is null or the set of quote states is empty
      • findQuotesSoonToExpire

        SearchResult<QuoteModel> findQuotesSoonToExpire​(java.util.Date expiredAfter,
                                                        java.util.Date expiredBy,
                                                        QuoteNotificationType quoteNotificationType,
                                                        java.util.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:
        java.lang.IllegalArgumentException - if any of the parameters is null or the set of quote states is empty
      • findQuotesExpired

        SearchResult<QuoteModel> findQuotesExpired​(java.util.Date currentDate,
                                                   QuoteNotificationType quoteNotificationType,
                                                   java.util.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:
        java.lang.IllegalArgumentException - if any of the parameters is null or the set of quote states is empty
      • findUniqueQuoteByCodeAndCustomerAndStore

        QuoteModel findUniqueQuoteByCodeAndCustomerAndStore​(CustomerModel customerModel,
                                                            BaseStoreModel store,
                                                            java.lang.String quoteCode,
                                                            java.util.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:
        java.lang.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

        java.lang.Integer getQuotesCountForCustomerAndStore​(CustomerModel customerModel,
                                                            BaseStoreModel store,
                                                            java.util.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:
        java.lang.IllegalArgumentException - if any of the parameters is null or the set of quote states is empty