Package org.cyclos.impl.banking
Interface AccountFeeLogServiceLocal
-
- All Superinterfaces:
AccountFeeLogService,Service
- All Known Implementing Classes:
AccountFeeLogServiceImpl
public interface AccountFeeLogServiceLocal extends AccountFeeLogService
Local interface forAccountFeeLogService
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_ACCOUNTScript attribute: user account being chargedstatic StringATTR_EXECUTION_DATEScript attribute: the expected execution datestatic StringATTR_FEEScript attribute: fee being charged
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longarchiveAccountFee(long id)Archives the account fee log with the given id, returning the number of removedUserAccountFeeLogsBigDecimalcalculateAmount(AccountFeeLog execution, UserAccount account)Calculates the amount to be charged for the given user account on the given fee execution.BigDecimalcalculateReservedAmount(AccountFee accountFee, UserAccount userAccount)Returns the reserved amount for an account fee over a given accountbooleanchargeBatch(List<Long> uaflIds)Changes a batch ofUserAccountFeeLogs.AccountFeeLoggetLastExecution(AccountFee accountFee)Returns the last execution log for a given fee, or null if it was never chargedDategetNextExecutionDate(AccountFee accountFee, AccountFeeLog lastExecution)Returns the next date the given fee should be executed, or null if the fee is disabled or manualcom.mysema.commons.lang.CloseableIterator<Long>getUserAFLIdsToCharge(AccountFeeLog accountFeeLog)Returns the identifiers ofUserAccountFeeLogs that should be charged for this log.longinsertMissingScheduledExecutions()For each enabled scheduled fee, inserts all missingAccountFeeLogsbooleanmarkFinished(AccountFeeLog log)Marks the given account fee log as finished.-
Methods inherited from interface org.cyclos.services.banking.AccountFeeLogService
getData, getFeeExecutionsSearchData, getSearchData, rechargeFailed, runNow, search, searchFeeExecutions
-
-
-
-
Field Detail
-
ATTR_FEE
static final String ATTR_FEE
Script attribute: fee being charged- See Also:
- Constant Field Values
-
ATTR_ACCOUNT
static final String ATTR_ACCOUNT
Script attribute: user account being charged- See Also:
- Constant Field Values
-
ATTR_EXECUTION_DATE
static final String ATTR_EXECUTION_DATE
Script attribute: the expected execution date- See Also:
- Constant Field Values
-
-
Method Detail
-
archiveAccountFee
long archiveAccountFee(long id)
Archives the account fee log with the given id, returning the number of removedUserAccountFeeLogs
-
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 ofUserAccountFeeLogs. 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
-
getUserAFLIdsToCharge
com.mysema.commons.lang.CloseableIterator<Long> getUserAFLIdsToCharge(AccountFeeLog accountFeeLog)
Returns the identifiers ofUserAccountFeeLogs that should be charged for this log. If the log is in statusAccountFeeLogStatus.RUNNING, returns ids of UAFLs with statusUserAccountFeeStatus.PENDING. However, if the status isAccountFeeLogStatus.RECHARGING_FAILED, returns UAFLs with statusUserAccountFeeStatus.FAILEDand recharge attempt < account fee log's recharge attempt.
-
insertMissingScheduledExecutions
long insertMissingScheduledExecutions()
For each enabled scheduled fee, inserts all missingAccountFeeLogs
-
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.
-
-