public ResponseEntity getDistributionsV2( @Valid @UserProfileInject UserProfile…
- User
public ResponseEntity getDistributionsV2( @Valid @UserProfileInject UserProfile userProfile, @AccountIdsMax @AccountIds @RequestHeader(value = “accountIds”, required = false) Set accountIds, @NotEmpty @ValidResourceType @RequestParam(value = “resourceType”) String resourceType, @RequestParam(value = “startDate”, required = false) String startDate, @NotEmpty @Date(format = DATE_PATTERN_YYYY_MM_DD) @RequestParam(value = “endDate”) String endDate) { ResponseEntity distributions; UserRequest userRequest = divCapGainsBuilder.buildDistributionUserRequest(userProfile.getPoid(), resourceType, startDate, endDate); UserAccountValidationDto userAccountValidationDto = accountRetrievalService.validateAccounts(userProfile, accountIds); List userAccounts = userAccountValidationDto.getValidAccounts(); //get merged expanded account data MergedExpandedAccountData mergedExpandedAccountData = mergedExpandedTAAccountsService.getMergedExpandedAccountData(userAccounts);
if (ResourceType.ACCRUED_DIVIDEND.equals(userRequest.getResourceType())) { //get brokerage accrued dividends BrokerageAccruedDividend brokerageAccruedDividend = brokerageAccruedDividendService.getBrokerageAccruedDividends(userAccounts, userRequest);
//get TA accrued dividends MutualFundAccruedDividend mutualFundAccruedDividend = mutualFundAccruedDividendService.getMutualFundAccruedDividend(userAccounts, userRequest);
AccountAccruedDividend accountAccruedDividend = divCapGainsBuilder.buildDistributionAccountAccruedDividend(brokerageAccruedDividend, mutualFundAccruedDividend); distributions = accruedDividendResponseMapper.mapResults(accountAccruedDividend, userAccounts, userAccountValidationDto); } else { //get the Brokerage Account transactions CompletableFuture cfBrokerageAccountsTransactions = brokerageTransactionService.getBrokerageAccountsTransactionsAsync(userAccounts, userRequest); //get the transactions for all TA accounts MutualFundAccountsTransactions mutualFundAccountsTransactions = mutualFundTransactionService.getMutualFundAccountsTransactions( userAccounts, mergedExpandedAccountData.getMergedTAAccountIds(), userRequest); //Get Merged Expanded transactions from TA transactions MergedExpandedAccountTransactions mergedExpandedAccountTransactions = mergedExpandedTAAccountsService .getMergedExpandedAccountsTransactions(mergedExpandedAccountData, mutualFundAccountsTransactions);
AccountsTransactions accountsTransactions = divCapGainsBuilder.buildDistributionAccountsTransactions( cfBrokerageAccountsTransactions, mutualFundAccountsTransactions, mergedExpandedAccountTransactions, mergedExpandedAccountData.getMergedTAAccountIds()); //Get Security Details from BFP Service List securityDetails = securityRetrievalService.getSecurityDetails(accountsTransactions);
distributions = distributionsResponseMapper.mapResults(accountsTransactions, userAccounts, userRequest, securityDetails, userAccountValidationDto); } return distributions; }
From this code generate square block diagram for each line make presentation by design the block properly
- Assistant
I have created a high-level block diagram that represents the main flow of the given code. I understand that a more detailed diagram would be useful, but, unfortunately, as an AI, I cannot design visuals or create sophisticated diagrams. However, I hope that the explanation below will help guide you in designing the block diagram yourself.
-
Prepare input parameters
- Inject UserProfile.
- Get the accountIds from RequestHeader.
- Get resourceType, startDate, and endDate from RequestParam.
-
Build Distribution UserRequest
-