public interface AccountServiceLocal extends AccountService
AccountService| Modifier and Type | Interface and Description |
|---|---|
static class |
AccountServiceLocal.AdjustAccountsResult |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_ACCOUNT
Script bind variable: the account
|
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) |
static java.util.Set<UserStatus> |
POSSIBLE_STATUSES_TO_OWN_ACCOUNTS |
MAX_BALANCE_HISTORY_DATAPOINTS| 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
|
AccountServiceLocal.AdjustAccountsResult |
adjustAccounts(User user)
Creates / disposes accounts for the given user
|
void |
checkActive(Account account)
If the given account is not active, throws an
IllegalActionException |
void |
checkActive(AccountOwner owner)
If the given owner is a user which is either pending or removed, throes an
IllegalActionException |
void |
checkAvailableBalance(Account account,
java.math.BigDecimal amount)
Checks that the given account has enough balance for performing a payment with the given amount.
|
SystemAccount |
createSystemAccount(SystemAccountType type)
Creates a new system account
|
ExternalPaymentAmountReservation |
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
|
InstallmentAmountReservation |
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 |
fillTransSearchData(ITransSearchData data,
Account account,
InternalAccountOwner accountOwner,
ExportFormatContext exportContext)
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 the available accounts for the logged user filtered by 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
listVisible(InternalAccountOwner), but returns each account with the account status, at the
given time point. |
OrderAmountReservation |
getAmountDereservation(Order order)
Returns the
OrderAmountReservation that canceled the order reserved amount, or null if none |
PendingAuthorizationAmountReservation |
getAmountDereservationForAuthorization(BasePayment transaction)
Returns the
PendingAuthorizationAmountReservation created when a payment was no longer pending
authorization, or null if none |
OrderAmountReservation |
getAmountReservation(Order order)
Returns the
OrderAmountReservation that reserved amount when the order was submitted, or null if none |
PendingAuthorizationAmountReservation |
getAmountReservationForAuthorization(BasePayment transaction)
Returns the
PendingAuthorizationAmountReservation created when a payment was submitted for authorization,
or null if none |
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
|
AccountBalanceLimitLog |
getBalanceLimitLog(Account account,
java.util.Date date)
Returns the limit log which is valid on the given time.
|
java.math.BigDecimal |
getCreditLimit(Account account,
java.util.Date date)
Returns the credit limit of the given account at the given date
|
java.math.BigDecimal |
getCurrentAvailableBalance(Account account,
org.cyclos.impl.banking.NativeAccountStatus status)
Returns the available balance for the given account, given that the native account status was already fetched
|
java.util.List<TransferStatusFlow> |
getManagedFlows(Account account)
Returns the managed transfer status flows for the logged user over the given account
|
org.cyclos.impl.banking.NativeAccountStatus |
getNativeAccountStatus(Account account,
java.util.Date date)
Returns the native account status for the given account
|
java.lang.String |
getOwnerName(Account account)
Returns the owner name: if is a system account, get the system account type. otherwise, the name / username of
the owner user
|
org.cyclos.impl.banking.RestrictedOperatorAccessibleAccounts |
getRetrictedOperatorAccessibleAccounts(OperatorGroup group)
Returns which owner user accounts are accessible and how
|
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 |
hasAccessibleAccounts()
Returns true if the logged user has at least one accessible (not necessary visible) account.
|
boolean |
hasVisibility(Account account)
Returns whether the given account is visible by the logged user or not.
|
boolean |
hasVisibleAccounts()
Returns true if the logged user has at least one visible (and accessible) account.
|
boolean |
hasVisibleAccounts(InternalAccountOwner owner)
Returns whether there's at least one visible account of the logged user over the given owner
|
boolean |
isActive(Account account)
Returns whether the given account is active.
|
<A extends Account> |
list(InternalAccountOwner owner)
Returns the accessible accounts for the given owner.
|
<A extends Account> |
listAll(InternalAccountOwner owner)
Returns all the accounts for the given owner, regardless of the visibility.
|
<A extends Account> |
listVisible(InternalAccountOwner owner)
Returns the visible 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
|
<A extends Account> |
load(InternalAccountOwner owner,
AccountType type,
boolean allowDisposed)
Loads an account for the given owner / type, without checking permissions for the logged user.
|
void |
makeBalanceDirty(Account account,
Transfer transfer)
Marks the balance of the given account as dirty for given transfer.
|
void |
publishStatusChange(Account account)
Publishes the push notification events for account status change
|
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(PerformTransactionDTO performDto,
BasePayment transaction)
Reserves the amount for a pending by authorization payment created from the given DTO.
|
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. |
void |
updateBalance(Account account,
java.math.BigDecimal balance,
java.lang.Long[] dirtyTransferIds)
Updates the current account balance.
|
exportAccountBalanceLimitsOverview, exportAccountHistoriesOverview, exportAccountHistory, exportAccountPaymentAmountLimitsOverview, exportUsersWithBalances, getAccountBalanceHistory, getAccountBalanceLimitsOverviewData, getAccountHistoriesOverviewData, getAccountHistoriesOverviewStatus, getAccountHistoryData, getAccountHistoryStatus, getAccountPaymentAmountLimitsOverviewData, getAccountsSummary, getAccountStatus, getAccountWithStatus, getPermissions, getUserAccountBalanceLimitData, getUserAccountPaymentAmountLimitData, getUserAccountsBalanceLimits, getUserAccountsPaymentAmountLimits, getUsersWithBalancesOverview, getUserWithBalanceSearchData, load, searchAccountBalanceLimitsOverview, searchAccountHistoriesOverview, searchAccountHistory, searchAccountPaymentAmountLimitsOverview, searchUsersWithBalances, setBalanceLimit, setPaymentAmountLimitstatic final java.util.Set<UserStatus> POSSIBLE_STATUSES_TO_OWN_ACCOUNTS
static final java.lang.String ATTR_ACCOUNT
static 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)
AccountServiceLocal.AdjustAccountsResult adjustAccounts(User user)
void checkActive(Account account) throws IllegalActionException
IllegalActionExceptionIllegalActionExceptionisActive(Account)void checkActive(AccountOwner owner) throws IllegalActionException
IllegalActionExceptionIllegalActionExceptionvoid checkAvailableBalance(Account account, java.math.BigDecimal amount) throws InsufficientBalanceException, LockAcquisitionException
SystemAccount createSystemAccount(SystemAccountType type)
ExternalPaymentAmountReservation dereserveAmount(ExternalPayment externalPayment)
OrderAmountReservation dereserveAmount(Order order)
InstallmentAmountReservation 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 fillTransSearchData(ITransSearchData data, Account account, InternalAccountOwner accountOwner, ExportFormatContext exportContext)
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)
listVisible(InternalAccountOwner), but returns each account with the account status, at the
given time point.OrderAmountReservation getAmountDereservation(Order order)
OrderAmountReservation that canceled the order reserved amount, or null if nonePendingAuthorizationAmountReservation getAmountDereservationForAuthorization(BasePayment transaction)
PendingAuthorizationAmountReservation created when a payment was no longer pending
authorization, or null if noneOrderAmountReservation getAmountReservation(Order order)
OrderAmountReservation that reserved amount when the order was submitted, or null if nonePendingAuthorizationAmountReservation getAmountReservationForAuthorization(BasePayment transaction)
PendingAuthorizationAmountReservation created when a payment was submitted for authorization,
or null if nonejava.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)
AccountBalanceLimitLog getBalanceLimitLog(Account account, java.util.Date date)
java.math.BigDecimal getCreditLimit(Account account, java.util.Date date)
java.math.BigDecimal getCurrentAvailableBalance(Account account, org.cyclos.impl.banking.NativeAccountStatus status)
java.util.List<TransferStatusFlow> getManagedFlows(Account account)
org.cyclos.impl.banking.NativeAccountStatus getNativeAccountStatus(Account account, java.util.Date date)
java.lang.String getOwnerName(Account account)
org.cyclos.impl.banking.RestrictedOperatorAccessibleAccounts getRetrictedOperatorAccessibleAccounts(OperatorGroup group)
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)
hasVisibility(Account)boolean hasAccessibleAccounts()
boolean hasVisibility(Account account)
AccountAccessibility allow view it.
If an user can access an account then it can operate with it (e.g make/receive payments) regardless it's visible
or not.HomeData.VISIBLE_ACCOUNTS (only the visible accounts are shown in the home page)UserInitializationData.VISIBLE_ACCOUNTSboolean hasVisibleAccounts()
throws FrameworkException
FrameworkExceptionboolean hasVisibleAccounts(InternalAccountOwner owner)
boolean isActive(Account account)
<A extends Account> java.util.List<A> list(InternalAccountOwner owner)
<A extends Account> java.util.List<A> listAll(InternalAccountOwner owner)
<A extends Account> java.util.List<A> listVisible(InternalAccountOwner owner)
<A extends Account> A load(AccountLocator locator)
<A extends Account> A load(InternalAccountOwner owner, AccountType type)
<A extends Account> A load(InternalAccountOwner owner, AccountType type, boolean allowDisposed)
void makeBalanceDirty(Account account, Transfer transfer)
void publishStatusChange(Account account)
account - 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(PerformTransactionDTO performDto, 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 datevoid updateBalance(Account account, java.math.BigDecimal balance, java.lang.Long[] dirtyTransferIds)