class AccountController {

    @Path("/account")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Operation(
        summary = "Returns account information",
        description = "Returns account information by account id.",
        tags = {"accounts"},
        responses = {
            @ApiResponse(responseCode = "200", description = "Successful execution",
                content = @Content(mediaType = "application/json",
                    schema = @Schema(implementation = AccountDTO.class)))
        })
    @PermitAll
    public Response getAccount(
        @Parameter(description = "The account ID.", required = true, schema = @Schema(implementation = String.class))
        @QueryParam("account") @NotNull AccountIdParameter accountIdParameter,
        @Parameter(description = "include additional lessors, lessorsRS and lessorsInfo (optional)")
        @QueryParam("includeLessors") @DefaultValue("false") boolean includeLessors,
        @Parameter(description = "include additional assetBalances and unconfirmedAssetBalances (optional)")
        @QueryParam("includeAssets") @DefaultValue("false") boolean includeAssets,
        @Parameter(description = "include accountCurrencies (optional)") @QueryParam("includeCurrencies")
        @DefaultValue("false") boolean includeCurrencies,
        @Parameter(description = "include effectiveBalanceAPL and guaranteedBalanceATM (optional)")
        @QueryParam("includeEffectiveBalance") @DefaultValue("false") boolean includeEffectiveBalance
    ) {

        ResponseBuilder response = ResponseBuilder.startTiming();

        long accountId = accountIdParameter.get();
        Account account = accountService.getAccount(accountId);

        if (account == null) {
            AccountNotFoundResponse accountErrorResponse = new AccountNotFoundResponse(
                ResponseBuilder.createErrorResponse(
                    ApiErrors.UNKNOWN_VALUE,
                    null,
                    "account", accountId));
            accountErrorResponse.setAccount(Long.toUnsignedString(accountId));
            accountErrorResponse.setAccountRS(Convert2.rsAccount(accountId));
            accountErrorResponse.set2FA(account2FAHelper.isEnabled2FA(accountId));
            return response.error(accountErrorResponse).build();
        }

        if (account.getPublicKey() == null) {
            PublicKey pKey = accountPublicKeyService.getPublicKey(account.getId());
            account.setPublicKey(pKey);
        }

        AccountDTO dto = converter.convert(account);
        if (includeEffectiveBalance) {
            converter.addEffectiveBalances(dto, account);
        }
        if (includeLessors) {
            List<Account> lessors = accountService.getLessors(account);
            converter.addAccountLessors(dto, lessors, includeEffectiveBalance);
        }
        if (includeAssets) {
            List<AccountAsset> assets = accountAssetService.getAssetsByAccount(account, 0, -1);
            converter.addAccountAssets(dto, assets);
        }
        if (includeCurrencies) {
            List<AccountCurrency> currencies = accountCurrencyService.getCurrenciesByAccount(account);
            converter.addAccountCurrencies(dto, currencies);
        }

        return response.bind(dto).build();
    }

    @Inject public  AccountController(Blockchain blockchain,
                             Account2FAHelper account2FAHelper,
                             AccountService accountService,
                             AccountPublicKeyService accountPublicKeyService,
                             AccountAssetService accountAssetService,
                             AccountCurrencyService accountCurrencyService,
                             AccountAssetConverter accountAssetConverter,
                             AccountCurrencyConverter accountCurrencyConverter,
                             AccountConverter converter,
                             BlockConverter blockConverter,
                             WalletKeysConverter walletKeysConverter,
                             Account2FADetailsConverter faDetailsConverter,
                             Account2FAConverter faConverter,
                             @AskOrderService OrderService<AskOrder, ColoredCoinsAskOrderPlacement> orderService,
                             FirstLastIndexParser indexParser,
                             AccountStatisticsService accountStatisticsService);

}