|
@ -31,11 +31,14 @@ import { AccountService } from './account.service'; |
|
|
import { CreateAccountDto } from './create-account.dto'; |
|
|
import { CreateAccountDto } from './create-account.dto'; |
|
|
import { TransferBalanceDto } from './transfer-balance.dto'; |
|
|
import { TransferBalanceDto } from './transfer-balance.dto'; |
|
|
import { UpdateAccountDto } from './update-account.dto'; |
|
|
import { UpdateAccountDto } from './update-account.dto'; |
|
|
|
|
|
import { AccountBalances } from './interfaces/account-balances.interface'; |
|
|
|
|
|
import { AccountBalanceService } from '@ghostfolio/api/services/account-balance/account-balance.service'; |
|
|
|
|
|
|
|
|
@Controller('account') |
|
|
@Controller('account') |
|
|
export class AccountController { |
|
|
export class AccountController { |
|
|
public constructor( |
|
|
public constructor( |
|
|
private readonly accountService: AccountService, |
|
|
private readonly accountService: AccountService, |
|
|
|
|
|
private readonly accountBalanceService: AccountBalanceService, |
|
|
private readonly impersonationService: ImpersonationService, |
|
|
private readonly impersonationService: ImpersonationService, |
|
|
private readonly portfolioService: PortfolioService, |
|
|
private readonly portfolioService: PortfolioService, |
|
|
@Inject(REQUEST) private readonly request: RequestWithUser |
|
|
@Inject(REQUEST) private readonly request: RequestWithUser |
|
@ -116,6 +119,16 @@ export class AccountController { |
|
|
return accountsWithAggregations.accounts[0]; |
|
|
return accountsWithAggregations.accounts[0]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Get(':id/balances') |
|
|
|
|
|
@UseGuards(AuthGuard('jwt')) |
|
|
|
|
|
@UseInterceptors(RedactValuesInResponseInterceptor) |
|
|
|
|
|
public async getAccountBalancesById( |
|
|
|
|
|
@Param('id') id: string |
|
|
|
|
|
): Promise<AccountBalances> { |
|
|
|
|
|
|
|
|
|
|
|
return await this.accountBalanceService.getAccountBalances(id); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Post() |
|
|
@Post() |
|
|
@UseGuards(AuthGuard('jwt')) |
|
|
@UseGuards(AuthGuard('jwt')) |
|
|
public async createAccount( |
|
|
public async createAccount( |
|
|