Package org.cyclos.impl.banking
Interface AccountFeeLogServiceLocal
-
- All Superinterfaces:
AccountFeeLogService,Service
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.intcountUsers(AccountFeeLog log, Set<UserAccountFeeStatus> statuses)Returns the number ofUserAccountFeeLogs for the given fee execution in the given statusesAccountFeeLoggetLastExecution(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 missingAccountFeeLogsvoidmarkFinished(Long id)Marks the account fee log with the given id 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.
-
countUsers
int countUsers(AccountFeeLog log, Set<UserAccountFeeStatus> statuses)
Returns the number ofUserAccountFeeLogs for the given fee execution in the given statuses
-
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
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 theUserAccountfor the given user involved in the given fee log. Account fees may be paid from or to system.
-
-