Feature/refactor accounts response interface (#4644)
* Refactor accounts response interface
This commit is contained in:
parent
c3887e2f8e
commit
3e963228d6
@ -9,7 +9,7 @@ import { ImpersonationService } from '@ghostfolio/api/services/impersonation/imp
|
||||
import { HEADER_KEY_IMPERSONATION } from '@ghostfolio/common/config';
|
||||
import {
|
||||
AccountBalancesResponse,
|
||||
Accounts
|
||||
AccountsResponse
|
||||
} from '@ghostfolio/common/interfaces';
|
||||
import { permissions } from '@ghostfolio/common/permissions';
|
||||
import type {
|
||||
@ -90,7 +90,7 @@ export class AccountController {
|
||||
@Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId,
|
||||
@Query('dataSource') filterByDataSource?: string,
|
||||
@Query('symbol') filterBySymbol?: string
|
||||
): Promise<Accounts> {
|
||||
): Promise<AccountsResponse> {
|
||||
const impersonationUserId =
|
||||
await this.impersonationService.validateImpersonationId(impersonationId);
|
||||
|
||||
|
@ -35,7 +35,7 @@ import {
|
||||
} from '@ghostfolio/common/config';
|
||||
import { DATE_FORMAT, getSum, parseDate } from '@ghostfolio/common/helper';
|
||||
import {
|
||||
Accounts,
|
||||
AccountsResponse,
|
||||
EnhancedSymbolProfile,
|
||||
Filter,
|
||||
HistoricalDataItem,
|
||||
@ -209,7 +209,7 @@ export class PortfolioService {
|
||||
filters?: Filter[];
|
||||
userId: string;
|
||||
withExcludedAccounts?: boolean;
|
||||
}): Promise<Accounts> {
|
||||
}): Promise<AccountsResponse> {
|
||||
const accounts = await this.getAccounts({
|
||||
filters,
|
||||
userId,
|
||||
|
@ -25,7 +25,7 @@ import {
|
||||
Access,
|
||||
AccessTokenResponse,
|
||||
AccountBalancesResponse,
|
||||
Accounts,
|
||||
AccountsResponse,
|
||||
AiPromptResponse,
|
||||
ApiKeyResponse,
|
||||
AssetProfileIdentifier,
|
||||
@ -191,7 +191,7 @@ export class DataService {
|
||||
public fetchAccounts({ filters }: { filters?: Filter[] } = {}) {
|
||||
const params = this.buildFiltersAsQueryParams({ filters });
|
||||
|
||||
return this.http.get<Accounts>('/api/v1/account', { params });
|
||||
return this.http.get<AccountsResponse>('/api/v1/account', { params });
|
||||
}
|
||||
|
||||
public fetchActivities({
|
||||
|
@ -1,6 +1,5 @@
|
||||
import type { Access } from './access.interface';
|
||||
import type { AccountBalance } from './account-balance.interface';
|
||||
import type { Accounts } from './accounts.interface';
|
||||
import type { AdminData } from './admin-data.interface';
|
||||
import type { AdminJobs } from './admin-jobs.interface';
|
||||
import type { AdminMarketDataDetails } from './admin-market-data-details.interface';
|
||||
@ -40,6 +39,7 @@ import type { Position } from './position.interface';
|
||||
import type { Product } from './product';
|
||||
import type { AccessTokenResponse } from './responses/access-token-response.interface';
|
||||
import type { AccountBalancesResponse } from './responses/account-balances-response.interface';
|
||||
import type { AccountsResponse } from './responses/accounts-response.interface';
|
||||
import type { AiPromptResponse } from './responses/ai-prompt-response.interface';
|
||||
import type { ApiKeyResponse } from './responses/api-key-response.interface';
|
||||
import type { BenchmarkResponse } from './responses/benchmark-response.interface';
|
||||
@ -74,7 +74,7 @@ export {
|
||||
AccessTokenResponse,
|
||||
AccountBalance,
|
||||
AccountBalancesResponse,
|
||||
Accounts,
|
||||
AccountsResponse,
|
||||
AdminData,
|
||||
AdminJobs,
|
||||
AdminMarketData,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { AccountWithValue } from '@ghostfolio/common/types';
|
||||
|
||||
export interface Accounts {
|
||||
export interface AccountsResponse {
|
||||
accounts: AccountWithValue[];
|
||||
totalBalanceInBaseCurrency: number;
|
||||
totalValueInBaseCurrency: number;
|
Loading…
x
Reference in New Issue
Block a user