Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/introduce interface for get account response (#5902)

Thomas Kaul9383fc00cb61
diff --git a/apps/api/src/app/account/account.controller.ts b/apps/api/src/app/account/account.controller.ts
index 7b24ccdcb4..cd6892ab86 100644
--- a/apps/api/src/app/account/account.controller.ts
+++ b/apps/api/src/app/account/account.controller.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);
diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts
index 6f0b17ed14..f837460095 100644
--- a/apps/client/src/app/services/data.service.ts
+++ b/apps/client/src/app/services/data.service.ts
@@ -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) {
diff --git a/libs/common/src/lib/interfaces/index.ts b/libs/common/src/lib/interfaces/index.ts
index 899813f302..5c516a4a66 100644
--- a/libs/common/src/lib/interfaces/index.ts
+++ b/libs/common/src/lib/interfaces/index.ts
@@ -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,
diff --git a/libs/common/src/lib/interfaces/responses/account-response.interface.ts b/libs/common/src/lib/interfaces/responses/account-response.interface.ts
new file mode 100644
index 0000000000..3e954dc726
--- /dev/null
+++ b/libs/common/src/lib/interfaces/responses/account-response.interface.ts
@@ -0,0 +1,3 @@
+import { AccountWithValue } from '@ghostfolio/common/types';
+
+export interface AccountResponse extends AccountWithValue {}