Interface AccountFeeLogServiceLocal

    • Method Detail

      • archiveAccountFee

        long archiveAccountFee​(long id)
        Archives the account fee log with the given id, returning the number of removed UserAccountFeeLogs
      • calculateAmount

        BigDecimal calculateAmount​(AccountFeeLog execution,
                                   UserAccount account)
        Calculates the amount to be charged for the given user account on the given fee execution. Returns null when nothing should be charged (for example, because of the freebase)
      • calculateReservedAmount

        BigDecimal calculateReservedAmount​(AccountFee accountFee,
                                           UserAccount userAccount)
        Returns the reserved amount for an account fee over a given account
      • getLastExecution

        AccountFeeLog getLastExecution​(AccountFee accountFee)
        Returns the last execution log for a given fee, or null if it was never charged
      • getNextExecutionDate

        Date getNextExecutionDate​(AccountFee accountFee,
                                  AccountFeeLog lastExecution)
        Returns the next date the given fee should be executed, or null if the fee is disabled or manual
      • insertMissingScheduledExecutions

        long insertMissingScheduledExecutions()
        For each enabled scheduled fee, inserts all missing AccountFeeLogs
      • markFinished

        void markFinished​(Long id)
        Marks the account fee log with the given id as finished. The operation can be retried, so when marking as finished a fee log that is still running will result in a new background task scheduling for a few minutes to retry again. However, for this check to happen, retry must be greater than zero. If zero, no check will be performed and the fee log is directly marked as finished. It was done like this to avoid penalizing regular executions of this method after a fork/join process.
      • resolveAccount

        UserAccount resolveAccount​(AccountFeeLog accountFeeLog,
                                   User user)
        Returns the UserAccount for the given user involved in the given fee log. Account fees may be paid from or to system.