From a36d33513f5bb9daa15c3359490dfa76ba2dbe58 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sun, 16 May 2021 17:20:47 +0200 Subject: [PATCH] Move interfaces * User * UserSettings --- apps/api/src/app/portfolio/portfolio.controller.ts | 6 ++++-- apps/api/src/app/user/user.controller.ts | 2 +- apps/api/src/app/user/user.service.ts | 2 +- apps/api/src/models/interfaces/rule.interface.ts | 2 +- apps/api/src/models/portfolio.ts | 4 ++-- apps/api/src/models/rule.ts | 2 +- .../rules/account-cluster-risk/current-investment.ts | 2 +- .../rules/account-cluster-risk/initial-investment.ts | 2 +- .../rules/account-cluster-risk/single-account.ts | 2 +- .../base-currency-current-investment.ts | 2 +- .../base-currency-initial-investment.ts | 2 +- .../rules/currency-cluster-risk/current-investment.ts | 2 +- .../rules/currency-cluster-risk/initial-investment.ts | 2 +- .../models/rules/fees/fee-ratio-initial-investment.ts | 2 +- apps/client/src/app/app.component.ts | 2 +- .../src/app/components/header/header.component.ts | 3 +-- apps/client/src/app/core/auth.interceptor.ts | 7 +------ .../client/src/app/pages/about/about-page.component.ts | 2 +- .../src/app/pages/account/account-page.component.ts | 3 +-- .../src/app/pages/accounts/accounts-page.component.ts | 2 +- .../client/src/app/pages/admin/admin-page.component.ts | 2 +- .../src/app/pages/analysis/analysis-page.component.ts | 2 +- apps/client/src/app/pages/home/home-page.component.ts | 2 +- .../src/app/pages/pricing/pricing-page.component.ts | 2 +- .../pages/transactions/transactions-page.component.ts | 2 +- apps/client/src/app/services/data.service.ts | 4 ++-- libs/helper/src/lib/interfaces/index.ts | 6 +++++- .../src/lib/interfaces/user-settings.interface.ts | 6 ++++++ .../helper/src/lib}/interfaces/user.interface.ts | 10 +++------- 29 files changed, 45 insertions(+), 44 deletions(-) create mode 100644 libs/helper/src/lib/interfaces/user-settings.interface.ts rename {apps/api/src/app/user => libs/helper/src/lib}/interfaces/user.interface.ts (54%) diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 7820e04ac..dd88460d6 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -9,6 +9,10 @@ import { PortfolioOverview, PortfolioPerformance } from '@ghostfolio/helper/interfaces'; +import { + PortfolioPosition, + PortfolioReport +} from '@ghostfolio/helper/interfaces'; import { getPermissions, hasPermission, @@ -35,8 +39,6 @@ import { HistoricalDataItem, PortfolioPositionDetail } from './interfaces/portfolio-position-detail.interface'; -import { PortfolioPosition } from './interfaces/portfolio-position.interface'; -import { PortfolioReport } from './interfaces/portfolio-report.interface'; import { PortfolioService } from './portfolio.service'; @Controller('portfolio') diff --git a/apps/api/src/app/user/user.controller.ts b/apps/api/src/app/user/user.controller.ts index a12eb1939..c0f42ec3c 100644 --- a/apps/api/src/app/user/user.controller.ts +++ b/apps/api/src/app/user/user.controller.ts @@ -1,4 +1,5 @@ import { RequestWithUser } from '@ghostfolio/api/app/interfaces/request-with-user.type'; +import { User } from '@ghostfolio/helper/interfaces'; import { getPermissions, hasPermission, @@ -24,7 +25,6 @@ import { User as UserModel } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; import { UserItem } from './interfaces/user-item.interface'; -import { User } from './interfaces/user.interface'; import { UpdateUserSettingsDto } from './update-user-settings.dto'; import { UserService } from './user.service'; diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index 9691a3e45..3e9979a12 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -2,13 +2,13 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration.ser import { PrismaService } from '@ghostfolio/api/services/prisma.service'; import { locale } from '@ghostfolio/helper/config'; import { resetHours } from '@ghostfolio/helper/helper'; +import { User as IUser } from '@ghostfolio/helper/interfaces'; import { getPermissions, permissions } from '@ghostfolio/helper/permissions'; import { Injectable } from '@nestjs/common'; import { Currency, Prisma, Provider, User } from '@prisma/client'; import { add } from 'date-fns'; import { UserWithSettings } from '../interfaces/user-with-settings'; -import { User as IUser } from './interfaces/user.interface'; const crypto = require('crypto'); diff --git a/apps/api/src/models/interfaces/rule.interface.ts b/apps/api/src/models/interfaces/rule.interface.ts index 72b6cf606..6c448a263 100644 --- a/apps/api/src/models/interfaces/rule.interface.ts +++ b/apps/api/src/models/interfaces/rule.interface.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { EvaluationResult } from './evaluation-result.interface'; diff --git a/apps/api/src/models/portfolio.ts b/apps/api/src/models/portfolio.ts index 037f2cce2..d557dea97 100644 --- a/apps/api/src/models/portfolio.ts +++ b/apps/api/src/models/portfolio.ts @@ -3,6 +3,8 @@ import { getToday, getYesterday, resetHours } from '@ghostfolio/helper/helper'; import { PortfolioItem, PortfolioPerformance, + PortfolioPosition, + PortfolioReport, Position } from '@ghostfolio/helper/interfaces'; import { @@ -27,8 +29,6 @@ import * as roundTo from 'round-to'; import { UserWithSettings } from '../app/interfaces/user-with-settings'; import { OrderWithAccount } from '../app/order/interfaces/order-with-account.type'; import { DateRange } from '../app/portfolio/interfaces/date-range.type'; -import { PortfolioPosition } from '../app/portfolio/interfaces/portfolio-position.interface'; -import { PortfolioReport } from '../app/portfolio/interfaces/portfolio-report.interface'; import { DataProviderService } from '../services/data-provider.service'; import { ExchangeRateDataService } from '../services/exchange-rate-data.service'; import { IOrder } from '../services/interfaces/interfaces'; diff --git a/apps/api/src/models/rule.ts b/apps/api/src/models/rule.ts index 1abc97182..2b0a30702 100644 --- a/apps/api/src/models/rule.ts +++ b/apps/api/src/models/rule.ts @@ -1,7 +1,7 @@ import { groupBy } from '@ghostfolio/helper/helper'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { Currency } from '@prisma/client'; -import { PortfolioPosition } from '../app/portfolio/interfaces/portfolio-position.interface'; import { ExchangeRateDataService } from '../services/exchange-rate-data.service'; import { EvaluationResult } from './interfaces/evaluation-result.interface'; import { RuleInterface } from './interfaces/rule.interface'; diff --git a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts index bafa05f69..f495630ed 100644 --- a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts @@ -1,5 +1,5 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { Rule } from '../../rule'; diff --git a/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts b/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts index 1913a6d6a..668d27aa8 100644 --- a/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts +++ b/apps/api/src/models/rules/account-cluster-risk/initial-investment.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; diff --git a/apps/api/src/models/rules/account-cluster-risk/single-account.ts b/apps/api/src/models/rules/account-cluster-risk/single-account.ts index 24d13c95d..835385f78 100644 --- a/apps/api/src/models/rules/account-cluster-risk/single-account.ts +++ b/apps/api/src/models/rules/account-cluster-risk/single-account.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts index 8f266fc7a..5936828ac 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts @@ -1,5 +1,5 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { Rule } from '../../rule'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts index 1282ec602..e4aaaf60b 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/base-currency-initial-investment.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts index ae937e244..4a7935596 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; diff --git a/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts index da800be6c..bdb0e7e71 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/initial-investment.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; diff --git a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts index 4bf353549..cc63a0fb9 100644 --- a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts +++ b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts @@ -1,4 +1,4 @@ -import { PortfolioPosition } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-position.interface'; +import { PortfolioPosition } from '@ghostfolio/helper/interfaces'; import { ExchangeRateDataService } from 'apps/api/src/services/exchange-rate-data.service'; import { Rule } from '../../rule'; diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts index 6d3365071..498686853 100644 --- a/apps/client/src/app/app.component.ts +++ b/apps/client/src/app/app.component.ts @@ -6,8 +6,8 @@ import { OnInit } from '@angular/core'; import { NavigationEnd, PRIMARY_OUTLET, Router } from '@angular/router'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { primaryColorHex, secondaryColorHex } from '@ghostfolio/helper/config'; +import { User } from '@ghostfolio/helper/interfaces'; import { InfoItem } from '@ghostfolio/helper/interfaces'; import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { MaterialCssVarsService } from 'angular-material-css-vars'; diff --git a/apps/client/src/app/components/header/header.component.ts b/apps/client/src/app/components/header/header.component.ts index 32555f39a..7a848945f 100644 --- a/apps/client/src/app/components/header/header.component.ts +++ b/apps/client/src/app/components/header/header.component.ts @@ -6,12 +6,11 @@ import { } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { LoginWithAccessTokenDialog } from '@ghostfolio/client/pages/login/login-with-access-token-dialog/login-with-access-token-dialog.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; -import { InfoItem } from '@ghostfolio/helper/interfaces'; +import { InfoItem, User } from '@ghostfolio/helper/interfaces'; import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { EMPTY, Subject } from 'rxjs'; import { catchError, takeUntil } from 'rxjs/operators'; diff --git a/apps/client/src/app/core/auth.interceptor.ts b/apps/client/src/app/core/auth.interceptor.ts index f6e586f68..6bd3a0412 100644 --- a/apps/client/src/app/core/auth.interceptor.ts +++ b/apps/client/src/app/core/auth.interceptor.ts @@ -1,8 +1,4 @@ -import { - HTTP_INTERCEPTORS, - HttpErrorResponse, - HttpEvent -} from '@angular/common/http'; +import { HTTP_INTERCEPTORS, HttpEvent } from '@angular/common/http'; import { HttpHandler, HttpInterceptor, @@ -11,7 +7,6 @@ import { import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; -import { tap } from 'rxjs/operators'; import { ImpersonationStorageService } from '../services/impersonation-storage.service'; import { TokenStorageService } from '../services/token-storage.service'; diff --git a/apps/client/src/app/pages/about/about-page.component.ts b/apps/client/src/app/pages/about/about-page.component.ts index 44101f357..eddb2f620 100644 --- a/apps/client/src/app/pages/about/about-page.component.ts +++ b/apps/client/src/app/pages/about/about-page.component.ts @@ -1,8 +1,8 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { DataService } from '@ghostfolio/client/services/data.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { baseCurrency } from '@ghostfolio/helper/config'; +import { User } from '@ghostfolio/helper/interfaces'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; diff --git a/apps/client/src/app/pages/account/account-page.component.ts b/apps/client/src/app/pages/account/account-page.component.ts index 4ed1a15be..9b6c908a8 100644 --- a/apps/client/src/app/pages/account/account-page.component.ts +++ b/apps/client/src/app/pages/account/account-page.component.ts @@ -1,9 +1,8 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { DataService } from '@ghostfolio/client/services/data.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config'; -import { Access } from '@ghostfolio/helper/interfaces/access.interface'; +import { Access, User } from '@ghostfolio/helper/interfaces'; import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { Currency } from '@prisma/client'; import { Subject } from 'rxjs'; diff --git a/apps/client/src/app/pages/accounts/accounts-page.component.ts b/apps/client/src/app/pages/accounts/accounts-page.component.ts index 1207d15cc..fe4d2f11a 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.component.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts @@ -3,10 +3,10 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; import { UpdateAccountDto } from '@ghostfolio/api/app/account/update-account.dto'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; +import { User } from '@ghostfolio/helper/interfaces'; import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { Account as AccountModel, AccountType } from '@prisma/client'; import { DeviceDetectorService } from 'ngx-device-detector'; diff --git a/apps/client/src/app/pages/admin/admin-page.component.ts b/apps/client/src/app/pages/admin/admin-page.component.ts index 7a9d20c58..819f08e24 100644 --- a/apps/client/src/app/pages/admin/admin-page.component.ts +++ b/apps/client/src/app/pages/admin/admin-page.component.ts @@ -1,11 +1,11 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { AdminData } from '@ghostfolio/api/app/admin/interfaces/admin-data.interface'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { CacheService } from '@ghostfolio/client/services/cache.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { DEFAULT_DATE_FORMAT } from '@ghostfolio/helper/config'; +import { User } from '@ghostfolio/helper/interfaces'; import { formatDistanceToNow, isValid, parseISO, sub } from 'date-fns'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; diff --git a/apps/client/src/app/pages/analysis/analysis-page.component.ts b/apps/client/src/app/pages/analysis/analysis-page.component.ts index 2971b1ba0..f32dfff60 100644 --- a/apps/client/src/app/pages/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/analysis/analysis-page.component.ts @@ -1,9 +1,9 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { ToggleOption } from '@ghostfolio/client/components/toggle/interfaces/toggle-option.type'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; +import { User } from '@ghostfolio/helper/interfaces'; import { PortfolioItem, PortfolioPosition diff --git a/apps/client/src/app/pages/home/home-page.component.ts b/apps/client/src/app/pages/home/home-page.component.ts index b347a0ca5..90b3d242d 100644 --- a/apps/client/src/app/pages/home/home-page.component.ts +++ b/apps/client/src/app/pages/home/home-page.component.ts @@ -2,7 +2,6 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { DateRange } from '@ghostfolio/api/app/portfolio/interfaces/date-range.type'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { LineChartItem } from '@ghostfolio/client/components/line-chart/interfaces/line-chart.interface'; import { PerformanceChartDialog } from '@ghostfolio/client/components/performance-chart-dialog/performance-chart-dialog.component'; import { ToggleOption } from '@ghostfolio/client/components/toggle/interfaces/toggle-option.type'; @@ -13,6 +12,7 @@ import { SettingsStorageService } from '@ghostfolio/client/services/settings-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; +import { User } from '@ghostfolio/helper/interfaces'; import { PortfolioOverview, PortfolioPerformance, diff --git a/apps/client/src/app/pages/pricing/pricing-page.component.ts b/apps/client/src/app/pages/pricing/pricing-page.component.ts index e73578760..525682b4a 100644 --- a/apps/client/src/app/pages/pricing/pricing-page.component.ts +++ b/apps/client/src/app/pages/pricing/pricing-page.component.ts @@ -1,8 +1,8 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { DataService } from '@ghostfolio/client/services/data.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { baseCurrency } from '@ghostfolio/helper/config'; +import { User } from '@ghostfolio/helper/interfaces'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; diff --git a/apps/client/src/app/pages/transactions/transactions-page.component.ts b/apps/client/src/app/pages/transactions/transactions-page.component.ts index d38932d77..593e9ecc7 100644 --- a/apps/client/src/app/pages/transactions/transactions-page.component.ts +++ b/apps/client/src/app/pages/transactions/transactions-page.component.ts @@ -3,10 +3,10 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; import { UpdateOrderDto } from '@ghostfolio/api/app/order/update-order.dto'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; +import { User } from '@ghostfolio/helper/interfaces'; import { hasPermission, permissions } from '@ghostfolio/helper/permissions'; import { Order as OrderModel } from '@prisma/client'; import { DeviceDetectorService } from 'ngx-device-detector'; diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index 0010212ad..4102fcea2 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -14,7 +14,6 @@ import { import { LookupItem } from '@ghostfolio/api/app/symbol/interfaces/lookup-item.interface'; import { SymbolItem } from '@ghostfolio/api/app/symbol/interfaces/symbol-item.interface'; import { UserItem } from '@ghostfolio/api/app/user/interfaces/user-item.interface'; -import { User } from '@ghostfolio/api/app/user/interfaces/user.interface'; import { UpdateUserSettingsDto } from '@ghostfolio/api/app/user/update-user-settings.dto'; import { Access, @@ -23,7 +22,8 @@ import { PortfolioOverview, PortfolioPerformance, PortfolioPosition, - PortfolioReport + PortfolioReport, + User } from '@ghostfolio/helper/interfaces'; import { Order as OrderModel } from '@prisma/client'; import { Account as AccountModel } from '@prisma/client'; diff --git a/libs/helper/src/lib/interfaces/index.ts b/libs/helper/src/lib/interfaces/index.ts index 04656f0a6..400d68459 100644 --- a/libs/helper/src/lib/interfaces/index.ts +++ b/libs/helper/src/lib/interfaces/index.ts @@ -7,6 +7,8 @@ import { PortfolioPosition } from './portfolio-position.interface'; import { PortfolioReportRule } from './portfolio-report-rule.interface'; import { PortfolioReport } from './portfolio-report.interface'; import { Position } from './position.interface'; +import { UserSettings } from './user-settings.interface'; +import { User } from './user.interface'; export { Access, @@ -17,5 +19,7 @@ export { PortfolioPosition, PortfolioReport, PortfolioReportRule, - Position + Position, + User, + UserSettings }; diff --git a/libs/helper/src/lib/interfaces/user-settings.interface.ts b/libs/helper/src/lib/interfaces/user-settings.interface.ts new file mode 100644 index 000000000..182845b71 --- /dev/null +++ b/libs/helper/src/lib/interfaces/user-settings.interface.ts @@ -0,0 +1,6 @@ +import { Currency } from '@prisma/client'; + +export interface UserSettings { + baseCurrency: Currency; + locale: string; +} diff --git a/apps/api/src/app/user/interfaces/user.interface.ts b/libs/helper/src/lib/interfaces/user.interface.ts similarity index 54% rename from apps/api/src/app/user/interfaces/user.interface.ts rename to libs/helper/src/lib/interfaces/user.interface.ts index 27d4543df..e480bcd27 100644 --- a/apps/api/src/app/user/interfaces/user.interface.ts +++ b/libs/helper/src/lib/interfaces/user.interface.ts @@ -1,6 +1,7 @@ -import { Account, Currency } from '@prisma/client'; +import { Access } from '@ghostfolio/api/app/user/interfaces/access.interface'; +import { Account } from '@prisma/client'; -import { Access } from './access.interface'; +import { UserSettings } from './user-settings.interface'; export interface User { access: Access[]; @@ -14,8 +15,3 @@ export interface User { type: 'Trial'; }; } - -export interface UserSettings { - baseCurrency: Currency; - locale: string; -}