Browse Source
Task/introduce interface for get account response (#5902)
* Introduce interface for get account response
pull/5928/head
Thomas Kaul
3 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
10 additions and
7 deletions
-
apps/api/src/app/account/account.controller.ts
-
apps/client/src/app/services/data.service.ts
-
libs/common/src/lib/interfaces/index.ts
-
libs/common/src/lib/interfaces/responses/account-response.interface.ts
|
|
|
@ -9,13 +9,11 @@ import { ImpersonationService } from '@ghostfolio/api/services/impersonation/imp |
|
|
|
import { HEADER_KEY_IMPERSONATION } from '@ghostfolio/common/config'; |
|
|
|
import { |
|
|
|
AccountBalancesResponse, |
|
|
|
AccountResponse, |
|
|
|
AccountsResponse |
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
|
import { permissions } from '@ghostfolio/common/permissions'; |
|
|
|
import type { |
|
|
|
AccountWithValue, |
|
|
|
RequestWithUser |
|
|
|
} from '@ghostfolio/common/types'; |
|
|
|
import type { RequestWithUser } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
import { |
|
|
|
Body, |
|
|
|
@ -114,7 +112,7 @@ export class AccountController { |
|
|
|
public async getAccountById( |
|
|
|
@Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId: string, |
|
|
|
@Param('id') id: string |
|
|
|
): Promise<AccountWithValue> { |
|
|
|
): Promise<AccountResponse> { |
|
|
|
const impersonationUserId = |
|
|
|
await this.impersonationService.validateImpersonationId(impersonationId); |
|
|
|
|
|
|
|
|
|
|
|
@ -22,6 +22,7 @@ import { |
|
|
|
Access, |
|
|
|
AccessTokenResponse, |
|
|
|
AccountBalancesResponse, |
|
|
|
AccountResponse, |
|
|
|
AccountsResponse, |
|
|
|
ActivitiesResponse, |
|
|
|
ActivityResponse, |
|
|
|
@ -54,7 +55,6 @@ import { |
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
|
import { filterGlobalPermissions } from '@ghostfolio/common/permissions'; |
|
|
|
import type { |
|
|
|
AccountWithValue, |
|
|
|
AiPromptMode, |
|
|
|
DateRange, |
|
|
|
GroupBy |
|
|
|
@ -186,7 +186,7 @@ export class DataService { |
|
|
|
} |
|
|
|
|
|
|
|
public fetchAccount(aAccountId: string) { |
|
|
|
return this.http.get<AccountWithValue>(`/api/v1/account/${aAccountId}`); |
|
|
|
return this.http.get<AccountResponse>(`/api/v1/account/${aAccountId}`); |
|
|
|
} |
|
|
|
|
|
|
|
public fetchAccountBalances(aAccountId: string) { |
|
|
|
|
|
|
|
@ -36,6 +36,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 { AccountResponse } from './responses/account-response.interface'; |
|
|
|
import type { AccountsResponse } from './responses/accounts-response.interface'; |
|
|
|
import type { ActivitiesResponse } from './responses/activities-response.interface'; |
|
|
|
import type { ActivityResponse } from './responses/activity-response.interface'; |
|
|
|
@ -86,6 +87,7 @@ export { |
|
|
|
AccessTokenResponse, |
|
|
|
AccountBalance, |
|
|
|
AccountBalancesResponse, |
|
|
|
AccountResponse, |
|
|
|
AccountsResponse, |
|
|
|
ActivitiesResponse, |
|
|
|
ActivityResponse, |
|
|
|
|
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
import { AccountWithValue } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
export interface AccountResponse extends AccountWithValue {} |