Package org.cyclos.impl.banking
Interface AccountServiceLocal
-
- All Superinterfaces:
AccountService,Service
public interface AccountServiceLocal extends AccountService
Local interface forAccountService
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAccountServiceLocal.AdjustAccountsResult
-
Field Summary
Fields Modifier and Type Field Description static StringACCOUNT_PREFIXThis prefix resolves to the first account of a user (used when resolving variables/thymeleaf helpers).static StringATTR_ACCOUNTScript bind variable: the accountstatic StringATTR_ACCOUNT_TYPEScript bind variable: the account typestatic StringATTR_OWNERScript bind variable: the account owner (either anUserorSystemAccountOwner)static StringEXPORTUsed to know if it is an exportstatic Set<UserStatus>POSSIBLE_STATUSES_TO_OWN_ACCOUNTS-
Fields inherited from interface org.cyclos.services.banking.AccountService
MAX_BALANCE_HISTORY_DATAPOINTS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanaccountNumberExistsOrIsReserved(AccountNumberConfiguration accountNumberConfiguration, String accountNumber)Returns true if the given account number is used in an existing account or is reserved to be used for a pending userdefault AccountServiceLocal.AdjustAccountsResultadjustAccounts(User user)Creates / disposes accounts for the given user not allowing initial creditAccountServiceLocal.AdjustAccountsResultadjustAccounts(User user, boolean allowInitialCredit)Creates / disposes accounts for the given user, optionally allowing initial creditvoidapplyQueryConstraints(AbstractTransQuery query)Checks that both begin and end date, if any, resides in the data retention period.voidcheckActive(Account account)If the given account is not active, throws anIllegalActionExceptionvoidcheckActive(AccountOwner owner)If the given owner is a user which is either pending or removed, throes anIllegalActionExceptionvoidcheckAvailableBalance(Account account, BigDecimal amount)Checks that the given account has enough balance for performing a payment with the given amount.SystemAccountcreateSystemAccount(SystemAccountType type)Creates a new system accountExternalPaymentAmountReservationdereserveAmount(ExternalPayment externalPayment)Cancels the amount reservation related to the given external paymentInstallmentAmountReservationdereserveAmount(ScheduledPaymentInstallment installment)Dereserves the amount for the given installmentTicketAmountReservationdereserveAmount(Ticket ticket)Returns the reserved ticket approved amount, if anyOrderAmountReservationdereserveAmount(Order order)Cancels the amount reservation related to the given orderPendingAuthorizationAmountReservationdereserveAmountForAuthorization(BasePayment transaction)Dereserves the amount for the transaction which was previously awaiting authorizationVoucherAmountReservationdereserveAmountIfNeeded(Voucher voucher)If the voucher pack had an amount reservation, dereserve the amount for the given vouchervoidfillTransSearchData(ITransSearchData data, Account account, InternalAccountOwner accountOwner, ExportFormatContext exportContext, TransSearchContext transSearchContext)Fills the given data with data common to transfer and transaction search.AccountfindByNumber(String number)Returns the account with the given numberStringgenerateNumber(AccountType type, InternalAccountOwner owner)Generates an unique account number for the given type and owner.AccountHistoryStatusVOgetAccountHistoryStatus(Account account, AccountHistoryQuery params)Returns historic status for the accountSet<Long>getAccountIdsWithTransactions(Set<UserAccountType> accTypes, User owner)Returns the ids of the accounts that have transactions for the given owner and of the given account typesAccountStatusVOgetAccountStatus(Account account, Date date, RateVisibility rateVisibility)Returns the account status for the given account at the given timeList<AccountWithStatusVO>getAccountsWithStatus(InternalAccountOwner accountOwner, Date date, Date receivedSince, boolean includeRates)Similar tolistVisible(InternalAccountOwner), but returns each account with the account status, at the given time point.OrderAmountReservationgetAmountDereservation(Order order)Returns theOrderAmountReservationthat canceled the order reserved amount, or null if nonePendingAuthorizationAmountReservationgetAmountDereservationForAuthorization(BasePayment transaction)Returns thePendingAuthorizationAmountReservationcreated when a payment was no longer pending authorization, or null if noneOrderAmountReservationgetAmountReservation(Order order)Returns theOrderAmountReservationthat reserved amount when the order was submitted, or null if nonePendingAuthorizationAmountReservationgetAmountReservationForAuthorization(BasePayment transaction)Returns thePendingAuthorizationAmountReservationcreated when a payment was submitted for authorization, or null if noneBigDecimalgetAvailableBalance(Account account, Date date)Returns the available balance for the given account at the given dateBigDecimalgetAverageBalance(Account account, BigDecimal balanceDiff, DatePeriod period, boolean positive, BigDecimal freebase)Returns the balance average for the given account over the given period.BigDecimalgetBalance(Account account, Date date)Returns the raw balance for the given account at the given timeAccountBalanceLimitLoggetBalanceLimitLog(Account account, Date date)Returns the limit log which is valid on the given time.BigDecimalgetCreditLimit(Account account, Date date)Returns the credit limit of the given account at the given dateBigDecimalgetCurrentAvailableBalance(Account account, NativeAccountStatus status)Returns the available balance for the given account, given that the native account status was already fetchedFrontendDashboardAccountVOgetFrontendDashbordAcccount(Account account, int lastTransfers)Returns data for an account to be used in the new frontend dashboardList<TransferStatusFlow>getManagedFlows(Account account)Returns the managed transfer status flows for the logged user over the given accountNativeAccountStatusgetNativeAccountStatus(Account account, Date date)Returns the native account status for the given accountStringgetOwnerName(Account account)Returns the owner name: if is a system account, get the system account type.AccountPermissionsDatagetPermissions(@NotNull Account account)Returns permissions of what the logged user can do over the given accountRestrictedOperatorAccessibleAccountsgetRetrictedOperatorAccessibleAccounts()Returns which owner user accounts types are accessible and how by the logged restricted operator.BigDecimalgetUpperCreditLimit(Account account, Date date)Returns the upper credit limit of the given account at the given dateList<UserAccountData>getUserAccountsData(User user)Returns the user's accounts data visible in profileMap<UserAccountType,Boolean>getVisibilitySettings(BasicUser user)Returns the stored account visibility settings for the given userList<TransferStatusFlow>getVisibleFlows(Account account)Returns the visible transfer status flows for the logged user over the given accountbooleanhasTransfers(Account account)Returns whether the given account has at least a transferbooleanisActive(IAccount account)Returns whether the given account is active.booleanisUserAccountVisibleBySettings(UserAccountType accountType, MemberProductAccessor accountTypeAccessor, Map<UserAccountType,Boolean> settingsByType)This method check for the account visibility settings ONLY FOR THE LOGGED USER.<A extends Account>
List<A>listVisible(InternalAccountOwner owner)Returns the visible accounts for the given owner.List<Currency>listVisibleCurrencies(InternalAccountOwner owner)Calls listVisibleTypes(), but projecting each account currencyList<Currency>listVisibleOrGrantedCurrencies(User user)If the given used is same as the logged return the visible currencies (likewiselistVisibleCurrencies(InternalAccountOwner)Otherwise returns the currencies from the granted account types (ProductsAccessor.grantedCurrencies())<A extends AccountType>
List<A>listVisibleTypes(InternalAccountOwner owner)Calls listVisible(), but projecting each account type<A extends Account>
Aload(AccountLocator locator)Loads an account for the given locator, without checking permissions for the logged user For user accounts, if the account is not found yet, returns a transient account.<A extends Account>
Aload(InternalAccountOwner owner, String name)Loads an account by name for the given owner.<A extends Account>
Aload(InternalAccountOwner owner, AccountType type)Loads an account for the given owner / type, without checking permissions for the logged user For user accounts, if the account is not found yet, returns a transient account.<A extends Account>
Aload(InternalAccountOwner owner, AccountType type, boolean allowDisposed)Loads an account for the given owner / type, without checking permissions for the logged user.voidmakeBalanceDirty(Account account, Transfer transfer)Marks the balance of the given account as dirty for given transfer.ChargebackDescriptionFillernewChargebackDescriptionFiller()Creates a new instance ofChargebackDescriptionFiller.<Q extends AbstractTransQuery>
QnewQuery(Class<Q> type, List<CustomFieldDetailedVO> customFields)Returns a new instance of the given type, filled-in with basic data and the default custom values for search.VOFiller<AccountVO>newVOFiller()Returns aVOFillerfor accountsVoucherTransactionAmountReservationprocessReservationIfNeeded(VoucherTransaction voucherTransaction)Processes the amount reservation, if needed, for the given voucher transaction.voidreactivateAccounts(long accountTypeId, long basicGroupId)Reactivates physical accounts of the given type and basic group.
This is only called by a script triggered by theProductsGroupServiceLocalvoidremoveLastClosedAccountBalances(Transfer transfer)Removes all the closes from the initial date to now of the from and to account of the transfer.<A extends Account>
Arequire(InternalAccountOwner owner, AccountType type)Loads an account for the given owner / type, without checking permissions for the logged user.VoucherAmountReservationreReserveAmountIfNeeded(Voucher voucher)When the voucher was expired, the amount was de-reserved.CustomAmountReservationreserveAmount(Account account, BigDecimal amount)Reserves the given amount for an account checking its available balance.
WARNING: Intended to be used via scripts (it can't be removed after a static analysis).CustomAmountReservationreserveAmount(Account account, BigDecimal amount, boolean ignoreAccountLimits)Reserves the given amount for an account ignoring the limits only ifignoreAccountLimitsis true.
WARNING: Intended to be used via scripts (it can't be removed after a static analysis).ExternalPaymentAmountReservationreserveAmount(ExternalPayment externalPayment)Reserves the amount for the given external paymentScheduledPaymentAmountReservationreserveAmount(ScheduledPayment scheduledPayment)Reserves the total amount for the given scheduled paymentTicketAmountReservationreserveAmount(Ticket ticket)Reserves the ticket approved amount, depending on the payment type settingsOrderAmountReservationreserveAmount(Order order)Reserves the amount for the given webshop orderPendingAuthorizationAmountReservationreserveAmountForAuthorization(PerformTransactionDTO performDto, BasePayment transaction)Reserves the amount for a pending by authorization payment created from the given DTO.VoucherUnblockAmountReservationreserveAmountForUnblocking(Voucher voucher)Reserves the amount for unblocking a blocked voucherVoucherPackAmountReservationreserveAmountIfNeeded(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.List<PeriodPreselectorOptionData>resolvePreselectedPeriods(boolean ignorePeriodsStartingBeforeArchivingDate)Resolve the available preselected periods for the logged user configurationvoidsendStatusPushNotification(Account account)Sends the push notification event with the current account status.booleanshouldAdjustAccountsWhenAssigning(MemberProduct product)Indicates whether user accounts should be adjusted if the given member product is assigned to a group / group setAccountWithStatusVOtoAccountWithStatus(Account account, Date date, Date paymentsSince, boolean includeRates)Converts the given account withAccountWithStatusVO, getting the status at the given time point.voidupdateBalance(Account account, BigDecimal balance, Long[] dirtyTransferIds)Updates the current account balance.-
Methods inherited from interface org.cyclos.services.banking.AccountService
exportAccountBalanceLimitsOverview, exportAccountHistoriesOverview, exportAccountHistory, exportAccountPaymentAmountLimitsOverview, exportArchivedAccountHistory, exportArchivedTransfer, exportUsersWithBalances, getAccountBalanceHistory, getAccountBalanceLimitsOverviewData, getAccountHistoriesOverviewData, getAccountHistoriesOverviewStatus, getAccountHistoryData, getAccountHistoryStatus, getAccountPaymentAmountLimitsOverviewData, getAccountsSummary, getAccountStatus, getAccountWithStatus, getArchivedAccountHistoryData, getArchivedTransferData, getPermissions, getUserAccountBalanceLimitData, getUserAccountPaymentAmountLimitData, getUserAccountsBalanceLimits, getUserAccountsPaymentAmountLimits, getUsersWithBalancesOverview, getUserWithBalanceSearchData, load, searchAccountBalanceLimitsOverview, searchAccountHistoriesOverview, searchAccountHistory, searchAccountPaymentAmountLimitsOverview, searchArchivedAccountHistory, searchUsersWithBalances, setBalanceLimit, setPaymentAmountLimit
-
-
-
-
Field Detail
-
ACCOUNT_PREFIX
static final String ACCOUNT_PREFIX
This prefix resolves to the first account of a user (used when resolving variables/thymeleaf helpers).- See Also:
- Constant Field Values
-
POSSIBLE_STATUSES_TO_OWN_ACCOUNTS
static final Set<UserStatus> POSSIBLE_STATUSES_TO_OWN_ACCOUNTS
-
ATTR_ACCOUNT
static final String ATTR_ACCOUNT
Script bind variable: the account- See Also:
- Constant Field Values
-
ATTR_ACCOUNT_TYPE
static final String ATTR_ACCOUNT_TYPE
Script bind variable: the account type- See Also:
- Constant Field Values
-
ATTR_OWNER
static final String ATTR_OWNER
Script bind variable: the account owner (either anUserorSystemAccountOwner)- See Also:
- Constant Field Values
-
EXPORT
static final String EXPORT
Used to know if it is an export- See Also:
- Constant Field Values
-
-
Method Detail
-
accountNumberExistsOrIsReserved
boolean accountNumberExistsOrIsReserved(AccountNumberConfiguration accountNumberConfiguration, 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
-
adjustAccounts
default AccountServiceLocal.AdjustAccountsResult adjustAccounts(User user)
Creates / disposes accounts for the given user not allowing initial credit
-
adjustAccounts
AccountServiceLocal.AdjustAccountsResult adjustAccounts(User user, boolean allowInitialCredit)
Creates / disposes accounts for the given user, optionally allowing initial credit
-
applyQueryConstraints
void applyQueryConstraints(AbstractTransQuery query)
Checks that both begin and end date, if any, resides in the data retention period. Updates the date if the begin date is null, setting it to the archiving date. No-op when there's no retention window.
-
checkActive
void checkActive(Account account) throws IllegalActionException
If the given account is not active, throws anIllegalActionException- Throws:
IllegalActionException- See Also:
isActive(IAccount)
-
checkActive
void checkActive(AccountOwner owner) throws IllegalActionException
If the given owner is a user which is either pending or removed, throes anIllegalActionException- Throws:
IllegalActionException
-
checkAvailableBalance
void checkAvailableBalance(Account account, BigDecimal amount) throws InsufficientBalanceException, LockAcquisitionException
Checks that the given account has enough balance for performing a payment with the given amount.
-
createSystemAccount
SystemAccount createSystemAccount(SystemAccountType type)
Creates a new system account
-
dereserveAmount
ExternalPaymentAmountReservation dereserveAmount(ExternalPayment externalPayment)
Cancels the amount reservation related to the given external payment
-
dereserveAmount
OrderAmountReservation dereserveAmount(Order order)
Cancels the amount reservation related to the given order
-
dereserveAmount
InstallmentAmountReservation dereserveAmount(ScheduledPaymentInstallment installment)
Dereserves the amount for the given installment- Throws:
IllegalActionException- When the given installment is not in a state which allows dereserving amount
-
dereserveAmount
TicketAmountReservation dereserveAmount(Ticket ticket)
Returns the reserved ticket approved amount, if any
-
dereserveAmountForAuthorization
PendingAuthorizationAmountReservation dereserveAmountForAuthorization(BasePayment transaction)
Dereserves the amount for the transaction which was previously awaiting authorization- Throws:
IllegalActionException- When the given transfer is not in a state which allows returning the reserved amount
-
dereserveAmountIfNeeded
VoucherAmountReservation dereserveAmountIfNeeded(Voucher voucher)
If the voucher pack had an amount reservation, dereserve the amount for the given voucher
-
fillTransSearchData
void fillTransSearchData(ITransSearchData data, Account account, InternalAccountOwner accountOwner, ExportFormatContext exportContext, TransSearchContext transSearchContext)
Fills the given data with data common to transfer and transaction search. A source account can be provided to retrieve more specific data.
-
findByNumber
Account findByNumber(String number)
Returns the account with the given number- Throws:
EntityNotFoundException- If there are is no account with the given number
-
generateNumber
String generateNumber(AccountType type, InternalAccountOwner owner)
Generates an unique account number for the given type and owner. This method can not only be internally used when an account is created, but scripts could benefit from it to generate numbers for existing accounts.
-
getAccountHistoryStatus
AccountHistoryStatusVO getAccountHistoryStatus(Account account, AccountHistoryQuery params)
Returns historic status for the account
-
getAccountIdsWithTransactions
Set<Long> getAccountIdsWithTransactions(Set<UserAccountType> accTypes, User owner)
Returns the ids of the accounts that have transactions for the given owner and of the given account types
-
getAccountStatus
AccountStatusVO getAccountStatus(Account account, Date date, RateVisibility rateVisibility)
Returns the account status for the given account at the given time- Parameters:
rateVisibility- if nullRateVisibility.NOTis used
-
getAccountsWithStatus
List<AccountWithStatusVO> getAccountsWithStatus(InternalAccountOwner accountOwner, Date date, Date receivedSince, boolean includeRates)
Similar tolistVisible(InternalAccountOwner), but returns each account with the account status, at the given time point.
-
getAmountDereservation
OrderAmountReservation getAmountDereservation(Order order)
Returns theOrderAmountReservationthat canceled the order reserved amount, or null if none
-
getAmountDereservationForAuthorization
PendingAuthorizationAmountReservation getAmountDereservationForAuthorization(BasePayment transaction)
Returns thePendingAuthorizationAmountReservationcreated when a payment was no longer pending authorization, or null if none
-
getAmountReservation
OrderAmountReservation getAmountReservation(Order order)
Returns theOrderAmountReservationthat reserved amount when the order was submitted, or null if none
-
getAmountReservationForAuthorization
PendingAuthorizationAmountReservation getAmountReservationForAuthorization(BasePayment transaction)
Returns thePendingAuthorizationAmountReservationcreated when a payment was submitted for authorization, or null if none
-
getAvailableBalance
BigDecimal getAvailableBalance(Account account, Date date)
Returns the available balance for the given account at the given date
-
getAverageBalance
BigDecimal getAverageBalance(Account account, BigDecimal balanceDiff, DatePeriod period, boolean positive, BigDecimal freebase)
Returns the balance average for the given account over the given period. It is calculated per day, having the balance at the end of each day, averaging by the number of days the balance was unchanged. It can be calculated either over positive or negative balances, and taking the free base into account (which is subtracted from each day's balance when calculating the total). If present, the balanceDiff is summed to the initial balance when performing calculations.
-
getBalance
BigDecimal getBalance(Account account, Date date)
Returns the raw balance for the given account at the given time
-
getBalanceLimitLog
AccountBalanceLimitLog getBalanceLimitLog(Account account, Date date)
Returns the limit log which is valid on the given time. When the time is null, the current time is assumed
-
getCreditLimit
BigDecimal getCreditLimit(Account account, Date date)
Returns the credit limit of the given account at the given date
-
getCurrentAvailableBalance
BigDecimal getCurrentAvailableBalance(Account account, NativeAccountStatus status)
Returns the available balance for the given account, given that the native account status was already fetched
-
getFrontendDashbordAcccount
FrontendDashboardAccountVO getFrontendDashbordAcccount(Account account, int lastTransfers)
Returns data for an account to be used in the new frontend dashboard
-
getManagedFlows
List<TransferStatusFlow> getManagedFlows(Account account)
Returns the managed transfer status flows for the logged user over the given account
-
getNativeAccountStatus
NativeAccountStatus getNativeAccountStatus(Account account, Date date)
Returns the native account status for the given account
-
getOwnerName
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
-
getPermissions
AccountPermissionsData getPermissions(@NotNull @NotNull Account account)
Returns permissions of what the logged user can do over the given account- Throws:
PermissionDeniedException- if the given account is not managed by the authenticated user- See Also:
AccountService.getPermissions(AccountVO)
-
getRetrictedOperatorAccessibleAccounts
RestrictedOperatorAccessibleAccounts getRetrictedOperatorAccessibleAccounts()
Returns which owner user accounts types are accessible and how by the logged restricted operator. If not logged-in as a restricted operator, returns null.
-
getUpperCreditLimit
BigDecimal getUpperCreditLimit(Account account, Date date)
Returns the upper credit limit of the given account at the given date
-
getUserAccountsData
List<UserAccountData> getUserAccountsData(User user)
Returns the user's accounts data visible in profile
-
getVisibilitySettings
Map<UserAccountType,Boolean> getVisibilitySettings(BasicUser user)
Returns the stored account visibility settings for the given user
-
getVisibleFlows
List<TransferStatusFlow> getVisibleFlows(Account account)
Returns the visible transfer status flows for the logged user over the given account
-
hasTransfers
boolean hasTransfers(Account account)
Returns whether the given account has at least a transfer
-
isActive
boolean isActive(IAccount account)
Returns whether the given account is active. System accounts are always active. User accounts are active if the owner is not pending or removed and have at least one product that enables that account type.
-
isUserAccountVisibleBySettings
boolean isUserAccountVisibleBySettings(UserAccountType accountType, MemberProductAccessor accountTypeAccessor, Map<UserAccountType,Boolean> settingsByType)
This method check for the account visibility settings ONLY FOR THE LOGGED USER.
-
listVisible
<A extends Account> List<A> listVisible(InternalAccountOwner owner)
Returns the visible accounts for the given owner.
-
listVisibleCurrencies
List<Currency> listVisibleCurrencies(InternalAccountOwner owner)
Calls listVisibleTypes(), but projecting each account currency
-
listVisibleOrGrantedCurrencies
List<Currency> listVisibleOrGrantedCurrencies(User user)
If the given used is same as the logged return the visible currencies (likewiselistVisibleCurrencies(InternalAccountOwner)Otherwise returns the currencies from the granted account types (ProductsAccessor.grantedCurrencies())
-
listVisibleTypes
<A extends AccountType> List<A> listVisibleTypes(InternalAccountOwner owner)
Calls listVisible(), but projecting each account type
-
load
<A extends Account> A load(AccountLocator locator)
Loads an account for the given locator, without checking permissions for the logged user For user accounts, if the account is not found yet, returns a transient account.
-
load
<A extends Account> A load(InternalAccountOwner owner, AccountType type)
Loads an account for the given owner / type, without checking permissions for the logged user For user accounts, if the account is not found yet, returns a transient account.
-
load
<A extends Account> A load(InternalAccountOwner owner, AccountType type, boolean allowDisposed)
Loads an account for the given owner / type, without checking permissions for the logged user. Depending on the flag will return an account even if it was disposed. For user accounts, if the account is not found yet, returns a transient account.
-
load
<A extends Account> A load(InternalAccountOwner owner, String name)
Loads an account by name for the given owner. In case the account type couldn't be found then loads the first visible account for the owner.
-
makeBalanceDirty
void makeBalanceDirty(Account account, Transfer transfer)
Marks the balance of the given account as dirty for given transfer.
-
newChargebackDescriptionFiller
ChargebackDescriptionFiller newChargebackDescriptionFiller()
Creates a new instance ofChargebackDescriptionFiller.
-
newQuery
<Q extends AbstractTransQuery> Q newQuery(Class<Q> type, List<CustomFieldDetailedVO> customFields)
Returns a new instance of the given type, filled-in with basic data and the default custom values for search.
-
processReservationIfNeeded
VoucherTransactionAmountReservation processReservationIfNeeded(VoucherTransaction voucherTransaction)
Processes the amount reservation, if needed, for the given voucher transaction. For top-ups, a positive amount. For redeems, a negative amount. If no amount should be reserved, returns null.
-
reactivateAccounts
void reactivateAccounts(long accountTypeId, long basicGroupId)Reactivates physical accounts of the given type and basic group.
This is only called by a script triggered by theProductsGroupServiceLocal
-
removeLastClosedAccountBalances
void removeLastClosedAccountBalances(Transfer transfer)
Removes all the closes from the initial date to now of the from and to account of the transfer. Also removes the account_balance row for both accounts
-
require
<A extends Account> A require(InternalAccountOwner owner, AccountType type)
Loads an account for the given owner / type, without checking permissions for the logged user. For user accounts, if the account is not found yet, will physically create one.
-
reReserveAmountIfNeeded
VoucherAmountReservation reReserveAmountIfNeeded(Voucher voucher)
When the voucher was expired, the amount was de-reserved. If an admin changes the expiration date to the future, the voucher is re-opened. In this case we also must re-reserve the amount that was de-reserved.
-
reserveAmount
CustomAmountReservation reserveAmount(Account account, BigDecimal amount)
Reserves the given amount for an account checking its available balance.
WARNING: Intended to be used via scripts (it can't be removed after a static analysis).- Returns:
- If the amount is zero returns null, otherwise the reservation.
- Throws:
InsufficientBalanceException- When there is not enough funds on the expected account to reserve
-
reserveAmount
CustomAmountReservation reserveAmount(Account account, BigDecimal amount, boolean ignoreAccountLimits)
Reserves the given amount for an account ignoring the limits only ifignoreAccountLimitsis true.
WARNING: Intended to be used via scripts (it can't be removed after a static analysis).- Returns:
- If the amount is zero returns null, otherwise the reservation.
- Throws:
InsufficientBalanceException- When there is not enough funds on the expected account to reserve
-
reserveAmount
ExternalPaymentAmountReservation reserveAmount(ExternalPayment externalPayment)
Reserves the amount for the given external payment- Throws:
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 amount
-
reserveAmount
OrderAmountReservation reserveAmount(Order order)
Reserves the amount for the given webshop order- Throws:
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 amount
-
reserveAmount
ScheduledPaymentAmountReservation reserveAmount(ScheduledPayment scheduledPayment)
Reserves the total amount for the given scheduled payment- Throws:
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 amount
-
reserveAmount
TicketAmountReservation reserveAmount(Ticket ticket)
Reserves the ticket approved amount, depending on the payment type settings
-
reserveAmountForAuthorization
PendingAuthorizationAmountReservation reserveAmountForAuthorization(PerformTransactionDTO performDto, BasePayment transaction)
Reserves the amount for a pending by authorization payment created from the given DTO.- Throws:
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 amount
-
reserveAmountForUnblocking
VoucherUnblockAmountReservation reserveAmountForUnblocking(Voucher voucher)
Reserves the amount for unblocking a blocked voucher
-
reserveAmountIfNeeded
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. If it is an unlimited account, just returns null.- Throws:
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 amount
-
resolvePreselectedPeriods
List<PeriodPreselectorOptionData> resolvePreselectedPeriods(boolean ignorePeriodsStartingBeforeArchivingDate)
Resolve the available preselected periods for the logged user configuration- Parameters:
ignorePeriodsStartingBeforeArchivingDate-
-
sendStatusPushNotification
void sendStatusPushNotification(Account account)
Sends the push notification event with the current account status. No-op if the parameter isn't an user account.
-
shouldAdjustAccountsWhenAssigning
boolean shouldAdjustAccountsWhenAssigning(MemberProduct product)
Indicates whether user accounts should be adjusted if the given member product is assigned to a group / group set
-
toAccountWithStatus
AccountWithStatusVO toAccountWithStatus(Account account, Date date, Date paymentsSince, boolean includeRates)
Converts the given account withAccountWithStatusVO, 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
-
updateBalance
void updateBalance(Account account, BigDecimal balance, Long[] dirtyTransferIds)
Updates the current account balance. IMPORTANT! This method should only be called after acquiring a lock for the given account, to ensure consistency. This method calls the native update_balance function.
-
-