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
|
VoucherAmountReservation |
dereserveAmountIfNeeded(Voucher voucher)
If the voucher pack had an amount reservation, dereserve the amount for the given voucher
|
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
|
VoucherPackAmountReservation |
reserveAmountIfNeeded(VoucherPack voucherPack)
Reserves the total amount for the given voucher pack (count * amount) on the source account of the redeem type,
if that account is limited.
|
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. |
exportAccountHistoryToCSV, exportAccountLimitsToCSV, exportHistoriesOverviewToCSV, exportUserBalanceToCSV, getAccountBalanceLimitsOverviewData, getAccountHistoriesOverviewData, getAccountHistoryData, getAccountHistoryStatus, getAccountsSummary, getAccountStatus, getAccountWithStatus, getPermissions, 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 accountNumberExistsOrIsReserved(AccountNumberConfiguration accountNumberConfiguration, java.lang.String accountNumber)
boolean canDispose(java.util.Collection<UserAccount> accounts)
void checkActive(Account account)
IllegalActionException in case it is an inactive
user account, or the owner is
inactive#checkActive(InternalAccountOwner)void checkActive(AccountOwner owner)
IllegalActionException in case it is a removed
or pending userClosedAccountBalance closeBalance(Account account)
void createMissingOrActivateAccount(UserAccountType accountType, ProductOwner owner)
SystemAccount createSystemAccount(SystemAccountType type)
ExternalPaymentNegativeAmountReservation dereserveAmount(ExternalPayment externalPayment)
OrderAmountReservation dereserveAmount(Order order)
ScheduledPaymentInstallmentAmountReservation dereserveAmount(ScheduledPaymentInstallment installment)
IllegalActionException - When the given installment is not in a state which allows dereserving amountPendingAuthorizationAmountReservation dereserveAmountForAuthorization(BasePayment transaction)
IllegalActionException - When the given transfer is not in a state which allows returning the reserved
amountVoucherAmountReservation dereserveAmountIfNeeded(Voucher voucher)
void disposeAccounts(User user, java.util.Collection<UserAccount> lostAccounts)
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)
void fillTransSearchData(TransSearchData data, Account account, InternalAccountOwner accountOwner)
Account findByNumber(java.lang.String number)
EntityNotFoundException - If there are is no account with the given numberjava.lang.String generateNumber(AccountType type, InternalAccountOwner owner)
java.util.List<Account> getAccountsByCurrency(Currency currency)
AccountStatusVO getAccountStatus(Account account, java.util.Date date, RateVisibility rateVisibility)
rateVisibility - if null RateVisibility.NOT is usedjava.util.List<AccountWithStatusVO> getAccountsWithStatus(InternalAccountOwner accountOwner, java.util.Date date, java.util.Date receivedSince, boolean includeRates)
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)
java.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)
java.math.BigDecimal getBalance(Account account, java.util.Date date)
org.cyclos.impl.utils.validation.Validator getCanDisposeValidator()
canDispose(Collection)java.math.BigDecimal getCreditLimit(Account account, java.util.Date date)
AccountLimitLog getLimitLog(Account account, java.util.Date date)
java.util.List<TransferStatusFlow> getManagedFlows(Account account)
java.lang.String getOwnerName(Account account)
java.math.BigDecimal getUpperCreditLimit(Account account, java.util.Date date)
java.util.List<UserAccountData> getUserAccountsData(User user)
java.util.List<TransferStatusFlow> getVisibleFlows(Account account)
boolean hasAccess(Account account)
boolean hasTransfers(java.util.Set<UserAccountType> userAccounts, java.util.Set<Group> groups)
void incrementBalanceCounter(Account account)
boolean isOnlyOwnPayments(AccountType account)
<A extends Account> java.util.List<A> list(InternalAccountOwner owner)
<A extends Account> A load(AccountLocator locator)
<A extends Account> A load(InternalAccountOwner owner, AccountType type)
void removeLastClosedAccountBalances(Transfer transfer)
ExternalPaymentAmountReservation reserveAmount(ExternalPayment externalPayment)
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)
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 amountScheduledPaymentAmountReservation reserveAmount(ScheduledPayment scheduledPayment)
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 amountPendingAuthorizationAmountReservation reserveAmountForAuthorization(BasePayment transaction)
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 amountVoucherPackAmountReservation reserveAmountIfNeeded(VoucherPack voucherPack)
InsufficientBalanceException - When there is not enough funds on the expected account to reserveIllegalActionException - When the given voucher pack is not in a state which allows reserving amountAccountWithStatusVO toAccountWithStatus(Account account, java.util.Date date, java.util.Date paymentsSince, boolean includeRates)
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 date