public interface AccountServiceLocal extends AccountService
AccountService| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_ACCOUNT_TYPE
Script bind variable: the account type
|
static java.lang.String |
ATTR_OWNER
Script bind variable: the account owner (either an
User or SystemAccountOwner) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accountNumberExistsOrIsReserved(AccountNumberConfiguration accountNumberConfiguration,
java.lang.String accountNumber)
Returns true if the given account number is used in an existing account
or is reserved to be used for a pending user
|
boolean |
canDispose(java.util.Collection<UserAccount> accounts)
checks if the accounts can be disposed safely.
|
void |
checkActive(Account account)
Checks that the given account is active, throwing an
IllegalActionException in case it is an inactive user account, or the owner is
inactive |
void |
checkActive(AccountOwner owner)
Checks that the given account owner is active, throwing an
IllegalActionException in case it is a removed or pending user |
ClosedAccountBalance |
closeBalance(Account account)
Closes the balance for the given account
|
void |
createMissingOrActivateAccount(UserAccountType accountType,
ProductOwner owner)
Creates the account for the given account type if it still doesn't exists for the given ProductOwner, or activates it.
|
SystemAccount |
createSystemAccount(SystemAccountType type)
Creates a new system account
|
ExternalPaymentNegativeAmountReservation |
dereserveAmount(ExternalPayment externalPayment)
Cancels the amount reservation related to the given external payment
|
OrderAmountReservation |
dereserveAmount(Order order)
Cancels the amount reservation related to the given order
|
ScheduledPaymentInstallmentAmountReservation |
dereserveAmount(ScheduledPaymentInstallment installment)
Dereserves the amount for the given installment
|
PendingAuthorizationAmountReservation |
dereserveAmountForAuthorization(BasePayment transaction)
Dereserves the amount for the transaction which was previously awaiting authorization
|
void |
disposeAccounts(User user,
java.util.Collection<UserAccount> lostAccounts)
Disables the given accounts of the given user.
Note that the calling method is responsible for checking if this account really needs to be disposed (for example because it is associated via another product). The method does the following: cancel all user's webshop orders with any pending status. |
void |
disposeAllAccounts(User user)
Disposes all users' accounts
|
void |
fillTransSearchData(TransSearchData data,
Account account,
InternalAccountOwner accountOwner)
Fills the given data with data common to transfer and transaction search.
|
Account |
findByNumber(java.lang.String number)
Returns the account with the given number
|
java.lang.String |
generateNumber(AccountType type,
InternalAccountOwner owner)
Generates an unique account number for the given type and owner.
|
java.util.List<Account> |
getAccountsByCurrency(Currency currency)
Returns all the logged user accounts for the given currency
|
AccountStatusVO |
getAccountStatus(Account account,
java.util.Date date,
RateVisibility rateVisibility)
Returns the account status for the given account at the given time
|
java.util.List<AccountWithStatusVO> |
getAccountsWithStatus(InternalAccountOwner accountOwner,
java.util.Date date,
java.util.Date receivedSince,
boolean includeRates)
Similar to
list(InternalAccountOwner), but returns each account with the account status, at the given time point. |
java.math.BigDecimal |
getAvailableBalance(Account account,
java.util.Date date)
Returns the available balance for the given account at the given date
|
java.math.BigDecimal |
getAvailableBalanceByAccountType(InternalAccountOwner accountOwner,
AccountType accountType)
Returns the available balance for the account that has the given account owner and type
|
java.math.BigDecimal |
getAverageBalance(Account account,
java.math.BigDecimal balanceDiff,
DatePeriod period,
boolean positive,
java.math.BigDecimal freebase)
Returns the balance average for the given account over the given period.
|
java.math.BigDecimal |
getBalance(Account account,
java.util.Date date)
Returns the raw balance for the given account at the given time
|
org.cyclos.impl.utils.validation.Validator |
getCanDisposeValidator()
gets a Validator for checking if an account can be disposed.
|
java.math.BigDecimal |
getCreditLimit(Account account,
java.util.Date date)
Returns the credit limit of the given account at the given date
|
AccountLimitLog |
getLimitLog(Account account,
java.util.Date date)
Returns the limit log which is valid on the given time.
|
java.util.List<TransferStatusFlow> |
getManagedFlows(Account account)
Returns the managed transfer status flows for the logged user over the given account
|
java.lang.String |
getOwnerName(Account account)
Returns the owner name: if is a system account, get the system account type.
|
java.math.BigDecimal |
getUpperCreditLimit(Account account,
java.util.Date date)
Returns the upper credit limit of the given account at the given date
|
java.util.List<UserAccountData> |
getUserAccountsData(User user)
Returns the user's accounts data visible in profile
|
java.util.List<TransferStatusFlow> |
getVisibleFlows(Account account)
Returns the visible transfer status flows for the logged user over the given account
|
boolean |
hasAccess(Account account)
Returns whether the given account is accessible by the logged user
|
boolean |
hasTransfers(java.util.Set<UserAccountType> userAccounts,
java.util.Set<Group> groups)
Returns true if there is at least one transfer performed from or to a user of any of the specified groups, to or from any of the given
accounts.
|
void |
incrementBalanceCounter(Account account)
Increments the counter for closing the given account's balance
|
boolean |
isOnlyOwnPayments(AccountType account)
Returns whether the logged user can only view payments performed / received by himself on the given account
|
<A extends Account> |
list(InternalAccountOwner owner)
Returns the available accounts for the given owner
|
<A extends Account> |
load(AccountLocator locator)
Loads an account for the given locator, without checking permissions for the logged user
|
<A extends Account> |
load(InternalAccountOwner owner,
AccountType type)
Loads an account for the given owner / type, without checking permissions for the logged user
|
void |
removeLastClosedAccountBalances(Transfer transfer)
Removes all the closes from the initial date to now of the from and to account of the transfer
|
ExternalPaymentAmountReservation |
reserveAmount(ExternalPayment externalPayment)
Reserves the amount for the given external payment
|
OrderAmountReservation |
reserveAmount(Order order)
Reserves the amount for the given webshop order
|
ScheduledPaymentAmountReservation |
reserveAmount(ScheduledPayment scheduledPayment)
Reserves the total amount for the given scheduled payment
|
PendingAuthorizationAmountReservation |
reserveAmountForAuthorization(BasePayment transaction)
Reserves the amount for a given payment pending authorization
|
AccountWithStatusVO |
toAccountWithStatus(Account account,
java.util.Date date,
java.util.Date paymentsSince,
boolean includeRates)
Converts the given account with
AccountWithStatusVO, getting the status at the given time point. |
exportToCSV, getAccountBalanceLimitsOverviewData, getAccountHistoriesOverviewData, getAccountHistoryData, getAccountHistoryStatus, getAccountsSummary, getAccountStatus, getUserAccountLimitData, getUserAccountsLimits, getUserWithBalanceSearchData, hasAccessibleAccounts, load, printAccountHistory, searchAccountBalanceLimitsOverview, searchAccountHistoriesOverview, searchAccountHistory, searchUsersWithBalances, setBalanceLimitstatic final java.lang.String ATTR_ACCOUNT_TYPE
static final java.lang.String ATTR_OWNER
User or SystemAccountOwner)boolean canDispose(java.util.Collection<UserAccount> accounts) throws FrameworkException
FrameworkExceptionvoid checkActive(Account account) throws FrameworkException
IllegalActionException in case it is an inactive user account, or the owner is
inactiveFrameworkException#checkActive(InternalAccountOwner)void checkActive(AccountOwner owner) throws FrameworkException
IllegalActionException in case it is a removed or pending userFrameworkExceptionClosedAccountBalance closeBalance(Account account) throws FrameworkException
FrameworkExceptionvoid createMissingOrActivateAccount(UserAccountType accountType, ProductOwner owner) throws FrameworkException
FrameworkExceptionSystemAccount createSystemAccount(SystemAccountType type) throws FrameworkException
FrameworkExceptionExternalPaymentNegativeAmountReservation dereserveAmount(ExternalPayment externalPayment)
OrderAmountReservation dereserveAmount(Order order) throws FrameworkException
FrameworkExceptionScheduledPaymentInstallmentAmountReservation dereserveAmount(ScheduledPaymentInstallment installment) throws FrameworkException
IllegalActionException - When the given installment is not in a state which allows dereserving amountFrameworkExceptionPendingAuthorizationAmountReservation dereserveAmountForAuthorization(BasePayment transaction) throws FrameworkException
IllegalActionException - When the given transfer is not in a state which allows returning the reserved amountFrameworkExceptionvoid disposeAccounts(User user, java.util.Collection<UserAccount> lostAccounts) throws IllegalActionException
user - lostAccounts - the accounts to be disposed ofIllegalActionException - if any of the accounts cannot be disposed of because of existing dependencies (scheduled payments, amount
reservations, balances).void disposeAllAccounts(User user) throws FrameworkException
FrameworkExceptionboolean accountNumberExistsOrIsReserved(AccountNumberConfiguration accountNumberConfiguration, java.lang.String accountNumber)
void fillTransSearchData(TransSearchData data, Account account, InternalAccountOwner accountOwner) throws FrameworkException
FrameworkExceptionAccount findByNumber(java.lang.String number) throws FrameworkException
EntityNotFoundException - If there are is no account with the given numberFrameworkExceptionjava.lang.String generateNumber(AccountType type, InternalAccountOwner owner) throws FrameworkException
FrameworkExceptionjava.util.List<Account> getAccountsByCurrency(Currency currency)
AccountStatusVO getAccountStatus(Account account, java.util.Date date, RateVisibility rateVisibility) throws FrameworkException
rateVisibility - if null RateVisibility.NOT is usedFrameworkExceptionjava.util.List<AccountWithStatusVO> getAccountsWithStatus(InternalAccountOwner accountOwner, java.util.Date date, java.util.Date receivedSince, boolean includeRates) throws FrameworkException
list(InternalAccountOwner), but returns each account with the account status, at the given time point.FrameworkExceptionjava.math.BigDecimal getAvailableBalance(Account account, java.util.Date date) throws FrameworkException
FrameworkExceptionjava.math.BigDecimal getAvailableBalanceByAccountType(InternalAccountOwner accountOwner, AccountType accountType)
java.math.BigDecimal getAverageBalance(Account account, java.math.BigDecimal balanceDiff, DatePeriod period, boolean positive, java.math.BigDecimal freebase) throws FrameworkException
FrameworkExceptionjava.math.BigDecimal getBalance(Account account, java.util.Date date) throws FrameworkException
FrameworkExceptionorg.cyclos.impl.utils.validation.Validator getCanDisposeValidator()
throws FrameworkException
FrameworkExceptioncanDispose(Collection)java.math.BigDecimal getCreditLimit(Account account, java.util.Date date) throws FrameworkException
FrameworkExceptionAccountLimitLog getLimitLog(Account account, java.util.Date date) throws FrameworkException
FrameworkExceptionjava.util.List<TransferStatusFlow> getManagedFlows(Account account) throws FrameworkException
FrameworkExceptionjava.lang.String getOwnerName(Account account) throws FrameworkException
FrameworkExceptionjava.math.BigDecimal getUpperCreditLimit(Account account, java.util.Date date) throws FrameworkException
FrameworkExceptionjava.util.List<UserAccountData> getUserAccountsData(User user) throws FrameworkException
FrameworkExceptionjava.util.List<TransferStatusFlow> getVisibleFlows(Account account) throws FrameworkException
FrameworkExceptionboolean hasAccess(Account account) throws FrameworkException
FrameworkExceptionboolean hasTransfers(java.util.Set<UserAccountType> userAccounts, java.util.Set<Group> groups)
void incrementBalanceCounter(Account account) throws FrameworkException
FrameworkExceptionboolean isOnlyOwnPayments(AccountType account) throws FrameworkException
FrameworkException<A extends Account> java.util.List<A> list(InternalAccountOwner owner) throws FrameworkException
FrameworkException<A extends Account> A load(AccountLocator locator) throws FrameworkException
FrameworkException<A extends Account> A load(InternalAccountOwner owner, AccountType type) throws FrameworkException
FrameworkExceptionvoid removeLastClosedAccountBalances(Transfer transfer)
ExternalPaymentAmountReservation reserveAmount(ExternalPayment externalPayment) throws InsufficientBalanceException
InsufficientBalanceException - When there is not enough funds on the expected account to reserveIllegalActionException - When the given external payment is not in a state which allows reserving amountOrderAmountReservation reserveAmount(Order order) throws FrameworkException, InsufficientBalanceException, IllegalActionException
InsufficientBalanceException - When there is not enough funds on the expected account to reserveIllegalActionException - When the given order is not in a state which allows reserving amountFrameworkExceptionScheduledPaymentAmountReservation reserveAmount(ScheduledPayment scheduledPayment) throws FrameworkException, InsufficientBalanceException, IllegalActionException
InsufficientBalanceException - When there is not enough funds on the expected account to reserveIllegalActionException - When the given scheduled payment is not in a state which allows reserving amountFrameworkExceptionPendingAuthorizationAmountReservation reserveAmountForAuthorization(BasePayment transaction) throws FrameworkException, InsufficientBalanceException, IllegalActionException
InsufficientBalanceException - When there is not enough funds on the expected account to reserveIllegalActionException - When the given transfer is not in a state which allows reserving amountFrameworkExceptionAccountWithStatusVO toAccountWithStatus(Account account, java.util.Date date, java.util.Date paymentsSince, boolean includeRates) throws FrameworkException
AccountWithStatusVO, getting the status at the given time point. If paymentsSince is not null, will
also
return the sum of incoming payments since the given dateFrameworkException