diff --git a/apps/api/src/app/access/access.controller.ts b/apps/api/src/app/access/access.controller.ts index cb1e2d4af..5056a6d71 100644 --- a/apps/api/src/app/access/access.controller.ts +++ b/apps/api/src/app/access/access.controller.ts @@ -1,6 +1,7 @@ import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorator'; import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; +import { CreateAccessDto, UpdateAccessDto } from '@ghostfolio/common/dtos'; import { Access } from '@ghostfolio/common/interfaces'; import { permissions } from '@ghostfolio/common/permissions'; import type { RequestWithUser } from '@ghostfolio/common/types'; @@ -23,8 +24,6 @@ import { Access as AccessModel } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; import { AccessService } from './access.service'; -import { CreateAccessDto } from './create-access.dto'; -import { UpdateAccessDto } from './update-access.dto'; @Controller('access') export class AccessController { diff --git a/apps/api/src/app/account-balance/account-balance.controller.ts b/apps/api/src/app/account-balance/account-balance.controller.ts index bc454c5ab..baf002bd3 100644 --- a/apps/api/src/app/account-balance/account-balance.controller.ts +++ b/apps/api/src/app/account-balance/account-balance.controller.ts @@ -1,6 +1,7 @@ import { AccountService } from '@ghostfolio/api/app/account/account.service'; import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorator'; import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; +import { CreateAccountBalanceDto } from '@ghostfolio/common/dtos'; import { permissions } from '@ghostfolio/common/permissions'; import type { RequestWithUser } from '@ghostfolio/common/types'; @@ -20,7 +21,6 @@ import { AccountBalance } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; import { AccountBalanceService } from './account-balance.service'; -import { CreateAccountBalanceDto } from './create-account-balance.dto'; @Controller('account-balance') export class AccountBalanceController { diff --git a/apps/api/src/app/account-balance/account-balance.service.ts b/apps/api/src/app/account-balance/account-balance.service.ts index 10353f4ca..321624003 100644 --- a/apps/api/src/app/account-balance/account-balance.service.ts +++ b/apps/api/src/app/account-balance/account-balance.service.ts @@ -2,6 +2,7 @@ import { PortfolioChangedEvent } from '@ghostfolio/api/events/portfolio-changed. import { LogPerformance } from '@ghostfolio/api/interceptors/performance-logging/performance-logging.interceptor'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { PrismaService } from '@ghostfolio/api/services/prisma/prisma.service'; +import { CreateAccountBalanceDto } from '@ghostfolio/common/dtos'; import { DATE_FORMAT, getSum, resetHours } from '@ghostfolio/common/helper'; import { AccountBalancesResponse, @@ -15,8 +16,6 @@ import { AccountBalance, Prisma } from '@prisma/client'; import { Big } from 'big.js'; import { format, parseISO } from 'date-fns'; -import { CreateAccountBalanceDto } from './create-account-balance.dto'; - @Injectable() export class AccountBalanceService { public constructor( diff --git a/apps/api/src/app/account/account.controller.ts b/apps/api/src/app/account/account.controller.ts index cd6892ab8..542b199fd 100644 --- a/apps/api/src/app/account/account.controller.ts +++ b/apps/api/src/app/account/account.controller.ts @@ -7,6 +7,11 @@ import { TransformDataSourceInRequestInterceptor } from '@ghostfolio/api/interce import { ApiService } from '@ghostfolio/api/services/api/api.service'; import { ImpersonationService } from '@ghostfolio/api/services/impersonation/impersonation.service'; import { HEADER_KEY_IMPERSONATION } from '@ghostfolio/common/config'; +import { + CreateAccountDto, + TransferBalanceDto, + UpdateAccountDto +} from '@ghostfolio/common/dtos'; import { AccountBalancesResponse, AccountResponse, @@ -36,9 +41,6 @@ import { Account as AccountModel } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; import { AccountService } from './account.service'; -import { CreateAccountDto } from './create-account.dto'; -import { TransferBalanceDto } from './transfer-balance.dto'; -import { UpdateAccountDto } from './update-account.dto'; @Controller('account') export class AccountController { diff --git a/apps/api/src/app/admin/admin.controller.ts b/apps/api/src/app/admin/admin.controller.ts index 7ed7f364b..8b5da4965 100644 --- a/apps/api/src/app/admin/admin.controller.ts +++ b/apps/api/src/app/admin/admin.controller.ts @@ -4,7 +4,6 @@ import { TransformDataSourceInRequestInterceptor } from '@ghostfolio/api/interce import { ApiService } from '@ghostfolio/api/services/api/api.service'; import { ManualService } from '@ghostfolio/api/services/data-provider/manual/manual.service'; import { DemoService } from '@ghostfolio/api/services/demo/demo.service'; -import { PropertyDto } from '@ghostfolio/api/services/property/property.dto'; import { DataGatheringService } from '@ghostfolio/api/services/queues/data-gathering/data-gathering.service'; import { getIntervalFromDateRange } from '@ghostfolio/common/calculation-helper'; import { @@ -13,6 +12,10 @@ import { GATHER_ASSET_PROFILE_PROCESS_JOB_NAME, GATHER_ASSET_PROFILE_PROCESS_JOB_OPTIONS } from '@ghostfolio/common/config'; +import { + UpdateAssetProfileDto, + UpdatePropertyDto +} from '@ghostfolio/common/dtos'; import { getAssetProfileIdentifier } from '@ghostfolio/common/helper'; import { AdminData, @@ -52,7 +55,6 @@ import { isDate, parseISO } from 'date-fns'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; import { AdminService } from './admin.service'; -import { UpdateAssetProfileDto } from './update-asset-profile.dto'; @Controller('admin') export class AdminController { @@ -305,7 +307,7 @@ export class AdminController { @UseGuards(AuthGuard('jwt'), HasPermissionGuard) public async updateProperty( @Param('key') key: string, - @Body() data: PropertyDto + @Body() data: UpdatePropertyDto ) { return this.adminService.putSetting(key, data.value); } diff --git a/apps/api/src/app/auth/auth.controller.ts b/apps/api/src/app/auth/auth.controller.ts index 57fd04bc7..b45e7b97b 100644 --- a/apps/api/src/app/auth/auth.controller.ts +++ b/apps/api/src/app/auth/auth.controller.ts @@ -2,7 +2,11 @@ import { WebAuthService } from '@ghostfolio/api/app/auth/web-auth.service'; import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config'; -import { OAuthResponse } from '@ghostfolio/common/interfaces'; +import { + AssertionCredentialJSON, + AttestationCredentialJSON, + OAuthResponse +} from '@ghostfolio/common/interfaces'; import { Body, @@ -22,10 +26,6 @@ import { Request, Response } from 'express'; import { getReasonPhrase, StatusCodes } from 'http-status-codes'; import { AuthService } from './auth.service'; -import { - AssertionCredentialJSON, - AttestationCredentialJSON -} from './interfaces/simplewebauthn'; @Controller('auth') export class AuthController { diff --git a/apps/api/src/app/auth/interfaces/interfaces.ts b/apps/api/src/app/auth/interfaces/interfaces.ts index 45415355e..4fdcc25b5 100644 --- a/apps/api/src/app/auth/interfaces/interfaces.ts +++ b/apps/api/src/app/auth/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import { AuthDeviceDto } from '@ghostfolio/api/app/auth-device/auth-device.dto'; +import { AuthDeviceDto } from '@ghostfolio/common/dtos'; import { Provider } from '@prisma/client'; diff --git a/apps/api/src/app/auth/web-auth.service.ts b/apps/api/src/app/auth/web-auth.service.ts index d14ef7798..6cffcd244 100644 --- a/apps/api/src/app/auth/web-auth.service.ts +++ b/apps/api/src/app/auth/web-auth.service.ts @@ -1,7 +1,11 @@ -import { AuthDeviceDto } from '@ghostfolio/api/app/auth-device/auth-device.dto'; import { AuthDeviceService } from '@ghostfolio/api/app/auth-device/auth-device.service'; import { UserService } from '@ghostfolio/api/app/user/user.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; +import { AuthDeviceDto } from '@ghostfolio/common/dtos'; +import { + AssertionCredentialJSON, + AttestationCredentialJSON +} from '@ghostfolio/common/interfaces'; import type { RequestWithUser } from '@ghostfolio/common/types'; import { @@ -27,11 +31,6 @@ import { import { isoBase64URL, isoUint8Array } from '@simplewebauthn/server/helpers'; import ms from 'ms'; -import { - AssertionCredentialJSON, - AttestationCredentialJSON -} from './interfaces/simplewebauthn'; - @Injectable() export class WebAuthService { public constructor( diff --git a/apps/api/src/app/endpoints/market-data/market-data.controller.ts b/apps/api/src/app/endpoints/market-data/market-data.controller.ts index 4843536da..987d34918 100644 --- a/apps/api/src/app/endpoints/market-data/market-data.controller.ts +++ b/apps/api/src/app/endpoints/market-data/market-data.controller.ts @@ -10,6 +10,7 @@ import { ghostfolioFearAndGreedIndexSymbolCryptocurrencies, ghostfolioFearAndGreedIndexSymbolStocks } from '@ghostfolio/common/config'; +import { UpdateBulkMarketDataDto } from '@ghostfolio/common/dtos'; import { getCurrencyFromSymbol, isCurrency } from '@ghostfolio/common/helper'; import { MarketDataDetailsResponse, @@ -35,8 +36,6 @@ import { DataSource, Prisma } from '@prisma/client'; import { parseISO } from 'date-fns'; import { getReasonPhrase, StatusCodes } from 'http-status-codes'; -import { UpdateBulkMarketDataDto } from './update-bulk-market-data.dto'; - @Controller('market-data') export class MarketDataController { public constructor( diff --git a/apps/api/src/app/endpoints/market-data/update-bulk-market-data.dto.ts b/apps/api/src/app/endpoints/market-data/update-bulk-market-data.dto.ts deleted file mode 100644 index d07b189b2..000000000 --- a/apps/api/src/app/endpoints/market-data/update-bulk-market-data.dto.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Type } from 'class-transformer'; -import { - ArrayNotEmpty, - IsArray, - IsISO8601, - IsNumber, - IsOptional -} from 'class-validator'; - -export class UpdateBulkMarketDataDto { - @ArrayNotEmpty() - @IsArray() - @Type(() => UpdateMarketDataDto) - marketData: UpdateMarketDataDto[]; -} - -class UpdateMarketDataDto { - @IsISO8601() - @IsOptional() - date?: string; - - @IsNumber() - marketPrice: number; -} diff --git a/apps/api/src/app/endpoints/tags/tags.controller.ts b/apps/api/src/app/endpoints/tags/tags.controller.ts index bf216bb21..925e1e0ed 100644 --- a/apps/api/src/app/endpoints/tags/tags.controller.ts +++ b/apps/api/src/app/endpoints/tags/tags.controller.ts @@ -1,6 +1,7 @@ import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorator'; import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; import { TagService } from '@ghostfolio/api/services/tag/tag.service'; +import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { RequestWithUser } from '@ghostfolio/common/types'; @@ -21,9 +22,6 @@ import { AuthGuard } from '@nestjs/passport'; import { Tag } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; -import { CreateTagDto } from './create-tag.dto'; -import { UpdateTagDto } from './update-tag.dto'; - @Controller('tags') export class TagsController { public constructor( diff --git a/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts b/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts index 2a8ea9875..78693239a 100644 --- a/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts +++ b/apps/api/src/app/endpoints/watchlist/watchlist.controller.ts @@ -4,6 +4,7 @@ import { TransformDataSourceInRequestInterceptor } from '@ghostfolio/api/interce import { TransformDataSourceInResponseInterceptor } from '@ghostfolio/api/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor'; import { ImpersonationService } from '@ghostfolio/api/services/impersonation/impersonation.service'; import { HEADER_KEY_IMPERSONATION } from '@ghostfolio/common/config'; +import { CreateWatchlistItemDto } from '@ghostfolio/common/dtos'; import { WatchlistResponse } from '@ghostfolio/common/interfaces'; import { permissions } from '@ghostfolio/common/permissions'; import { RequestWithUser } from '@ghostfolio/common/types'; @@ -26,7 +27,6 @@ import { AuthGuard } from '@nestjs/passport'; import { DataSource } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; -import { CreateWatchlistItemDto } from './create-watchlist-item.dto'; import { WatchlistService } from './watchlist.service'; @Controller('watchlist') diff --git a/apps/api/src/app/import/import-data.dto.ts b/apps/api/src/app/import/import-data.dto.ts index 330bc52f6..bf45c7cda 100644 --- a/apps/api/src/app/import/import-data.dto.ts +++ b/apps/api/src/app/import/import-data.dto.ts @@ -1,12 +1,13 @@ -import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; +import { + CreateAccountWithBalancesDto, + CreateAssetProfileWithMarketDataDto, + CreateOrderDto, + CreateTagDto +} from '@ghostfolio/common/dtos'; import { Type } from 'class-transformer'; import { IsArray, IsOptional, ValidateNested } from 'class-validator'; -import { CreateTagDto } from '../endpoints/tags/create-tag.dto'; -import { CreateAccountWithBalancesDto } from './create-account-with-balances.dto'; -import { CreateAssetProfileWithMarketDataDto } from './create-asset-profile-with-market-data.dto'; - export class ImportDataDto { @IsArray() @IsOptional() diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index cac466192..a5f3dda96 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -1,6 +1,4 @@ import { AccountService } from '@ghostfolio/api/app/account/account.service'; -import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; -import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; import { OrderService } from '@ghostfolio/api/app/order/order.service'; import { PlatformService } from '@ghostfolio/api/app/platform/platform.service'; import { PortfolioService } from '@ghostfolio/api/app/portfolio/portfolio.service'; @@ -11,6 +9,11 @@ import { DataGatheringService } from '@ghostfolio/api/services/queues/data-gathe import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; import { TagService } from '@ghostfolio/api/services/tag/tag.service'; import { DATA_GATHERING_QUEUE_PRIORITY_HIGH } from '@ghostfolio/common/config'; +import { + CreateAssetProfileDto, + CreateAccountDto, + CreateOrderDto +} from '@ghostfolio/common/dtos'; import { getAssetProfileIdentifier, parseDate @@ -34,7 +37,6 @@ import { endOfToday, isAfter, isSameSecond, parseISO } from 'date-fns'; import { omit, uniqBy } from 'lodash'; import { v4 as uuidv4 } from 'uuid'; -import { CreateAssetProfileDto } from '../admin/create-asset-profile.dto'; import { ImportDataDto } from './import-data.dto'; @Injectable() diff --git a/apps/api/src/app/order/order.controller.ts b/apps/api/src/app/order/order.controller.ts index d6c231059..962558315 100644 --- a/apps/api/src/app/order/order.controller.ts +++ b/apps/api/src/app/order/order.controller.ts @@ -11,6 +11,7 @@ import { DATA_GATHERING_QUEUE_PRIORITY_HIGH, HEADER_KEY_IMPERSONATION } from '@ghostfolio/common/config'; +import { CreateOrderDto, UpdateOrderDto } from '@ghostfolio/common/dtos'; import { ActivitiesResponse, ActivityResponse @@ -39,9 +40,7 @@ import { Order as OrderModel, Prisma } from '@prisma/client'; import { parseISO } from 'date-fns'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; -import { CreateOrderDto } from './create-order.dto'; import { OrderService } from './order.service'; -import { UpdateOrderDto } from './update-order.dto'; @Controller('order') export class OrderController { diff --git a/apps/api/src/app/platform/platform.controller.ts b/apps/api/src/app/platform/platform.controller.ts index c91f58cf8..2d4a1d413 100644 --- a/apps/api/src/app/platform/platform.controller.ts +++ b/apps/api/src/app/platform/platform.controller.ts @@ -1,5 +1,6 @@ import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorator'; import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; +import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos'; import { permissions } from '@ghostfolio/common/permissions'; import { @@ -17,9 +18,7 @@ import { AuthGuard } from '@nestjs/passport'; import { Platform } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; -import { CreatePlatformDto } from './create-platform.dto'; import { PlatformService } from './platform.service'; -import { UpdatePlatformDto } from './update-platform.dto'; @Controller('platform') export class PlatformController { diff --git a/apps/api/src/app/portfolio/rules.service.ts b/apps/api/src/app/portfolio/rules.service.ts index 48d1658aa..5bfb116e0 100644 --- a/apps/api/src/app/portfolio/rules.service.ts +++ b/apps/api/src/app/portfolio/rules.service.ts @@ -1,7 +1,7 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { PortfolioReportRule, + RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; diff --git a/apps/api/src/app/user/user.controller.ts b/apps/api/src/app/user/user.controller.ts index 8704662f7..397ae016b 100644 --- a/apps/api/src/app/user/user.controller.ts +++ b/apps/api/src/app/user/user.controller.ts @@ -3,9 +3,15 @@ import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard' import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { PrismaService } from '@ghostfolio/api/services/prisma/prisma.service'; import { PropertyService } from '@ghostfolio/api/services/property/property.service'; +import { + DeleteOwnUserDto, + UpdateOwnAccessTokenDto, + UpdateUserSettingDto +} from '@ghostfolio/common/dtos'; import { AccessTokenResponse, User, + UserItem, UserSettings } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; @@ -31,10 +37,6 @@ import { User as UserModel } from '@prisma/client'; import { StatusCodes, getReasonPhrase } from 'http-status-codes'; import { merge, size } from 'lodash'; -import { DeleteOwnUserDto } from './delete-own-user.dto'; -import { UserItem } from './interfaces/user-item.interface'; -import { UpdateOwnAccessTokenDto } from './update-own-access-token.dto'; -import { UpdateUserSettingDto } from './update-user-setting.dto'; import { UserService } from './user.service'; @Controller('user') diff --git a/apps/api/src/models/interfaces/rule.interface.ts b/apps/api/src/models/interfaces/rule.interface.ts index 5dcd42317..7c794614e 100644 --- a/apps/api/src/models/interfaces/rule.interface.ts +++ b/apps/api/src/models/interfaces/rule.interface.ts @@ -1,5 +1,4 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; -import { UserSettings } from '@ghostfolio/common/interfaces'; +import { RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; import { EvaluationResult } from './evaluation-result.interface'; diff --git a/apps/api/src/models/rule.ts b/apps/api/src/models/rule.ts index 52491a0b7..9c27e0018 100644 --- a/apps/api/src/models/rule.ts +++ b/apps/api/src/models/rule.ts @@ -1,10 +1,10 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config'; import { groupBy } from '@ghostfolio/common/helper'; import { PortfolioPosition, PortfolioReportRule, + RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; 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 51c808b25..0004d394e 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,8 +1,11 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { PortfolioDetails, UserSettings } from '@ghostfolio/common/interfaces'; +import { + PortfolioDetails, + RuleSettings, + UserSettings +} from '@ghostfolio/common/interfaces'; import { Account } from '@prisma/client'; 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 0e07a9dc6..9988ea3cc 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,8 +1,11 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { PortfolioDetails, UserSettings } from '@ghostfolio/common/interfaces'; +import { + PortfolioDetails, + RuleSettings, + UserSettings +} from '@ghostfolio/common/interfaces'; export class AccountClusterRiskSingleAccount extends Rule { private accounts: PortfolioDetails['accounts']; diff --git a/apps/api/src/models/rules/asset-class-cluster-risk/equity.ts b/apps/api/src/models/rules/asset-class-cluster-risk/equity.ts index 9a6f9dacb..f70756e91 100644 --- a/apps/api/src/models/rules/asset-class-cluster-risk/equity.ts +++ b/apps/api/src/models/rules/asset-class-cluster-risk/equity.ts @@ -1,8 +1,11 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { PortfolioPosition, UserSettings } from '@ghostfolio/common/interfaces'; +import { + PortfolioPosition, + RuleSettings, + UserSettings +} from '@ghostfolio/common/interfaces'; export class AssetClassClusterRiskEquity extends Rule { private holdings: PortfolioPosition[]; diff --git a/apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts b/apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts index 70cdb63c8..3bd835e4d 100644 --- a/apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts +++ b/apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts @@ -1,8 +1,11 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { PortfolioPosition, UserSettings } from '@ghostfolio/common/interfaces'; +import { + PortfolioPosition, + RuleSettings, + UserSettings +} from '@ghostfolio/common/interfaces'; export class AssetClassClusterRiskFixedIncome extends Rule { private holdings: PortfolioPosition[]; 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 273c98e35..d3176582f 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,8 +1,11 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { PortfolioPosition, UserSettings } from '@ghostfolio/common/interfaces'; +import { + PortfolioPosition, + RuleSettings, + UserSettings +} from '@ghostfolio/common/interfaces'; export class CurrencyClusterRiskBaseCurrencyCurrentInvestment extends Rule { private holdings: PortfolioPosition[]; 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 b09b7f3ef..c73160b52 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,8 +1,11 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { PortfolioPosition, UserSettings } from '@ghostfolio/common/interfaces'; +import { + PortfolioPosition, + RuleSettings, + UserSettings +} from '@ghostfolio/common/interfaces'; export class CurrencyClusterRiskCurrentInvestment extends Rule { private holdings: PortfolioPosition[]; diff --git a/apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts b/apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts index fa4f80d40..df9b78eef 100644 --- a/apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts +++ b/apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts @@ -1,8 +1,7 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { UserSettings } from '@ghostfolio/common/interfaces'; +import { RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; export class EconomicMarketClusterRiskDevelopedMarkets extends Rule { private currentValueInBaseCurrency: number; diff --git a/apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts b/apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts index 1414b53ed..4583dc50a 100644 --- a/apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts +++ b/apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts @@ -1,8 +1,7 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { UserSettings } from '@ghostfolio/common/interfaces'; +import { RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; export class EconomicMarketClusterRiskEmergingMarkets extends Rule { private currentValueInBaseCurrency: number; diff --git a/apps/api/src/models/rules/emergency-fund/emergency-fund-setup.ts b/apps/api/src/models/rules/emergency-fund/emergency-fund-setup.ts index 2129f438b..b956263f8 100644 --- a/apps/api/src/models/rules/emergency-fund/emergency-fund-setup.ts +++ b/apps/api/src/models/rules/emergency-fund/emergency-fund-setup.ts @@ -1,8 +1,7 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { UserSettings } from '@ghostfolio/common/interfaces'; +import { RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; export class EmergencyFundSetup extends Rule { private emergencyFund: number; 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 c5448a277..cb85a73ba 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,8 +1,7 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { UserSettings } from '@ghostfolio/common/interfaces'; +import { RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; export class FeeRatioInitialInvestment extends Rule { private fees: number; diff --git a/apps/api/src/models/rules/liquidity/buying-power.ts b/apps/api/src/models/rules/liquidity/buying-power.ts index 2cd4d6fee..541750d7e 100644 --- a/apps/api/src/models/rules/liquidity/buying-power.ts +++ b/apps/api/src/models/rules/liquidity/buying-power.ts @@ -1,8 +1,7 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; import { Rule } from '@ghostfolio/api/models/rule'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { I18nService } from '@ghostfolio/api/services/i18n/i18n.service'; -import { UserSettings } from '@ghostfolio/common/interfaces'; +import { RuleSettings, UserSettings } from '@ghostfolio/common/interfaces'; export class BuyingPower extends Rule { private buyingPower: number; diff --git a/apps/api/src/models/rules/regional-market-cluster-risk/interfaces/rule-settings.interface.ts b/apps/api/src/models/rules/regional-market-cluster-risk/interfaces/rule-settings.interface.ts index 8b9fddf3a..621b4df0b 100644 --- a/apps/api/src/models/rules/regional-market-cluster-risk/interfaces/rule-settings.interface.ts +++ b/apps/api/src/models/rules/regional-market-cluster-risk/interfaces/rule-settings.interface.ts @@ -1,4 +1,4 @@ -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { RuleSettings } from '@ghostfolio/common/interfaces'; export interface Settings extends RuleSettings { baseCurrency: string; diff --git a/apps/api/src/services/market-data/market-data.service.ts b/apps/api/src/services/market-data/market-data.service.ts index d318b9a70..87b08e1bd 100644 --- a/apps/api/src/services/market-data/market-data.service.ts +++ b/apps/api/src/services/market-data/market-data.service.ts @@ -1,7 +1,7 @@ -import { UpdateMarketDataDto } from '@ghostfolio/api/app/admin/update-market-data.dto'; import { DateQuery } from '@ghostfolio/api/app/portfolio/interfaces/date-query.interface'; import { DataGatheringItem } from '@ghostfolio/api/services/interfaces/interfaces'; import { PrismaService } from '@ghostfolio/api/services/prisma/prisma.service'; +import { UpdateMarketDataDto } from '@ghostfolio/common/dtos'; import { resetHours } from '@ghostfolio/common/helper'; import { AssetProfileIdentifier } from '@ghostfolio/common/interfaces'; diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts index 47ba48f4e..ceae50f01 100644 --- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts +++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts @@ -1,11 +1,10 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateAccountBalanceDto } from '@ghostfolio/api/app/account-balance/create-account-balance.dto'; import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; +import { CreateAccountBalanceDto } from '@ghostfolio/common/dtos'; import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; import { AccountBalancesResponse, diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts index 2b96bda3b..4f1b60981 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts @@ -1,4 +1,3 @@ -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; @@ -15,6 +14,7 @@ import { } from '@ghostfolio/common/interfaces'; import { AdminMarketDataItem } from '@ghostfolio/common/interfaces/admin-market-data.interface'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { GfActivitiesFilterComponent } from '@ghostfolio/ui/activities-filter'; import { translate } from '@ghostfolio/ui/i18n'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index 83b2586ce..9969a59ba 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -1,5 +1,3 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { UpdateAssetProfileDto } from '@ghostfolio/api/app/admin/update-asset-profile.dto'; import { AdminMarketDataService } from '@ghostfolio/client/components/admin-market-data/admin-market-data.service'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { AdminService } from '@ghostfolio/client/services/admin.service'; @@ -10,6 +8,7 @@ import { ASSET_CLASS_MAPPING, PROPERTY_IS_DATA_GATHERING_ENABLED } from '@ghostfolio/common/config'; +import { UpdateAssetProfileDto } from '@ghostfolio/common/dtos'; import { DATE_FORMAT } from '@ghostfolio/common/helper'; import { AdminMarketDataDetails, diff --git a/apps/client/src/app/components/admin-platform/admin-platform.component.ts b/apps/client/src/app/components/admin-platform/admin-platform.component.ts index 76d00bb10..1dd150ac5 100644 --- a/apps/client/src/app/components/admin-platform/admin-platform.component.ts +++ b/apps/client/src/app/components/admin-platform/admin-platform.component.ts @@ -1,11 +1,9 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreatePlatformDto } from '@ghostfolio/api/app/platform/create-platform.dto'; -import { UpdatePlatformDto } from '@ghostfolio/api/app/platform/update-platform.dto'; import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { diff --git a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts index 0d9e6f8bd..23e6ca271 100644 --- a/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts +++ b/apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts @@ -1,7 +1,5 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreatePlatformDto } from '@ghostfolio/api/app/platform/create-platform.dto'; -import { UpdatePlatformDto } from '@ghostfolio/api/app/platform/update-platform.dto'; import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; +import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { diff --git a/apps/client/src/app/components/admin-tag/admin-tag.component.ts b/apps/client/src/app/components/admin-tag/admin-tag.component.ts index 4fd34acc0..6b79b8fe6 100644 --- a/apps/client/src/app/components/admin-tag/admin-tag.component.ts +++ b/apps/client/src/app/components/admin-tag/admin-tag.component.ts @@ -1,10 +1,8 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateTagDto } from '@ghostfolio/api/app/endpoints/tags/create-tag.dto'; -import { UpdateTagDto } from '@ghostfolio/api/app/endpoints/tags/update-tag.dto'; import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos'; import { ChangeDetectionStrategy, diff --git a/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts b/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts index 2d1babeb4..487a4d498 100644 --- a/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts +++ b/apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts @@ -1,7 +1,5 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateTagDto } from '@ghostfolio/api/app/endpoints/tags/create-tag.dto'; -import { UpdateTagDto } from '@ghostfolio/api/app/endpoints/tags/update-tag.dto'; import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; +import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos'; import { ChangeDetectionStrategy, diff --git a/apps/client/src/app/components/header/header.component.ts b/apps/client/src/app/components/header/header.component.ts index 03d53e058..9fb9a8351 100644 --- a/apps/client/src/app/components/header/header.component.ts +++ b/apps/client/src/app/components/header/header.component.ts @@ -1,5 +1,3 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { UpdateUserSettingDto } from '@ghostfolio/api/app/user/update-user-setting.dto'; import { LoginWithAccessTokenDialogParams } from '@ghostfolio/client/components/login-with-access-token-dialog/interfaces/interfaces'; import { GfLoginWithAccessTokenDialogComponent } from '@ghostfolio/client/components/login-with-access-token-dialog/login-with-access-token-dialog.component'; import { LayoutService } from '@ghostfolio/client/core/layout.service'; @@ -12,6 +10,7 @@ import { } from '@ghostfolio/client/services/settings-storage.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { UpdateUserSettingDto } from '@ghostfolio/common/dtos'; import { Filter, InfoItem, User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { internalRoutes, publicRoutes } from '@ghostfolio/common/routes/routes'; diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts index a6c02f7dc..caca0c2bc 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts @@ -1,5 +1,3 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { DataService } from '@ghostfolio/client/services/data.service'; @@ -9,6 +7,7 @@ import { NUMERICAL_PRECISION_THRESHOLD_5_FIGURES, NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; +import { CreateOrderDto } from '@ghostfolio/common/dtos'; import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; import { Activity, diff --git a/apps/client/src/app/components/rule/rule.component.ts b/apps/client/src/app/components/rule/rule.component.ts index 9b40f8f50..e2ffc1cf6 100644 --- a/apps/client/src/app/components/rule/rule.component.ts +++ b/apps/client/src/app/components/rule/rule.component.ts @@ -1,8 +1,7 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { UpdateUserSettingDto } from '@ghostfolio/api/app/user/update-user-setting.dto'; -import { RuleSettings } from '@ghostfolio/api/models/interfaces/rule-settings.interface'; +import { UpdateUserSettingDto } from '@ghostfolio/common/dtos'; import { PortfolioReportRule, + RuleSettings, XRayRulesSettings } from '@ghostfolio/common/interfaces'; diff --git a/apps/client/src/app/components/rules/rules.component.ts b/apps/client/src/app/components/rules/rules.component.ts index 7dd322c21..22e1718f8 100644 --- a/apps/client/src/app/components/rules/rules.component.ts +++ b/apps/client/src/app/components/rules/rules.component.ts @@ -1,6 +1,5 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { UpdateUserSettingDto } from '@ghostfolio/api/app/user/update-user-setting.dto'; import { GfRuleComponent } from '@ghostfolio/client/components/rule/rule.component'; +import { UpdateUserSettingDto } from '@ghostfolio/common/dtos'; import { PortfolioReportRule, XRayRulesSettings diff --git a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts index 9c21c4f34..be0842467 100644 --- a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts +++ b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts @@ -1,9 +1,7 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateAccessDto } from '@ghostfolio/api/app/access/create-access.dto'; -import { UpdateAccessDto } from '@ghostfolio/api/app/access/update-access.dto'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; +import { CreateAccessDto, UpdateAccessDto } from '@ghostfolio/common/dtos'; import { ChangeDetectionStrategy, diff --git a/apps/client/src/app/components/user-account-access/user-account-access.component.ts b/apps/client/src/app/components/user-account-access/user-account-access.component.ts index de2483e50..38d34a4e2 100644 --- a/apps/client/src/app/components/user-account-access/user-account-access.component.ts +++ b/apps/client/src/app/components/user-account-access/user-account-access.component.ts @@ -1,11 +1,10 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateAccessDto } from '@ghostfolio/api/app/access/create-access.dto'; import { GfAccessTableComponent } from '@ghostfolio/client/components/access-table/access-table.component'; import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { CreateAccessDto } from '@ghostfolio/common/dtos'; import { Access, User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; 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 010d727c6..2bb6457a5 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.component.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts @@ -1,13 +1,14 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; -import { TransferBalanceDto } from '@ghostfolio/api/app/account/transfer-balance.dto'; -import { UpdateAccountDto } from '@ghostfolio/api/app/account/update-account.dto'; import { GfAccountDetailDialogComponent } from '@ghostfolio/client/components/account-detail-dialog/account-detail-dialog.component'; import { AccountDetailDialogParams } from '@ghostfolio/client/components/account-detail-dialog/interfaces/interfaces'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { + CreateAccountDto, + TransferBalanceDto, + UpdateAccountDto +} from '@ghostfolio/common/dtos'; import { User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { GfAccountsTableComponent } from '@ghostfolio/ui/accounts-table'; diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts index 8df990d3d..08ecbf15a 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts @@ -1,8 +1,6 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; -import { UpdateAccountDto } from '@ghostfolio/api/app/account/update-account.dto'; import { DataService } from '@ghostfolio/client/services/data.service'; import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; +import { CreateAccountDto, UpdateAccountDto } from '@ghostfolio/common/dtos'; import { GfCurrencySelectorComponent } from '@ghostfolio/ui/currency-selector'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; diff --git a/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts b/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts index 4af1dbe6f..85d2e60bf 100644 --- a/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts +++ b/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts @@ -1,5 +1,4 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { TransferBalanceDto } from '@ghostfolio/api/app/account/transfer-balance.dto'; +import { TransferBalanceDto } from '@ghostfolio/common/dtos'; import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; import { diff --git a/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts b/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts index d6a1540d0..5b5273b65 100644 --- a/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts @@ -1,11 +1,9 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; -import { UpdateOrderDto } from '@ghostfolio/api/app/order/update-order.dto'; import { DataService } from '@ghostfolio/client/services/data.service'; import { IcsService } from '@ghostfolio/client/services/ics/ics.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config'; +import { CreateOrderDto, UpdateOrderDto } from '@ghostfolio/common/dtos'; import { downloadAsFile } from '@ghostfolio/common/helper'; import { Activity, diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts index 4d2f958e7..3aedb8d73 100644 --- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts @@ -1,8 +1,6 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; -import { UpdateOrderDto } from '@ghostfolio/api/app/order/update-order.dto'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { ASSET_CLASS_MAPPING } from '@ghostfolio/common/config'; +import { CreateOrderDto, UpdateOrderDto } from '@ghostfolio/common/dtos'; import { getDateFormatString } from '@ghostfolio/common/helper'; import { AssetClassSelectorOption, diff --git a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts index e2b1403c0..a3d7d326d 100644 --- a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts @@ -1,14 +1,15 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateTagDto } from '@ghostfolio/api/app/endpoints/tags/create-tag.dto'; -import { CreateAccountWithBalancesDto } from '@ghostfolio/api/app/import/create-account-with-balances.dto'; -import { CreateAssetProfileWithMarketDataDto } from '@ghostfolio/api/app/import/create-asset-profile-with-market-data.dto'; import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; import { GfFileDropDirective } from '@ghostfolio/client/directives/file-drop/file-drop.directive'; -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImportActivitiesService } from '@ghostfolio/client/services/import-activities.service'; +import { + CreateAccountWithBalancesDto, + CreateAssetProfileWithMarketDataDto, + CreateTagDto +} from '@ghostfolio/common/dtos'; import { Activity, PortfolioPosition } from '@ghostfolio/common/interfaces'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { GfActivitiesTableComponent } from '@ghostfolio/ui/activities-table'; import { diff --git a/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts b/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts index bbd50a0e1..0bf869238 100644 --- a/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts +++ b/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.ts @@ -1,9 +1,8 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { UpdateUserSettingDto } from '@ghostfolio/api/app/user/update-user-setting.dto'; import { GfRulesComponent } from '@ghostfolio/client/components/rules/rules.component'; import { DataService } from '@ghostfolio/client/services/data.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { UpdateUserSettingDto } from '@ghostfolio/common/dtos'; import { PortfolioReportResponse, PortfolioReportRule diff --git a/apps/client/src/app/services/admin.service.ts b/apps/client/src/app/services/admin.service.ts index 68a02facc..10804aac9 100644 --- a/apps/client/src/app/services/admin.service.ts +++ b/apps/client/src/app/services/admin.service.ts @@ -1,12 +1,13 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { UpdateAssetProfileDto } from '@ghostfolio/api/app/admin/update-asset-profile.dto'; -import { CreatePlatformDto } from '@ghostfolio/api/app/platform/create-platform.dto'; -import { UpdatePlatformDto } from '@ghostfolio/api/app/platform/update-platform.dto'; import { + DEFAULT_PAGE_SIZE, HEADER_KEY_SKIP_INTERCEPTOR, HEADER_KEY_TOKEN } from '@ghostfolio/common/config'; -import { DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config'; +import { + CreatePlatformDto, + UpdateAssetProfileDto, + UpdatePlatformDto +} from '@ghostfolio/common/dtos'; import { AdminData, AdminJobs, diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index 60118d205..4c324fe03 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -1,21 +1,21 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateAccessDto } from '@ghostfolio/api/app/access/create-access.dto'; -import { UpdateAccessDto } from '@ghostfolio/api/app/access/update-access.dto'; -import { CreateAccountBalanceDto } from '@ghostfolio/api/app/account-balance/create-account-balance.dto'; -import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; -import { TransferBalanceDto } from '@ghostfolio/api/app/account/transfer-balance.dto'; -import { UpdateAccountDto } from '@ghostfolio/api/app/account/update-account.dto'; -import { UpdateBulkMarketDataDto } from '@ghostfolio/api/app/admin/update-bulk-market-data.dto'; -import { CreateTagDto } from '@ghostfolio/api/app/endpoints/tags/create-tag.dto'; -import { UpdateTagDto } from '@ghostfolio/api/app/endpoints/tags/update-tag.dto'; -import { CreateWatchlistItemDto } from '@ghostfolio/api/app/endpoints/watchlist/create-watchlist-item.dto'; -import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; -import { UpdateOrderDto } from '@ghostfolio/api/app/order/update-order.dto'; -import { DeleteOwnUserDto } from '@ghostfolio/api/app/user/delete-own-user.dto'; -import { UserItem } from '@ghostfolio/api/app/user/interfaces/user-item.interface'; -import { UpdateOwnAccessTokenDto } from '@ghostfolio/api/app/user/update-own-access-token.dto'; -import { UpdateUserSettingDto } from '@ghostfolio/api/app/user/update-user-setting.dto'; -import { PropertyDto } from '@ghostfolio/api/services/property/property.dto'; +import { + CreateAccessDto, + CreateAccountBalanceDto, + CreateAccountDto, + CreateOrderDto, + CreateTagDto, + CreateWatchlistItemDto, + DeleteOwnUserDto, + TransferBalanceDto, + UpdateAccessDto, + UpdateAccountDto, + UpdateBulkMarketDataDto, + UpdateOrderDto, + UpdateOwnAccessTokenDto, + UpdatePropertyDto, + UpdateTagDto, + UpdateUserSettingDto +} from '@ghostfolio/common/dtos'; import { DATE_FORMAT } from '@ghostfolio/common/helper'; import { Access, @@ -52,6 +52,7 @@ import { PublicPortfolioResponse, SymbolItem, User, + UserItem, WatchlistResponse } from '@ghostfolio/common/interfaces'; import { filterGlobalPermissions } from '@ghostfolio/common/permissions'; @@ -808,7 +809,7 @@ export class DataService { return this.http.put(`/api/v1/account/${aAccount.id}`, aAccount); } - public putAdminSetting(key: string, aData: PropertyDto) { + public putAdminSetting(key: string, aData: UpdatePropertyDto) { return this.http.put(`/api/v1/admin/settings/${key}`, aData); } diff --git a/apps/client/src/app/services/import-activities.service.ts b/apps/client/src/app/services/import-activities.service.ts index 607b8a0a0..94d8470f7 100644 --- a/apps/client/src/app/services/import-activities.service.ts +++ b/apps/client/src/app/services/import-activities.service.ts @@ -1,8 +1,9 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { CreateTagDto } from '@ghostfolio/api/app/endpoints/tags/create-tag.dto'; -import { CreateAccountWithBalancesDto } from '@ghostfolio/api/app/import/create-account-with-balances.dto'; -import { CreateAssetProfileWithMarketDataDto } from '@ghostfolio/api/app/import/create-asset-profile-with-market-data.dto'; -import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; +import { + CreateAccountWithBalancesDto, + CreateAssetProfileWithMarketDataDto, + CreateOrderDto, + CreateTagDto +} from '@ghostfolio/common/dtos'; import { parseDate as parseDateHelper } from '@ghostfolio/common/helper'; import { Activity } from '@ghostfolio/common/interfaces'; diff --git a/apps/client/src/app/services/web-authn.service.ts b/apps/client/src/app/services/web-authn.service.ts index 9ace943b6..95c264310 100644 --- a/apps/client/src/app/services/web-authn.service.ts +++ b/apps/client/src/app/services/web-authn.service.ts @@ -1,10 +1,9 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { AuthDeviceDto } from '@ghostfolio/api/app/auth-device/auth-device.dto'; +import { SettingsStorageService } from '@ghostfolio/client/services/settings-storage.service'; +import { AuthDeviceDto } from '@ghostfolio/common/dtos'; import { PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON -} from '@ghostfolio/api/app/auth/interfaces/simplewebauthn'; -import { SettingsStorageService } from '@ghostfolio/client/services/settings-storage.service'; +} from '@ghostfolio/common/interfaces'; import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; diff --git a/apps/api/src/app/auth-device/auth-device.dto.ts b/libs/common/src/lib/dtos/auth-device.dto.ts similarity index 100% rename from apps/api/src/app/auth-device/auth-device.dto.ts rename to libs/common/src/lib/dtos/auth-device.dto.ts diff --git a/apps/api/src/app/access/create-access.dto.ts b/libs/common/src/lib/dtos/create-access.dto.ts similarity index 100% rename from apps/api/src/app/access/create-access.dto.ts rename to libs/common/src/lib/dtos/create-access.dto.ts diff --git a/apps/api/src/app/account-balance/create-account-balance.dto.ts b/libs/common/src/lib/dtos/create-account-balance.dto.ts similarity index 100% rename from apps/api/src/app/account-balance/create-account-balance.dto.ts rename to libs/common/src/lib/dtos/create-account-balance.dto.ts diff --git a/apps/api/src/app/import/create-account-with-balances.dto.ts b/libs/common/src/lib/dtos/create-account-with-balances.dto.ts similarity index 75% rename from apps/api/src/app/import/create-account-with-balances.dto.ts rename to libs/common/src/lib/dtos/create-account-with-balances.dto.ts index 6cf4057f8..53740f0f9 100644 --- a/apps/api/src/app/import/create-account-with-balances.dto.ts +++ b/libs/common/src/lib/dtos/create-account-with-balances.dto.ts @@ -1,4 +1,4 @@ -import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; +import { CreateAccountDto } from '@ghostfolio/common/dtos'; import { AccountBalance } from '@ghostfolio/common/interfaces'; import { IsArray, IsOptional } from 'class-validator'; diff --git a/apps/api/src/app/account/create-account.dto.ts b/libs/common/src/lib/dtos/create-account.dto.ts similarity index 89% rename from apps/api/src/app/account/create-account.dto.ts rename to libs/common/src/lib/dtos/create-account.dto.ts index b331d4ec7..fa88580f1 100644 --- a/apps/api/src/app/account/create-account.dto.ts +++ b/libs/common/src/lib/dtos/create-account.dto.ts @@ -1,4 +1,4 @@ -import { IsCurrencyCode } from '@ghostfolio/api/validators/is-currency-code'; +import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; import { Transform, TransformFnParams } from 'class-transformer'; import { diff --git a/apps/api/src/app/import/create-asset-profile-with-market-data.dto.ts b/libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts similarity index 85% rename from apps/api/src/app/import/create-asset-profile-with-market-data.dto.ts rename to libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts index fd90ab1af..04611371d 100644 --- a/apps/api/src/app/import/create-asset-profile-with-market-data.dto.ts +++ b/libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts @@ -3,7 +3,7 @@ import { MarketData } from '@ghostfolio/common/interfaces'; import { DataSource } from '@prisma/client'; import { IsArray, IsEnum, IsOptional } from 'class-validator'; -import { CreateAssetProfileDto } from '../admin/create-asset-profile.dto'; +import { CreateAssetProfileDto } from './create-asset-profile.dto'; export class CreateAssetProfileWithMarketDataDto extends CreateAssetProfileDto { @IsEnum([DataSource.MANUAL], { diff --git a/apps/api/src/app/admin/create-asset-profile.dto.ts b/libs/common/src/lib/dtos/create-asset-profile.dto.ts similarity index 94% rename from apps/api/src/app/admin/create-asset-profile.dto.ts rename to libs/common/src/lib/dtos/create-asset-profile.dto.ts index 8041b0f0e..80d45ba42 100644 --- a/apps/api/src/app/admin/create-asset-profile.dto.ts +++ b/libs/common/src/lib/dtos/create-asset-profile.dto.ts @@ -1,4 +1,4 @@ -import { IsCurrencyCode } from '@ghostfolio/api/validators/is-currency-code'; +import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; import { AssetClass, AssetSubClass, DataSource, Prisma } from '@prisma/client'; import { diff --git a/apps/api/src/app/order/create-order.dto.ts b/libs/common/src/lib/dtos/create-order.dto.ts similarity index 94% rename from apps/api/src/app/order/create-order.dto.ts rename to libs/common/src/lib/dtos/create-order.dto.ts index fb4ac32dd..dfd0d8aa5 100644 --- a/apps/api/src/app/order/create-order.dto.ts +++ b/libs/common/src/lib/dtos/create-order.dto.ts @@ -1,5 +1,5 @@ -import { IsCurrencyCode } from '@ghostfolio/api/validators/is-currency-code'; import { IsAfter1970Constraint } from '@ghostfolio/common/validator-constraints/is-after-1970'; +import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; import { AssetClass, AssetSubClass, DataSource, Type } from '@prisma/client'; import { Transform, TransformFnParams } from 'class-transformer'; diff --git a/apps/api/src/app/platform/create-platform.dto.ts b/libs/common/src/lib/dtos/create-platform.dto.ts similarity index 100% rename from apps/api/src/app/platform/create-platform.dto.ts rename to libs/common/src/lib/dtos/create-platform.dto.ts diff --git a/apps/api/src/app/endpoints/tags/create-tag.dto.ts b/libs/common/src/lib/dtos/create-tag.dto.ts similarity index 100% rename from apps/api/src/app/endpoints/tags/create-tag.dto.ts rename to libs/common/src/lib/dtos/create-tag.dto.ts diff --git a/apps/api/src/app/endpoints/watchlist/create-watchlist-item.dto.ts b/libs/common/src/lib/dtos/create-watchlist-item.dto.ts similarity index 100% rename from apps/api/src/app/endpoints/watchlist/create-watchlist-item.dto.ts rename to libs/common/src/lib/dtos/create-watchlist-item.dto.ts diff --git a/apps/api/src/app/user/delete-own-user.dto.ts b/libs/common/src/lib/dtos/delete-own-user.dto.ts similarity index 100% rename from apps/api/src/app/user/delete-own-user.dto.ts rename to libs/common/src/lib/dtos/delete-own-user.dto.ts diff --git a/libs/common/src/lib/dtos/index.ts b/libs/common/src/lib/dtos/index.ts new file mode 100644 index 000000000..3631d6eae --- /dev/null +++ b/libs/common/src/lib/dtos/index.ts @@ -0,0 +1,51 @@ +import { AuthDeviceDto } from './auth-device.dto'; +import { CreateAccessDto } from './create-access.dto'; +import { CreateAccountBalanceDto } from './create-account-balance.dto'; +import { CreateAccountWithBalancesDto } from './create-account-with-balances.dto'; +import { CreateAccountDto } from './create-account.dto'; +import { CreateAssetProfileWithMarketDataDto } from './create-asset-profile-with-market-data.dto'; +import { CreateAssetProfileDto } from './create-asset-profile.dto'; +import { CreateOrderDto } from './create-order.dto'; +import { CreatePlatformDto } from './create-platform.dto'; +import { CreateTagDto } from './create-tag.dto'; +import { CreateWatchlistItemDto } from './create-watchlist-item.dto'; +import { DeleteOwnUserDto } from './delete-own-user.dto'; +import { TransferBalanceDto } from './transfer-balance.dto'; +import { UpdateAccessDto } from './update-access.dto'; +import { UpdateAccountDto } from './update-account.dto'; +import { UpdateAssetProfileDto } from './update-asset-profile.dto'; +import { UpdateBulkMarketDataDto } from './update-bulk-market-data.dto'; +import { UpdateMarketDataDto } from './update-market-data.dto'; +import { UpdateOrderDto } from './update-order.dto'; +import { UpdateOwnAccessTokenDto } from './update-own-access-token.dto'; +import { UpdatePlatformDto } from './update-platform.dto'; +import { UpdatePropertyDto } from './update-property.dto'; +import { UpdateTagDto } from './update-tag.dto'; +import { UpdateUserSettingDto } from './update-user-setting.dto'; + +export { + AuthDeviceDto, + CreateAccessDto, + CreateAccountBalanceDto, + CreateAccountDto, + CreateAccountWithBalancesDto, + CreateAssetProfileDto, + CreateAssetProfileWithMarketDataDto, + CreateOrderDto, + CreatePlatformDto, + CreateTagDto, + CreateWatchlistItemDto, + DeleteOwnUserDto, + TransferBalanceDto, + UpdateAccessDto, + UpdateAccountDto, + UpdateAssetProfileDto, + UpdateBulkMarketDataDto, + UpdateMarketDataDto, + UpdateOrderDto, + UpdateOwnAccessTokenDto, + UpdatePlatformDto, + UpdatePropertyDto, + UpdateTagDto, + UpdateUserSettingDto +}; diff --git a/apps/api/src/app/account/transfer-balance.dto.ts b/libs/common/src/lib/dtos/transfer-balance.dto.ts similarity index 100% rename from apps/api/src/app/account/transfer-balance.dto.ts rename to libs/common/src/lib/dtos/transfer-balance.dto.ts diff --git a/apps/api/src/app/access/update-access.dto.ts b/libs/common/src/lib/dtos/update-access.dto.ts similarity index 100% rename from apps/api/src/app/access/update-access.dto.ts rename to libs/common/src/lib/dtos/update-access.dto.ts diff --git a/apps/api/src/app/account/update-account.dto.ts b/libs/common/src/lib/dtos/update-account.dto.ts similarity index 89% rename from apps/api/src/app/account/update-account.dto.ts rename to libs/common/src/lib/dtos/update-account.dto.ts index 3a721d873..066bacbfd 100644 --- a/apps/api/src/app/account/update-account.dto.ts +++ b/libs/common/src/lib/dtos/update-account.dto.ts @@ -1,4 +1,4 @@ -import { IsCurrencyCode } from '@ghostfolio/api/validators/is-currency-code'; +import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; import { Transform, TransformFnParams } from 'class-transformer'; import { diff --git a/apps/api/src/app/admin/update-asset-profile.dto.ts b/libs/common/src/lib/dtos/update-asset-profile.dto.ts similarity index 93% rename from apps/api/src/app/admin/update-asset-profile.dto.ts rename to libs/common/src/lib/dtos/update-asset-profile.dto.ts index 5056dccdb..43f5aa617 100644 --- a/apps/api/src/app/admin/update-asset-profile.dto.ts +++ b/libs/common/src/lib/dtos/update-asset-profile.dto.ts @@ -1,4 +1,4 @@ -import { IsCurrencyCode } from '@ghostfolio/api/validators/is-currency-code'; +import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; import { AssetClass, AssetSubClass, DataSource, Prisma } from '@prisma/client'; import { diff --git a/apps/api/src/app/admin/update-bulk-market-data.dto.ts b/libs/common/src/lib/dtos/update-bulk-market-data.dto.ts similarity index 79% rename from apps/api/src/app/admin/update-bulk-market-data.dto.ts rename to libs/common/src/lib/dtos/update-bulk-market-data.dto.ts index da0da1272..f92112f24 100644 --- a/apps/api/src/app/admin/update-bulk-market-data.dto.ts +++ b/libs/common/src/lib/dtos/update-bulk-market-data.dto.ts @@ -1,8 +1,8 @@ +import { UpdateMarketDataDto } from '@ghostfolio/common/dtos'; + import { Type } from 'class-transformer'; import { ArrayNotEmpty, IsArray } from 'class-validator'; -import { UpdateMarketDataDto } from './update-market-data.dto'; - export class UpdateBulkMarketDataDto { @ArrayNotEmpty() @IsArray() diff --git a/apps/api/src/app/admin/update-market-data.dto.ts b/libs/common/src/lib/dtos/update-market-data.dto.ts similarity index 100% rename from apps/api/src/app/admin/update-market-data.dto.ts rename to libs/common/src/lib/dtos/update-market-data.dto.ts diff --git a/apps/api/src/app/order/update-order.dto.ts b/libs/common/src/lib/dtos/update-order.dto.ts similarity index 94% rename from apps/api/src/app/order/update-order.dto.ts rename to libs/common/src/lib/dtos/update-order.dto.ts index 25c92532a..3656a8043 100644 --- a/apps/api/src/app/order/update-order.dto.ts +++ b/libs/common/src/lib/dtos/update-order.dto.ts @@ -1,5 +1,5 @@ -import { IsCurrencyCode } from '@ghostfolio/api/validators/is-currency-code'; import { IsAfter1970Constraint } from '@ghostfolio/common/validator-constraints/is-after-1970'; +import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; import { AssetClass, AssetSubClass, DataSource, Type } from '@prisma/client'; import { Transform, TransformFnParams } from 'class-transformer'; diff --git a/apps/api/src/app/user/update-own-access-token.dto.ts b/libs/common/src/lib/dtos/update-own-access-token.dto.ts similarity index 100% rename from apps/api/src/app/user/update-own-access-token.dto.ts rename to libs/common/src/lib/dtos/update-own-access-token.dto.ts diff --git a/apps/api/src/app/platform/update-platform.dto.ts b/libs/common/src/lib/dtos/update-platform.dto.ts similarity index 100% rename from apps/api/src/app/platform/update-platform.dto.ts rename to libs/common/src/lib/dtos/update-platform.dto.ts diff --git a/apps/api/src/services/property/property.dto.ts b/libs/common/src/lib/dtos/update-property.dto.ts similarity index 76% rename from apps/api/src/services/property/property.dto.ts rename to libs/common/src/lib/dtos/update-property.dto.ts index 037b4703c..77115759a 100644 --- a/apps/api/src/services/property/property.dto.ts +++ b/libs/common/src/lib/dtos/update-property.dto.ts @@ -1,6 +1,6 @@ import { IsOptional, IsString } from 'class-validator'; -export class PropertyDto { +export class UpdatePropertyDto { @IsOptional() @IsString() value: string; diff --git a/apps/api/src/app/endpoints/tags/update-tag.dto.ts b/libs/common/src/lib/dtos/update-tag.dto.ts similarity index 100% rename from apps/api/src/app/endpoints/tags/update-tag.dto.ts rename to libs/common/src/lib/dtos/update-tag.dto.ts diff --git a/apps/api/src/app/user/update-user-setting.dto.ts b/libs/common/src/lib/dtos/update-user-setting.dto.ts similarity index 96% rename from apps/api/src/app/user/update-user-setting.dto.ts rename to libs/common/src/lib/dtos/update-user-setting.dto.ts index 3ee59f7dd..cf7dff7e8 100644 --- a/apps/api/src/app/user/update-user-setting.dto.ts +++ b/libs/common/src/lib/dtos/update-user-setting.dto.ts @@ -1,4 +1,3 @@ -import { IsCurrencyCode } from '@ghostfolio/api/validators/is-currency-code'; import { XRayRulesSettings } from '@ghostfolio/common/interfaces'; import type { ColorScheme, @@ -6,6 +5,7 @@ import type { HoldingsViewMode, ViewMode } from '@ghostfolio/common/types'; +import { IsCurrencyCode } from '@ghostfolio/common/validators/is-currency-code'; import { IsArray, diff --git a/libs/common/src/lib/interfaces/index.ts b/libs/common/src/lib/interfaces/index.ts index c47af2d97..1d7991e40 100644 --- a/libs/common/src/lib/interfaces/index.ts +++ b/libs/common/src/lib/interfaces/index.ts @@ -68,7 +68,7 @@ import type { MarketDataDetailsResponse } from './responses/market-data-details- import type { MarketDataOfMarketsResponse } from './responses/market-data-of-markets-response.interface'; import type { OAuthResponse } from './responses/oauth-response.interface'; import type { PortfolioDividendsResponse } from './responses/portfolio-dividends-response.interface'; -import { PortfolioHoldingResponse } from './responses/portfolio-holding-response.interface'; +import type { PortfolioHoldingResponse } from './responses/portfolio-holding-response.interface'; import type { PortfolioHoldingsResponse } from './responses/portfolio-holdings-response.interface'; import type { PortfolioInvestmentsResponse } from './responses/portfolio-investments.interface'; import type { PortfolioPerformanceResponse } from './responses/portfolio-performance-response.interface'; @@ -76,7 +76,14 @@ import type { PortfolioReportResponse } from './responses/portfolio-report.inter import type { PublicPortfolioResponse } from './responses/public-portfolio-response.interface'; import type { QuotesResponse } from './responses/quotes-response.interface'; import type { WatchlistResponse } from './responses/watchlist-response.interface'; +import type { RuleSettings } from './rule-settings.interface'; import type { ScraperConfiguration } from './scraper-configuration.interface'; +import type { + AssertionCredentialJSON, + AttestationCredentialJSON, + PublicKeyCredentialCreationOptionsJSON, + PublicKeyCredentialRequestOptionsJSON +} from './simplewebauthn.interface'; import type { Statistics } from './statistics.interface'; import type { SubscriptionOffer } from './subscription-offer.interface'; import type { SymbolItem } from './symbol-item.interface'; @@ -84,6 +91,7 @@ import type { SymbolMetrics } from './symbol-metrics.interface'; import type { SystemMessage } from './system-message.interface'; import type { TabConfiguration } from './tab-configuration.interface'; import type { ToggleOption } from './toggle-option.interface'; +import type { UserItem } from './user-item.interface'; import type { UserSettings } from './user-settings.interface'; import type { User } from './user.interface'; import type { XRayRulesSettings } from './x-ray-rules-settings.interface'; @@ -109,9 +117,11 @@ export { AdminUsersResponse, AiPromptResponse, ApiKeyResponse, + AssertionCredentialJSON, AssetClassSelectorOption, AssetProfileIdentifier, AssetResponse, + AttestationCredentialJSON, Benchmark, BenchmarkMarketDataDetailsResponse, BenchmarkProperty, @@ -160,9 +170,12 @@ export { PortfolioSummary, Position, Product, + PublicKeyCredentialCreationOptionsJSON, + PublicKeyCredentialRequestOptionsJSON, PublicPortfolioResponse, QuotesResponse, ResponseError, + RuleSettings, ScraperConfiguration, Statistics, SubscriptionOffer, @@ -172,6 +185,7 @@ export { TabConfiguration, ToggleOption, User, + UserItem, UserSettings, WatchlistResponse, XRayRulesSettings diff --git a/apps/api/src/models/interfaces/rule-settings.interface.ts b/libs/common/src/lib/interfaces/rule-settings.interface.ts similarity index 100% rename from apps/api/src/models/interfaces/rule-settings.interface.ts rename to libs/common/src/lib/interfaces/rule-settings.interface.ts diff --git a/apps/api/src/app/auth/interfaces/simplewebauthn.ts b/libs/common/src/lib/interfaces/simplewebauthn.interface.ts similarity index 100% rename from apps/api/src/app/auth/interfaces/simplewebauthn.ts rename to libs/common/src/lib/interfaces/simplewebauthn.interface.ts diff --git a/apps/api/src/app/user/interfaces/user-item.interface.ts b/libs/common/src/lib/interfaces/user-item.interface.ts similarity index 100% rename from apps/api/src/app/user/interfaces/user-item.interface.ts rename to libs/common/src/lib/interfaces/user-item.interface.ts diff --git a/libs/common/src/lib/pipes/index.ts b/libs/common/src/lib/pipes/index.ts new file mode 100644 index 000000000..7b5ca4bac --- /dev/null +++ b/libs/common/src/lib/pipes/index.ts @@ -0,0 +1,3 @@ +import { GfSymbolPipe } from './symbol.pipe'; + +export { GfSymbolPipe }; diff --git a/apps/client/src/app/pipes/symbol/symbol.pipe.ts b/libs/common/src/lib/pipes/symbol.pipe.ts similarity index 100% rename from apps/client/src/app/pipes/symbol/symbol.pipe.ts rename to libs/common/src/lib/pipes/symbol.pipe.ts diff --git a/apps/api/src/validators/is-currency-code.ts b/libs/common/src/lib/validators/is-currency-code.ts similarity index 100% rename from apps/api/src/validators/is-currency-code.ts rename to libs/common/src/lib/validators/is-currency-code.ts diff --git a/libs/ui/src/lib/account-balances/account-balances.component.ts b/libs/ui/src/lib/account-balances/account-balances.component.ts index 904e7d46c..679899af9 100644 --- a/libs/ui/src/lib/account-balances/account-balances.component.ts +++ b/libs/ui/src/lib/account-balances/account-balances.component.ts @@ -1,8 +1,8 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { CreateAccountBalanceDto } from '@ghostfolio/api/app/account-balance/create-account-balance.dto'; import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; +import { CreateAccountBalanceDto } from '@ghostfolio/common/dtos'; import { DATE_FORMAT, getLocale } from '@ghostfolio/common/helper'; import { AccountBalancesResponse } from '@ghostfolio/common/interfaces'; diff --git a/libs/ui/src/lib/activities-filter/activities-filter.component.ts b/libs/ui/src/lib/activities-filter/activities-filter.component.ts index 177312490..34f883c67 100644 --- a/libs/ui/src/lib/activities-filter/activities-filter.component.ts +++ b/libs/ui/src/lib/activities-filter/activities-filter.component.ts @@ -1,6 +1,5 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { Filter, FilterGroup } from '@ghostfolio/common/interfaces'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { CommonModule } from '@angular/common'; diff --git a/libs/ui/src/lib/activities-table/activities-table.component.stories.ts b/libs/ui/src/lib/activities-table/activities-table.component.stories.ts index 78e712c89..a0ad690d7 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.stories.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.stories.ts @@ -1,5 +1,5 @@ -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { Activity } from '@ghostfolio/common/interfaces'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { CommonModule } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; diff --git a/libs/ui/src/lib/activities-table/activities-table.component.ts b/libs/ui/src/lib/activities-table/activities-table.component.ts index 99ba2aded..d7b13a7e8 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.ts @@ -1,7 +1,6 @@ /* eslint-disable @nx/enforce-module-boundaries */ import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { DEFAULT_PAGE_SIZE, TAG_ID_EXCLUDE_FROM_ANALYSIS @@ -11,6 +10,7 @@ import { Activity, AssetProfileIdentifier } from '@ghostfolio/common/interfaces'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { OrderWithAccount } from '@ghostfolio/common/types'; import { SelectionModel } from '@angular/cdk/collections'; diff --git a/libs/ui/src/lib/assistant/assistant-list-item/assistant-list-item.component.ts b/libs/ui/src/lib/assistant/assistant-list-item/assistant-list-item.component.ts index 059bbaf9e..c2ad2462e 100644 --- a/libs/ui/src/lib/assistant/assistant-list-item/assistant-list-item.component.ts +++ b/libs/ui/src/lib/assistant/assistant-list-item/assistant-list-item.component.ts @@ -1,5 +1,4 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { internalRoutes } from '@ghostfolio/common/routes/routes'; import { FocusableOption } from '@angular/cdk/a11y'; diff --git a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts index b36a70e69..f857e6e53 100644 --- a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts +++ b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts @@ -1,6 +1,6 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { UpdateMarketDataDto } from '@ghostfolio/api/app/admin/update-market-data.dto'; import { DataService } from '@ghostfolio/client/services/data.service'; +import { UpdateMarketDataDto } from '@ghostfolio/common/dtos'; import { DATE_FORMAT, getDateFormatString, diff --git a/libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.ts b/libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.ts index 274c3f994..afbe5af4e 100644 --- a/libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.ts +++ b/libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.ts @@ -1,7 +1,6 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { getAssetProfileIdentifier } from '@ghostfolio/common/helper'; import { Filter, PortfolioPosition } from '@ghostfolio/common/interfaces'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { AccountWithPlatform } from '@ghostfolio/common/types'; import { diff --git a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts index dcfcaf3f1..05a2c06c3 100644 --- a/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts +++ b/libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts @@ -1,7 +1,7 @@ /* eslint-disable @nx/enforce-module-boundaries */ -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { DataService } from '@ghostfolio/client/services/data.service'; import { LookupItem } from '@ghostfolio/common/interfaces'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { FocusMonitor } from '@angular/cdk/a11y'; import { diff --git a/libs/ui/src/lib/top-holdings/top-holdings.component.ts b/libs/ui/src/lib/top-holdings/top-holdings.component.ts index b67cc1b80..75a96fc5c 100644 --- a/libs/ui/src/lib/top-holdings/top-holdings.component.ts +++ b/libs/ui/src/lib/top-holdings/top-holdings.component.ts @@ -1,10 +1,9 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; import { getLocale } from '@ghostfolio/common/helper'; import { AssetProfileIdentifier, HoldingWithParents } from '@ghostfolio/common/interfaces'; +import { GfSymbolPipe } from '@ghostfolio/common/pipes'; import { animate,