Class DefaultQuoteUpdateExpirationTimeStrategy

    • Constructor Detail

      • DefaultQuoteUpdateExpirationTimeStrategy

        public DefaultQuoteUpdateExpirationTimeStrategy()
    • Method Detail

      • updateExpirationTime

        public QuoteModel updateExpirationTime​(QuoteAction quoteAction,
                                               QuoteModel quoteModel,
                                               UserModel userModel)
        Description copied from interface: QuoteUpdateExpirationTimeStrategy
        Updates the expiration time for a quote depending on the action that is being performed and type of the quote user. Edit & Submit actions are being handled. When a buyer performs such actions, the expiration time is set to null. When a seller Submits the quote to the seller approver and the expiration time for it is set to a date before the current date plus the minimum offer validity period in days or not set at all, the expiration time is set to the current date plus the default offer validity period in days and with the time being end of day. Edit action is not handled for seller. Please see commerceservices project.properties file for the quote offer validity period parameters.
        Specified by:
        updateExpirationTime in interface QuoteUpdateExpirationTimeStrategy
        Parameters:
        quoteAction - the action that is being performed
        quoteModel - the quote for which to update the expiration time
        userModel - the user performing the action on the quote
        Returns:
        QuoteModel updated quote model
      • updateExpirationTimeForEditAction

        protected void updateExpirationTimeForEditAction​(QuoteModel quoteModel,
                                                         QuoteUserType quoteUserType)
      • updateExpirationTimeForSubmitAction

        protected void updateExpirationTimeForSubmitAction​(QuoteModel quoteModel,
                                                           QuoteUserType quoteUserType)
      • getTimeService

        protected TimeService getTimeService()
      • setTimeService

        public void setTimeService​(TimeService timeService)