Class AccountApiController
java.lang.Object
com.bluebell.greenhouse.planter.controllers.account.AccountApiController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> Deletes anAccountwith the matching account number.org.springframework.http.ResponseEntity<AccountDetails> getAccountDetails(AccountRequestContext context) Returns aResponseEntitycontaining aAccountDetailsobject.org.springframework.http.ResponseEntity<org.springframework.core.io.ByteArrayResource> Generates a report for the given account.Returns aResponseEntitycontaining allAccountTypes.Returns aResponseEntitycontaining allBrokers.Returns aResponseEntitycontaining allAccountTradingPlatforms.org.springframework.http.ResponseEntity<AccountDTO> postCreateNewAccount(@Valid CreateUpdateAccountDTO data, PortfolioRequestContext context) Creates a newAccount.org.springframework.http.ResponseEntity<Boolean> postIngestAccountPositionDataFromMT4(@Valid MT4AccountPositionDataDTO data, String strategyReferenceCode) Takes in account position data and updates the associated imported data on the account within the payload.org.springframework.http.ResponseEntity<Boolean> Refreshes the balance of the account associated with the given account number.org.springframework.http.ResponseEntity<AccountDTO> putUpdateAccount(AccountPortfolioRequestContext context, @Valid CreateUpdateAccountDTO data) Returns an updatedAccount.org.springframework.http.ResponseEntity<Integer> putUpdateAccountPortfolioAssignments(@Valid UpdateAccountPortfolioAssignmentsDTO data, jakarta.servlet.http.HttpServletRequest request) Moves accounts between portfolios owned by the current user.org.springframework.http.ResponseEntity<AccountDTO> putUpdateAccountStrategy(AccountRequestContext context, @Valid UpdateAccountStrategyDTO data) Assigns or removes a strategy on an existingAccount.
-
Constructor Details
-
AccountApiController
public AccountApiController()
-
-
Method Details
-
getAccountTypes
@GetMapping("/account-types") public org.springframework.http.ResponseEntity<List<PairEntry>> getAccountTypes()Returns aResponseEntitycontaining allAccountTypes.- Returns:
ResponseEntity
-
getBrokers
-
getTradePlatforms
@GetMapping("/trade-platforms") public org.springframework.http.ResponseEntity<List<PairEntry>> getTradePlatforms()Returns aResponseEntitycontaining allAccountTradingPlatforms.- Returns:
ResponseEntity
-
getAccountDetails
@GetMapping("/get-details") public org.springframework.http.ResponseEntity<AccountDetails> getAccountDetails(@ResolvedAccount AccountRequestContext context) Returns aResponseEntitycontaining aAccountDetailsobject.- Parameters:
context-AccountRequestContext- Returns:
ResponseEntity
-
getAccountDetailsReport
@GetMapping(value="/get-report", produces="text/html") public org.springframework.http.ResponseEntity<org.springframework.core.io.ByteArrayResource> getAccountDetailsReport(@ResolvedAccount AccountRequestContext context) throws IOException Generates a report for the given account.- Parameters:
context-AccountRequestContext- Returns:
ResponseEntitywithByteArrayResourcefor download- Throws:
IOException- io file exception
-
postCreateNewAccount
@PostMapping("/create-account") public org.springframework.http.ResponseEntity<AccountDTO> postCreateNewAccount(@Valid @RequestBody @Valid CreateUpdateAccountDTO data, @ResolvedPortfolio PortfolioRequestContext context) Creates a newAccount.- Parameters:
data-CreateUpdateAccountDTOcontext-PortfolioRequestContext- Returns:
ResponseEntity
-
postIngestAccountPositionDataFromMT4
@PostMapping("/ingest-position-data-mt4") public org.springframework.http.ResponseEntity<Boolean> postIngestAccountPositionDataFromMT4(@Valid @RequestBody @Valid MT4AccountPositionDataDTO data, @RequestParam(value="strategyReferenceCode",required=false) String strategyReferenceCode) Takes in account position data and updates the associated imported data on the account within the payload. This endpoint is designed to be used by the system.- Parameters:
data-MT4AccountPositionDataDTOstrategyReferenceCode- optional default strategy reference code- Returns:
ResponseEntity
-
postRefreshAccountBalance
@PostMapping("/refresh-account") public org.springframework.http.ResponseEntity<Boolean> postRefreshAccountBalance(@ResolvedAccount AccountRequestContext context) Refreshes the balance of the account associated with the given account number.- Parameters:
context-AccountRequestContext- Returns:
ResponseEntity
-
putUpdateAccount
@PutMapping("/update-account") public org.springframework.http.ResponseEntity<AccountDTO> putUpdateAccount(@ResolvedAccountPortfolio AccountPortfolioRequestContext context, @Valid @RequestBody @Valid CreateUpdateAccountDTO data) Returns an updatedAccount.- Parameters:
context-AccountPortfolioRequestContextdata-CreateUpdateAccountDTO- Returns:
ResponseEntity
-
putUpdateAccountPortfolioAssignments
@PutMapping("/portfolio-assignments") public org.springframework.http.ResponseEntity<Integer> putUpdateAccountPortfolioAssignments(@Valid @RequestBody @Valid UpdateAccountPortfolioAssignmentsDTO data, jakarta.servlet.http.HttpServletRequest request) Moves accounts between portfolios owned by the current user.- Parameters:
data- account portfolio assignmentsrequest-HttpServletRequest- Returns:
ResponseEntitycontaining the number of accounts moved
-
putUpdateAccountStrategy
@PutMapping("/update-strategy") public org.springframework.http.ResponseEntity<AccountDTO> putUpdateAccountStrategy(@ResolvedAccount AccountRequestContext context, @Valid @RequestBody @Valid UpdateAccountStrategyDTO data) Assigns or removes a strategy on an existingAccount.- Parameters:
context-AccountRequestContextdata-UpdateAccountStrategyDTO- Returns:
ResponseEntity
-
deleteAccount
@DeleteMapping("/delete-account") public org.springframework.http.ResponseEntity<Void> deleteAccount(@ResolvedAccountDeletion AccountDeletionRequestContext context) Deletes anAccountwith the matching account number.- Parameters:
context-AccountDeletionRequestContext- Returns:
ResponseEntity
-