Class AccountOrchestrator
java.lang.Object
com.bluebell.greenhouse.planter.orchestrators.account.AccountOrchestrator
- All Implemented Interfaces:
GenericOrchestrator
@Service
@Transactional
public class AccountOrchestrator
extends Object
implements GenericOrchestrator
Owns the unit of work for the
Account endpoints.- Version:
- 3.0.5
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNewAccount(CreateUpdateAccountDTO data, PortfolioRequestContext context) Creates a newAccountunder an owned portfolio.voidDeletes an ownedAccountand reassigns what remains in its portfolio.Generates the downloadable report for an ownedAccount.getAccountDetails(AccountRequestContext context) Obtains the details for an ownedAccount.booleanRefreshes an ownedAccount's balance.updateAccount(AccountPortfolioRequestContext context, CreateUpdateAccountDTO data) Updates an ownedAccount.booleanupdateAccountPositionDataFromMT4(MT4AccountPositionDataDTO data, String strategyReferenceCode) Creates or updates imported position data from the given MT4 payload.updateAccountStrategy(AccountRequestContext context, UpdateAccountStrategyDTO data) Updates the strategy assigned to an ownedAccount.intReassigns the given accounts to the portfolios named in the payload.
-
Constructor Details
-
AccountOrchestrator
public AccountOrchestrator()
-
-
Method Details
-
getAccountDetails
@Transactional(readOnly=true) public AccountDetails getAccountDetails(AccountRequestContext context) Obtains the details for an ownedAccount.- Parameters:
context-AccountRequestContext- Returns:
AccountDetails
-
generateAccountReport
@Transactional(readOnly=true) public File generateAccountReport(AccountRequestContext context) throws IOException Generates the downloadable report for an ownedAccount.- Parameters:
context-AccountRequestContext- Returns:
- generated
File - Throws:
IOException- when the report cannot be written
-
createNewAccount
Creates a newAccountunder an owned portfolio.- Parameters:
data-CreateUpdateAccountDTOcontext-PortfolioRequestContext- Returns:
AccountDTO
-
refreshAccountBalance
Refreshes an ownedAccount's balance.- Parameters:
context-AccountRequestContext- Returns:
- true when the refresh produced an account
-
updateAccount
public AccountDTO updateAccount(AccountPortfolioRequestContext context, CreateUpdateAccountDTO data) Updates an ownedAccount.- Parameters:
context-AccountPortfolioRequestContextdata-CreateUpdateAccountDTO- Returns:
AccountDTO
-
updateAccountStrategy
public AccountDTO updateAccountStrategy(AccountRequestContext context, UpdateAccountStrategyDTO data) Updates the strategy assigned to an ownedAccount.- Parameters:
context-AccountRequestContextdata-UpdateAccountStrategyDTO- Returns:
AccountDTO
-
deleteAccount
Deletes an ownedAccountand reassigns what remains in its portfolio.- Parameters:
context-AccountDeletionRequestContext
-
updateAccountPositionDataFromMT4
public boolean updateAccountPositionDataFromMT4(MT4AccountPositionDataDTO data, String strategyReferenceCode) Creates or updates imported position data from the given MT4 payload.- Parameters:
data-MT4AccountPositionDataDTOstrategyReferenceCode- reference code of the strategy to attribute the data to- Returns:
- true if the data was ingested
-
updatePortfolioAssignments
Reassigns the given accounts to the portfolios named in the payload.- Parameters:
data-UpdateAccountPortfolioAssignmentsDTOuser-Usermaking the change- Returns:
- count of reassigned accounts
-