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
      • chargeBatch

        boolean chargeBatch​(List<Long> uaflIds)
        Changes a batch of UserAccountFeeLogs. All ids must belong to the same log If after this batch the log is finished, mark it as finished
        Returns:
        Whether the log has finished or not.
      • 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

        boolean markFinished​(AccountFeeLog log)
        Marks the given account fee log as finished. Is here in the local interface because is used by a migration (see database_4.13).
        Returns:
        Whether the log has marked as finished or not by this invocation.