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 accountvoidchargeBatch(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.booleanhasUsers(AccountFeeLog log)Returns whether there areUserAccountFeeLogs for the given fee executionlonginsertMissingScheduledExecutions()For each enabled scheduled fee, inserts all missingAccountFeeLogsvoidmarkFinished(AccountFeeLog log)Marks the given account fee log as finished.UserAccountresolveAccount(AccountFeeLog accountFeeLog, User user)Returns theUserAccountfor the given user involved in the given fee log.-
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
void chargeBatch(List<Long> uaflIds)
Changes a batch ofUserAccountFeeLogs.
-
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.
-
hasUsers
boolean hasUsers(AccountFeeLog log)
Returns whether there areUserAccountFeeLogs for the given fee execution
-
insertMissingScheduledExecutions
long insertMissingScheduledExecutions()
For each enabled scheduled fee, inserts all missingAccountFeeLogs
-
markFinished
void markFinished(AccountFeeLog log)
Marks the given account fee log as finished.
-
resolveAccount
UserAccount resolveAccount(AccountFeeLog accountFeeLog, User user)
Returns theUserAccountfor the given user involved in the given fee log. Account fees may be paid from or to system.
-
-