From edcc14042806a7e5c092f55ca717db2eec16e685 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 22 Oct 2025 07:36:40 +0200 Subject: [PATCH 01/14] Task/introduce interface for create Stripe checkout session response (#5791) * Introduce interface --- .../subscription/subscription.controller.ts | 11 ++-- .../app/subscription/subscription.service.ts | 62 ++++++++++--------- .../user-account-membership.component.ts | 7 ++- .../pages/pricing/pricing-page.component.ts | 7 ++- apps/client/src/app/services/data.service.ts | 14 +++-- libs/common/src/lib/interfaces/index.ts | 2 + ...ipe-checkout-session-response.interface.ts | 3 + 7 files changed, 64 insertions(+), 42 deletions(-) create mode 100644 libs/common/src/lib/interfaces/responses/create-stripe-checkout-session-response.interface.ts diff --git a/apps/api/src/app/subscription/subscription.controller.ts b/apps/api/src/app/subscription/subscription.controller.ts index 244a6b806..e1c705fdd 100644 --- a/apps/api/src/app/subscription/subscription.controller.ts +++ b/apps/api/src/app/subscription/subscription.controller.ts @@ -5,7 +5,10 @@ import { DEFAULT_LANGUAGE_CODE, PROPERTY_COUPONS } from '@ghostfolio/common/config'; -import { Coupon } from '@ghostfolio/common/interfaces'; +import { + Coupon, + CreateStripeCheckoutSessionResponse +} from '@ghostfolio/common/interfaces'; import type { RequestWithUser } from '@ghostfolio/common/types'; import { @@ -111,11 +114,11 @@ export class SubscriptionController { @Post('stripe/checkout-session') @UseGuards(AuthGuard('jwt'), HasPermissionGuard) - public async createCheckoutSession( + public createStripeCheckoutSession( @Body() { couponId, priceId }: { couponId?: string; priceId: string } - ) { + ): Promise { try { - return this.subscriptionService.createCheckoutSession({ + return this.subscriptionService.createStripeCheckoutSession({ couponId, priceId, user: this.request.user diff --git a/apps/api/src/app/subscription/subscription.service.ts b/apps/api/src/app/subscription/subscription.service.ts index 9574d17e9..37ab1c0f6 100644 --- a/apps/api/src/app/subscription/subscription.service.ts +++ b/apps/api/src/app/subscription/subscription.service.ts @@ -6,7 +6,10 @@ import { PROPERTY_STRIPE_CONFIG } from '@ghostfolio/common/config'; import { parseDate } from '@ghostfolio/common/helper'; -import { SubscriptionOffer } from '@ghostfolio/common/interfaces'; +import { + CreateStripeCheckoutSessionResponse, + SubscriptionOffer +} from '@ghostfolio/common/interfaces'; import { SubscriptionOfferKey, UserWithSettings @@ -38,7 +41,7 @@ export class SubscriptionService { } } - public async createCheckoutSession({ + public async createStripeCheckoutSession({ couponId, priceId, user @@ -46,7 +49,7 @@ export class SubscriptionService { couponId?: string; priceId: string; user: UserWithSettings; - }) { + }): Promise { const subscriptionOffers: { [offer in SubscriptionOfferKey]: SubscriptionOffer; } = @@ -58,33 +61,34 @@ export class SubscriptionService { } ); - const checkoutSessionCreateParams: Stripe.Checkout.SessionCreateParams = { - cancel_url: `${this.configurationService.get('ROOT_URL')}/${ - user.settings.settings.language - }/account`, - client_reference_id: user.id, - line_items: [ - { - price: priceId, - quantity: 1 - } - ], - locale: - (user.settings?.settings - ?.language as Stripe.Checkout.SessionCreateParams.Locale) ?? - DEFAULT_LANGUAGE_CODE, - metadata: subscriptionOffer - ? { subscriptionOffer: JSON.stringify(subscriptionOffer) } - : {}, - mode: 'payment', - payment_method_types: ['card'], - success_url: `${this.configurationService.get( - 'ROOT_URL' - )}/api/v1/subscription/stripe/callback?checkoutSessionId={CHECKOUT_SESSION_ID}` - }; + const stripeCheckoutSessionCreateParams: Stripe.Checkout.SessionCreateParams = + { + cancel_url: `${this.configurationService.get('ROOT_URL')}/${ + user.settings.settings.language + }/account`, + client_reference_id: user.id, + line_items: [ + { + price: priceId, + quantity: 1 + } + ], + locale: + (user.settings?.settings + ?.language as Stripe.Checkout.SessionCreateParams.Locale) ?? + DEFAULT_LANGUAGE_CODE, + metadata: subscriptionOffer + ? { subscriptionOffer: JSON.stringify(subscriptionOffer) } + : {}, + mode: 'payment', + payment_method_types: ['card'], + success_url: `${this.configurationService.get( + 'ROOT_URL' + )}/api/v1/subscription/stripe/callback?checkoutSessionId={CHECKOUT_SESSION_ID}` + }; if (couponId) { - checkoutSessionCreateParams.discounts = [ + stripeCheckoutSessionCreateParams.discounts = [ { coupon: couponId } @@ -92,7 +96,7 @@ export class SubscriptionService { } const session = await this.stripe.checkout.sessions.create( - checkoutSessionCreateParams + stripeCheckoutSessionCreateParams ); return { diff --git a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts b/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts index f2f63b32b..025ec0f7a 100644 --- a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts +++ b/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts @@ -108,7 +108,10 @@ export class GfUserAccountMembershipComponent implements OnDestroy { public onCheckout() { this.dataService - .createCheckoutSession({ couponId: this.couponId, priceId: this.priceId }) + .createStripeCheckoutSession({ + couponId: this.couponId, + priceId: this.priceId + }) .pipe( catchError((error) => { this.notificationService.alert({ @@ -117,7 +120,7 @@ export class GfUserAccountMembershipComponent implements OnDestroy { throw error; }), - switchMap(({ sessionId }: { sessionId: string }) => { + switchMap(({ sessionId }) => { return this.stripeService.redirectToCheckout({ sessionId }); }) ) 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 8bc3e3a67..82560246f 100644 --- a/apps/client/src/app/pages/pricing/pricing-page.component.ts +++ b/apps/client/src/app/pages/pricing/pricing-page.component.ts @@ -134,9 +134,12 @@ export class GfPricingPageComponent implements OnDestroy, OnInit { public onCheckout() { this.dataService - .createCheckoutSession({ couponId: this.couponId, priceId: this.priceId }) + .createStripeCheckoutSession({ + couponId: this.couponId, + priceId: this.priceId + }) .pipe( - switchMap(({ sessionId }: { sessionId: string }) => { + switchMap(({ sessionId }) => { return this.stripeService.redirectToCheckout({ sessionId }); }), catchError((error) => { diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index 549675f7f..a32bc6d3e 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -31,6 +31,7 @@ import { AssetResponse, BenchmarkMarketDataDetailsResponse, BenchmarkResponse, + CreateStripeCheckoutSessionResponse, DataProviderHealthResponse, ExportResponse, Filter, @@ -168,17 +169,20 @@ export class DataService { return params; } - public createCheckoutSession({ + public createStripeCheckoutSession({ couponId, priceId }: { couponId?: string; priceId: string; }) { - return this.http.post('/api/v1/subscription/stripe/checkout-session', { - couponId, - priceId - }); + return this.http.post( + '/api/v1/subscription/stripe/checkout-session', + { + couponId, + priceId + } + ); } public fetchAccount(aAccountId: string) { diff --git a/libs/common/src/lib/interfaces/index.ts b/libs/common/src/lib/interfaces/index.ts index e3c2c2038..828a65974 100644 --- a/libs/common/src/lib/interfaces/index.ts +++ b/libs/common/src/lib/interfaces/index.ts @@ -43,6 +43,7 @@ import type { ApiKeyResponse } from './responses/api-key-response.interface'; import type { AssetResponse } from './responses/asset-response.interface'; import type { BenchmarkMarketDataDetailsResponse } from './responses/benchmark-market-data-details-response.interface'; import type { BenchmarkResponse } from './responses/benchmark-response.interface'; +import type { CreateStripeCheckoutSessionResponse } from './responses/create-stripe-checkout-session-response.interface'; import type { DataEnhancerHealthResponse } from './responses/data-enhancer-health-response.interface'; import type { DataProviderGhostfolioAssetProfileResponse } from './responses/data-provider-ghostfolio-asset-profile-response.interface'; import type { DataProviderGhostfolioStatusResponse } from './responses/data-provider-ghostfolio-status-response.interface'; @@ -100,6 +101,7 @@ export { BenchmarkProperty, BenchmarkResponse, Coupon, + CreateStripeCheckoutSessionResponse, DataEnhancerHealthResponse, DataProviderGhostfolioAssetProfileResponse, DataProviderGhostfolioStatusResponse, diff --git a/libs/common/src/lib/interfaces/responses/create-stripe-checkout-session-response.interface.ts b/libs/common/src/lib/interfaces/responses/create-stripe-checkout-session-response.interface.ts new file mode 100644 index 000000000..18c9e4400 --- /dev/null +++ b/libs/common/src/lib/interfaces/responses/create-stripe-checkout-session-response.interface.ts @@ -0,0 +1,3 @@ +export interface CreateStripeCheckoutSessionResponse { + sessionId: string; +} From f19d9c78aa8e96a1e3320ed7f751ef5f35c07b0d Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 22 Oct 2025 07:37:15 +0200 Subject: [PATCH 02/14] Task/clean up unused eslint-disable-next-line directives (#5782) * Clean up unused eslint-disable-next-line directives --- .../roai/portfolio-calculator-baln-buy-and-buy.spec.ts | 3 --- ...lio-calculator-baln-buy-and-sell-in-two-activities.spec.ts | 3 --- .../roai/portfolio-calculator-baln-buy-and-sell.spec.ts | 3 --- .../calculator/roai/portfolio-calculator-baln-buy.spec.ts | 3 --- .../calculator/roai/portfolio-calculator-btceur.spec.ts | 3 --- ...portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts | 4 ---- .../calculator/roai/portfolio-calculator-btcusd-short.spec.ts | 3 --- .../calculator/roai/portfolio-calculator-btcusd.spec.ts | 3 --- .../calculator/roai/portfolio-calculator-fee.spec.ts | 3 --- .../calculator/roai/portfolio-calculator-googl-buy.spec.ts | 4 ---- .../calculator/roai/portfolio-calculator-liability.spec.ts | 3 --- .../roai/portfolio-calculator-msft-buy-and-sell.spec.ts | 2 -- .../roai/portfolio-calculator-msft-buy-with-dividend.spec.ts | 3 --- .../calculator/roai/portfolio-calculator-no-orders.spec.ts | 3 --- .../portfolio-calculator-novn-buy-and-sell-partially.spec.ts | 3 --- .../roai/portfolio-calculator-novn-buy-and-sell.spec.ts | 3 --- .../calculator/roai/portfolio-calculator-valuable.spec.ts | 3 --- 17 files changed, 52 deletions(-) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts index 9ffa1b409..aa174f319 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts index ab8000702..69b6c3dfc 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts index cc65fa8a2..a3cb8716e 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts index 7d9544666..ae083a7db 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts index ca9e5b0d5..cef8938c2 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts @@ -23,7 +23,6 @@ import { join } from 'node:path'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -34,7 +33,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -44,7 +42,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts index de3f5d3cd..36e6fa900 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts @@ -21,7 +21,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -32,7 +31,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -42,7 +40,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) @@ -53,7 +50,6 @@ jest.mock( '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention ExchangeRateDataService: jest.fn().mockImplementation(() => { return ExchangeRateDataServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-short.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-short.spec.ts index 3e67389dd..5a4dfdc07 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-short.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-short.spec.ts @@ -23,7 +23,6 @@ import { join } from 'node:path'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -34,7 +33,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -44,7 +42,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts index f08083554..2ee367530 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts @@ -23,7 +23,6 @@ import { join } from 'node:path'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -34,7 +33,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -44,7 +42,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts index aaf2c4302..002be9154 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts index f7d0e9e6d..bf0b15020 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts @@ -21,7 +21,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -32,7 +31,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -42,7 +40,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) @@ -53,7 +50,6 @@ jest.mock( '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention ExchangeRateDataService: jest.fn().mockImplementation(() => { return ExchangeRateDataServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts index 2cb3899e9..32822014c 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts index bb976564a..08015da5b 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts @@ -28,7 +28,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -38,7 +37,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts index 36b6e8be9..e5b128085 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-orders.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-orders.spec.ts index f64328d39..fdd9e4718 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-orders.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-orders.spec.ts @@ -15,7 +15,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -26,7 +25,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -36,7 +34,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts index 4678dbd5e..cf330d136 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts @@ -23,7 +23,6 @@ import { join } from 'node:path'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -34,7 +33,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -44,7 +42,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts index c4ccab7ad..681169062 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts @@ -23,7 +23,6 @@ import { join } from 'node:path'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -34,7 +33,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -44,7 +42,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts index 5e9949dd2..fc1d477a6 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts @@ -20,7 +20,6 @@ import { Big } from 'big.js'; jest.mock('@ghostfolio/api/app/portfolio/current-rate.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention CurrentRateService: jest.fn().mockImplementation(() => { return CurrentRateServiceMock; }) @@ -31,7 +30,6 @@ jest.mock( '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention PortfolioSnapshotService: jest.fn().mockImplementation(() => { return PortfolioSnapshotServiceMock; }) @@ -41,7 +39,6 @@ jest.mock( jest.mock('@ghostfolio/api/app/redis-cache/redis-cache.service', () => { return { - // eslint-disable-next-line @typescript-eslint/naming-convention RedisCacheService: jest.fn().mockImplementation(() => { return RedisCacheServiceMock; }) From 946edd5c5a2278957f75ba16dbf764894132b600 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 22 Oct 2025 07:40:21 +0200 Subject: [PATCH 03/14] Release 2.210.0 (#5814) --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63cbf5898..a5738a998 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 2.210.0 - 2025-10-22 ### Added diff --git a/package-lock.json b/package-lock.json index cc58d01ca..aa32ab721 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.209.0", + "version": "2.210.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.209.0", + "version": "2.210.0", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 403ce7f7b..397002df2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.209.0", + "version": "2.210.0", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio", From 2b727f867fafbcb8dc366f8fd5e342bab36d6b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20=C5=81=C4=85giewka?= Date: Wed, 22 Oct 2025 14:01:36 +0200 Subject: [PATCH 04/14] Bugfix/include missing dotenv packages (#5817) * Include missing dotenv packages --- apps/api/src/dependencies.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 apps/api/src/dependencies.ts diff --git a/apps/api/src/dependencies.ts b/apps/api/src/dependencies.ts new file mode 100644 index 000000000..cd5409fd4 --- /dev/null +++ b/apps/api/src/dependencies.ts @@ -0,0 +1,3 @@ +// Dependencies required by prisma.config.ts in Docker container +import 'dotenv'; +import 'dotenv-expand'; From e096f5cc774496b7a1ca9fabfa124c1a8b36c77e Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 22 Oct 2025 14:03:47 +0200 Subject: [PATCH 05/14] Release 2.210.1 (#5818) --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5738a998..6831e9060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 2.210.0 - 2025-10-22 +## 2.210.1 - 2025-10-22 ### Added diff --git a/package-lock.json b/package-lock.json index aa32ab721..24c0da20b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.210.0", + "version": "2.210.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.210.0", + "version": "2.210.1", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 397002df2..90d8252d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.210.0", + "version": "2.210.1", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio", From 3cb0ca130e0f50c0f026475bf37e68be268c8b32 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:32:45 +0200 Subject: [PATCH 06/14] Task/upgrade prisma to version 6.18.0 (#5823) * Upgrade prisma to version 6.18.0 * Update changelog --- CHANGELOG.md | 8 ++++- package-lock.json | 80 +++++++++++++++++++++++------------------------ package.json | 4 +-- 3 files changed, 49 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6831e9060..285e8917a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Upgraded `prisma` from version `6.17.1` to `6.18.0` + ## 2.210.1 - 2025-10-22 ### Added @@ -67,7 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed the deprecated endpoint `GET api/v1/portfolio/position/:dataSource/:symbol` - Removed the deprecated endpoint `PUT api/v1/portfolio/position/:dataSource/:symbol/tags` - Improved the language localization for German (`de`) -- Upgraded `prisma` from version `6.16.1` to `6.16.3` +- Upgraded `prisma` from version `6.16.1` to `6.17.1` ### Fixed diff --git a/package-lock.json b/package-lock.json index 24c0da20b..7889faa15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "@nestjs/schedule": "6.0.0", "@nestjs/serve-static": "5.0.3", "@openrouter/ai-sdk-provider": "0.7.2", - "@prisma/client": "6.17.1", + "@prisma/client": "6.18.0", "@simplewebauthn/browser": "13.1.0", "@simplewebauthn/server": "13.1.1", "@stripe/stripe-js": "7.9.0", @@ -151,7 +151,7 @@ "nx": "21.5.1", "prettier": "3.6.2", "prettier-plugin-organize-attributes": "1.0.0", - "prisma": "6.17.1", + "prisma": "6.18.0", "react": "18.2.0", "react-dom": "18.2.0", "replace-in-file": "8.3.0", @@ -11983,9 +11983,9 @@ "license": "MIT" }, "node_modules/@prisma/client": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.17.1.tgz", - "integrity": "sha512-zL58jbLzYamjnNnmNA51IOZdbk5ci03KviXCuB0Tydc9btH2kDWsi1pQm2VecviRTM7jGia0OPPkgpGnT3nKvw==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.18.0.tgz", + "integrity": "sha512-jnL2I9gDnPnw4A+4h5SuNn8Gc+1mL1Z79U/3I9eE2gbxJG1oSA+62ByPW4xkeDgwE0fqMzzpAZ7IHxYnLZ4iQA==", "hasInstallScript": true, "license": "Apache-2.0", "engines": { @@ -12005,66 +12005,66 @@ } }, "node_modules/@prisma/config": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.17.1.tgz", - "integrity": "sha512-fs8wY6DsvOCzuiyWVckrVs1LOcbY4LZNz8ki4uUIQ28jCCzojTGqdLhN2Jl5lDnC1yI8/gNIKpsWDM8pLhOdwA==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.18.0.tgz", + "integrity": "sha512-rgFzspCpwsE+q3OF/xkp0fI2SJ3PfNe9LLMmuSVbAZ4nN66WfBiKqJKo/hLz3ysxiPQZf8h1SMf2ilqPMeWATQ==", "devOptional": true, "license": "Apache-2.0", "dependencies": { "c12": "3.1.0", "deepmerge-ts": "7.1.5", - "effect": "3.16.12", + "effect": "3.18.4", "empathic": "2.0.0" } }, "node_modules/@prisma/debug": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.17.1.tgz", - "integrity": "sha512-Vf7Tt5Wh9XcndpbmeotuqOMLWPTjEKCsgojxXP2oxE1/xYe7PtnP76hsouG9vis6fctX+TxgmwxTuYi/+xc7dQ==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.18.0.tgz", + "integrity": "sha512-PMVPMmxPj0ps1VY75DIrT430MoOyQx9hmm174k6cmLZpcI95rAPXOQ+pp8ANQkJtNyLVDxnxVJ0QLbrm/ViBcg==", "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/engines": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.17.1.tgz", - "integrity": "sha512-D95Ik3GYZkqZ8lSR4EyFOJ/tR33FcYRP8kK61o+WMsyD10UfJwd7+YielflHfKwiGodcqKqoraWw8ElAgMDbPw==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.18.0.tgz", + "integrity": "sha512-i5RzjGF/ex6AFgqEe2o1IW8iIxJGYVQJVRau13kHPYEL1Ck8Zvwuzamqed/1iIljs5C7L+Opiz5TzSsUebkriA==", "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.17.1", - "@prisma/engines-version": "6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac", - "@prisma/fetch-engine": "6.17.1", - "@prisma/get-platform": "6.17.1" + "@prisma/debug": "6.18.0", + "@prisma/engines-version": "6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f", + "@prisma/fetch-engine": "6.18.0", + "@prisma/get-platform": "6.18.0" } }, "node_modules/@prisma/engines-version": { - "version": "6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac.tgz", - "integrity": "sha512-17140E3huOuD9lMdJ9+SF/juOf3WR3sTJMVyyenzqUPbuH+89nPhSWcrY+Mf7tmSs6HvaO+7S+HkELinn6bhdg==", + "version": "6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f.tgz", + "integrity": "sha512-T7Af4QsJQnSgWN1zBbX+Cha5t4qjHRxoeoWpK4JugJzG/ipmmDMY5S+O0N1ET6sCBNVkf6lz+Y+ZNO9+wFU8pQ==", "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/fetch-engine": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.17.1.tgz", - "integrity": "sha512-AYZiHOs184qkDMiTeshyJCtyL4yERkjfTkJiSJdYuSfc24m94lTNL5+GFinZ6vVz+ktX4NJzHKn1zIFzGTWrWg==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.18.0.tgz", + "integrity": "sha512-TdaBvTtBwP3IoqVYoGIYpD4mWlk0pJpjTJjir/xLeNWlwog7Sl3bD2J0jJ8+5+q/6RBg+acb9drsv5W6lqae7A==", "devOptional": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.17.1", - "@prisma/engines-version": "6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac", - "@prisma/get-platform": "6.17.1" + "@prisma/debug": "6.18.0", + "@prisma/engines-version": "6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f", + "@prisma/get-platform": "6.18.0" } }, "node_modules/@prisma/get-platform": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.17.1.tgz", - "integrity": "sha512-AKEn6fsfz0r482S5KRDFlIGEaq9wLNcgalD1adL+fPcFFblIKs1sD81kY/utrHdqKuVC6E1XSRpegDK3ZLL4Qg==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.18.0.tgz", + "integrity": "sha512-uXNJCJGhxTCXo2B25Ta91Rk1/Nmlqg9p7G9GKh8TPhxvAyXCvMNQoogj4JLEUy+3ku8g59cpyQIKFhqY2xO2bg==", "devOptional": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.17.1" + "@prisma/debug": "6.18.0" } }, "node_modules/@redis/client": { @@ -21166,9 +21166,9 @@ "license": "MIT" }, "node_modules/effect": { - "version": "3.16.12", - "resolved": "https://registry.npmjs.org/effect/-/effect-3.16.12.tgz", - "integrity": "sha512-N39iBk0K71F9nb442TLbTkjl24FLUzuvx2i1I2RsEAQsdAdUTuUoW0vlfUXgkMTUOnYqKnWcFfqw4hK4Pw27hg==", + "version": "3.18.4", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.18.4.tgz", + "integrity": "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA==", "devOptional": true, "license": "MIT", "dependencies": { @@ -35802,15 +35802,15 @@ } }, "node_modules/prisma": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.17.1.tgz", - "integrity": "sha512-ac6h0sM1Tg3zu8NInY+qhP/S9KhENVaw9n1BrGKQVFu05JT5yT5Qqqmb8tMRIE3ZXvVj4xcRA5yfrsy4X7Yy5g==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.18.0.tgz", + "integrity": "sha512-bXWy3vTk8mnRmT+SLyZBQoC2vtV9Z8u7OHvEu+aULYxwiop/CPiFZ+F56KsNRNf35jw+8wcu8pmLsjxpBxAO9g==", "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@prisma/config": "6.17.1", - "@prisma/engines": "6.17.1" + "@prisma/config": "6.18.0", + "@prisma/engines": "6.18.0" }, "bin": { "prisma": "build/index.js" diff --git a/package.json b/package.json index 90d8252d1..7cedd68bf 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "@nestjs/schedule": "6.0.0", "@nestjs/serve-static": "5.0.3", "@openrouter/ai-sdk-provider": "0.7.2", - "@prisma/client": "6.17.1", + "@prisma/client": "6.18.0", "@simplewebauthn/browser": "13.1.0", "@simplewebauthn/server": "13.1.1", "@stripe/stripe-js": "7.9.0", @@ -197,7 +197,7 @@ "nx": "21.5.1", "prettier": "3.6.2", "prettier-plugin-organize-attributes": "1.0.0", - "prisma": "6.17.1", + "prisma": "6.18.0", "react": "18.2.0", "react-dom": "18.2.0", "replace-in-file": "8.3.0", From 37ab31ea722624f0e55c3df417424f3dc9981054 Mon Sep 17 00:00:00 2001 From: danielochinasa Date: Thu, 23 Oct 2025 16:58:14 +0100 Subject: [PATCH 07/14] Task/format value in Buying Power rule (#5824) * Format value in Buying Power rule * Update changelog --- CHANGELOG.md | 1 + apps/api/src/models/rules/liquidity/buying-power.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 285e8917a..70dc9ae17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Localized the number formatting in the static portfolio analysis rule: _Liquidity_ (Buying Power) - Upgraded `prisma` from version `6.17.1` to `6.18.0` ## 2.210.1 - 2025-10-22 diff --git a/apps/api/src/models/rules/liquidity/buying-power.ts b/apps/api/src/models/rules/liquidity/buying-power.ts index 70393278d..2cd4d6fee 100644 --- a/apps/api/src/models/rules/liquidity/buying-power.ts +++ b/apps/api/src/models/rules/liquidity/buying-power.ts @@ -40,7 +40,9 @@ export class BuyingPower extends Rule { languageCode: this.getLanguageCode(), placeholders: { baseCurrency: ruleSettings.baseCurrency, - thresholdMin: ruleSettings.thresholdMin + thresholdMin: ruleSettings.thresholdMin.toLocaleString( + ruleSettings.locale + ) } }), value: false @@ -53,7 +55,9 @@ export class BuyingPower extends Rule { languageCode: this.getLanguageCode(), placeholders: { baseCurrency: ruleSettings.baseCurrency, - thresholdMin: ruleSettings.thresholdMin + thresholdMin: ruleSettings.thresholdMin.toLocaleString( + ruleSettings.locale + ) } }), value: true From 852ed98d0fbd5e13541dd75e5afbf155f8d893ad Mon Sep 17 00:00:00 2001 From: Harsh Santwani <96873014+HydrallHarsh@users.noreply.github.com> Date: Thu, 23 Oct 2025 23:32:59 +0530 Subject: [PATCH 08/14] Task/move prisma.config.ts to .config/prisma.ts (#5821) * Move prisma.config.ts to .config/prisma.ts * Update changelog --- .config/prisma.ts | 14 ++++++++++++++ CHANGELOG.md | 1 + Dockerfile | 4 ++-- apps/api/src/dependencies.ts | 2 +- prisma.config.ts | 14 -------------- 5 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 .config/prisma.ts delete mode 100644 prisma.config.ts diff --git a/.config/prisma.ts b/.config/prisma.ts new file mode 100644 index 000000000..64691136c --- /dev/null +++ b/.config/prisma.ts @@ -0,0 +1,14 @@ +import { defineConfig } from '@prisma/config'; +import { config } from 'dotenv'; +import { expand } from 'dotenv-expand'; +import { join } from 'node:path'; + +expand(config({ quiet: true })); + +export default defineConfig({ + migrations: { + path: join(__dirname, '..', 'prisma', 'migrations'), + seed: `node ${join(__dirname, '..', 'prisma', 'seed.mts')}` + }, + schema: join(__dirname, '..', 'prisma', 'schema.prisma') +}); diff --git a/CHANGELOG.md b/CHANGELOG.md index 70dc9ae17..d46c1d3c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Localized the number formatting in the static portfolio analysis rule: _Liquidity_ (Buying Power) +- Moved the _Prisma Configuration File_ from `prisma.config.ts` to `.config/prisma.ts` - Upgraded `prisma` from version `6.17.1` to `6.18.0` ## 2.210.1 - 2025-10-22 diff --git a/Dockerfile b/Dockerfile index be1bb53ea..5beaf6e03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,11 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-suggests \ # Only add basic files without the application itself to avoid rebuilding # layers when files (package.json etc.) have not changed +COPY ./.config .config/ COPY ./CHANGELOG.md CHANGELOG.md COPY ./LICENSE LICENSE COPY ./package.json package.json COPY ./package-lock.json package-lock.json -COPY ./prisma.config.ts prisma.config.ts COPY ./prisma/schema.prisma prisma/ RUN npm install @@ -44,7 +44,7 @@ WORKDIR /ghostfolio/dist/apps/api COPY ./package-lock.json /ghostfolio/dist/apps/api/ RUN npm install -COPY prisma.config.ts /ghostfolio/dist/apps/api/ +COPY .config /ghostfolio/dist/apps/api/.config/ COPY prisma /ghostfolio/dist/apps/api/prisma/ # Overwrite the generated package.json with the original one to ensure having diff --git a/apps/api/src/dependencies.ts b/apps/api/src/dependencies.ts index cd5409fd4..acb7af382 100644 --- a/apps/api/src/dependencies.ts +++ b/apps/api/src/dependencies.ts @@ -1,3 +1,3 @@ -// Dependencies required by prisma.config.ts in Docker container +// Dependencies required by .config/prisma.ts in Docker container import 'dotenv'; import 'dotenv-expand'; diff --git a/prisma.config.ts b/prisma.config.ts deleted file mode 100644 index 60597cbf1..000000000 --- a/prisma.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { config } from 'dotenv'; -import { expand } from 'dotenv-expand'; -import { join } from 'node:path'; -import { defineConfig } from 'prisma/config'; - -expand(config({ quiet: true })); - -export default defineConfig({ - migrations: { - path: join('prisma', 'migrations'), - seed: `node ${join('prisma', 'seed.mts')}` - }, - schema: join('prisma', 'schema.prisma') -}); From 0b28da879b234bc8bb4c360857fc340e67e9339b Mon Sep 17 00:00:00 2001 From: Vansh <140736931+Vansh-Parate@users.noreply.github.com> Date: Thu, 23 Oct 2025 23:49:59 +0530 Subject: [PATCH 09/14] Task/extend export response by performanceCalculationType (#5816) * Extend export response by performanceCalculationType * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/app/export/export.controller.ts | 4 ++-- apps/api/src/app/export/export.service.ts | 19 +++++++++++++------ .../responses/export-response.interface.ts | 8 +++++++- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d46c1d3c1..c249cd7d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Extended the export functionality by the user account’s performance calculation type + ### Changed - Localized the number formatting in the static portfolio analysis rule: _Liquidity_ (Buying Power) diff --git a/apps/api/src/app/export/export.controller.ts b/apps/api/src/app/export/export.controller.ts index 0b4a2c6e0..5446f8789 100644 --- a/apps/api/src/app/export/export.controller.ts +++ b/apps/api/src/app/export/export.controller.ts @@ -48,8 +48,8 @@ export class ExportController { return this.exportService.export({ activityIds, filters, - userCurrency: this.request.user.settings.settings.baseCurrency, - userId: this.request.user.id + userId: this.request.user.id, + userSettings: this.request.user.settings.settings }); } } diff --git a/apps/api/src/app/export/export.service.ts b/apps/api/src/app/export/export.service.ts index 2001fd3e2..d07b199be 100644 --- a/apps/api/src/app/export/export.service.ts +++ b/apps/api/src/app/export/export.service.ts @@ -3,7 +3,11 @@ import { OrderService } from '@ghostfolio/api/app/order/order.service'; import { environment } from '@ghostfolio/api/environments/environment'; import { MarketDataService } from '@ghostfolio/api/services/market-data/market-data.service'; import { TagService } from '@ghostfolio/api/services/tag/tag.service'; -import { ExportResponse, Filter } from '@ghostfolio/common/interfaces'; +import { + ExportResponse, + Filter, + UserSettings +} from '@ghostfolio/common/interfaces'; import { Injectable } from '@nestjs/common'; import { Platform, Prisma } from '@prisma/client'; @@ -21,13 +25,13 @@ export class ExportService { public async export({ activityIds, filters, - userCurrency, - userId + userId, + userSettings }: { activityIds?: string[]; filters?: Filter[]; - userCurrency: string; userId: string; + userSettings: UserSettings; }): Promise { const { ACCOUNT: filtersByAccount } = groupBy(filters, ({ type }) => { return type; @@ -36,11 +40,11 @@ export class ExportService { let { activities } = await this.orderService.getOrders({ filters, - userCurrency, userId, includeDrafts: true, sortColumn: 'date', sortDirection: 'asc', + userCurrency: userSettings?.baseCurrency, withExcludedAccountsAndActivities: true }); @@ -244,7 +248,10 @@ export class ExportService { } ), user: { - settings: { currency: userCurrency } + settings: { + currency: userSettings?.baseCurrency, + performanceCalculationType: userSettings?.performanceCalculationType + } } }; } diff --git a/libs/common/src/lib/interfaces/responses/export-response.interface.ts b/libs/common/src/lib/interfaces/responses/export-response.interface.ts index a5416e886..8b1697ca4 100644 --- a/libs/common/src/lib/interfaces/responses/export-response.interface.ts +++ b/libs/common/src/lib/interfaces/responses/export-response.interface.ts @@ -9,6 +9,7 @@ import { import { AccountBalance } from '../account-balance.interface'; import { MarketData } from '../market-data.interface'; +import { UserSettings } from '../user-settings.interface'; export interface ExportResponse { accounts: (Omit & { @@ -36,5 +37,10 @@ export interface ExportResponse { }; platforms: Platform[]; tags: Omit[]; - user: { settings: { currency: string } }; + user: { + settings: { + currency: UserSettings['baseCurrency']; + performanceCalculationType: UserSettings['performanceCalculationType']; + }; + }; } From a872770b7c6de31acc9fadefd988c035a76ebaf2 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 24 Oct 2025 18:54:17 +0200 Subject: [PATCH 10/14] Bugfix/footer row style of accounts table component (#5826) * Fix style of footer row * Update changelog --- CHANGELOG.md | 4 ++++ .../ui/src/lib/accounts-table/accounts-table.component.html | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c249cd7d1..0418331ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Moved the _Prisma Configuration File_ from `prisma.config.ts` to `.config/prisma.ts` - Upgraded `prisma` from version `6.17.1` to `6.18.0` +### Fixed + +- Fixed the style in the footer row of the accounts table + ## 2.210.1 - 2025-10-22 ### Added diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.html b/libs/ui/src/lib/accounts-table/accounts-table.component.html index 609c76ee1..e9e0337c9 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.html +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.html @@ -320,11 +320,7 @@ - + From 1f6b061ab006fbf4ee74aa84cac1a6257093afb8 Mon Sep 17 00:00:00 2001 From: David Requeno <108202767+DavidReque@users.noreply.github.com> Date: Fri, 24 Oct 2025 11:13:34 -0600 Subject: [PATCH 11/14] Task/migrate tablemark to v4 (#5809) * Migrate tablemark to v4 * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/endpoints/ai/ai.service.ts | 9 +- package-lock.json | 171 ++++++++++++++------ package.json | 2 +- 4 files changed, 132 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0418331ea..09d836e9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Localized the number formatting in the static portfolio analysis rule: _Liquidity_ (Buying Power) - Moved the _Prisma Configuration File_ from `prisma.config.ts` to `.config/prisma.ts` - Upgraded `prisma` from version `6.17.1` to `6.18.0` +- Upgraded `tablemark` from version `3.1.0` to `4.1.0` ### Fixed diff --git a/apps/api/src/app/endpoints/ai/ai.service.ts b/apps/api/src/app/endpoints/ai/ai.service.ts index d1e1b413f..4cc4fde65 100644 --- a/apps/api/src/app/endpoints/ai/ai.service.ts +++ b/apps/api/src/app/endpoints/ai/ai.service.ts @@ -10,7 +10,7 @@ import type { AiPromptMode } from '@ghostfolio/common/types'; import { Injectable } from '@nestjs/common'; import { createOpenRouter } from '@openrouter/ai-sdk-provider'; import { generateText } from 'ai'; -import tablemark, { ColumnDescriptor } from 'tablemark'; +import type { ColumnDescriptor } from 'tablemark'; @Injectable() export class AiService { @@ -92,6 +92,13 @@ export class AiService { } ); + // Dynamic import to load ESM module from CommonJS context + // eslint-disable-next-line @typescript-eslint/no-implied-eval + const dynamicImport = new Function('s', 'return import(s)') as ( + s: string + ) => Promise; + const { tablemark } = await dynamicImport('tablemark'); + const holdingsTableString = tablemark(holdingsTableRows, { columns: holdingsTableColumns }); diff --git a/package-lock.json b/package-lock.json index 7889faa15..d46062433 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,7 +92,7 @@ "rxjs": "7.8.1", "stripe": "18.5.0", "svgmap": "2.12.2", - "tablemark": "3.1.0", + "tablemark": "4.1.0", "twitter-api-v2": "1.23.0", "uuid": "11.1.0", "yahoo-finance2": "3.10.0", @@ -17595,6 +17595,12 @@ "node": ">=8" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "license": "MIT" + }, "node_modules/char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -23695,15 +23701,6 @@ "node": ">= 0.4" } }, - "node_modules/get-stdin": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", - "integrity": "sha512-jZV7n6jGE3Gt7fgSTJoz91Ak5MuTLwMwkoYdjxuJ/AmjIsE1UC03y/IWkZCQGEvVNS9qoRNwy5BCqxImv0FVeA==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -32021,6 +32018,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.0.3" @@ -32924,6 +32922,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, "license": "MIT", "dependencies": { "lower-case": "^2.0.2", @@ -37691,17 +37690,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, - "node_modules/sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "license": "MIT", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -38351,19 +38339,6 @@ "wbuf": "^1.7.3" } }, - "node_modules/split-text-to-chunks": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/split-text-to-chunks/-/split-text-to-chunks-1.0.0.tgz", - "integrity": "sha512-HLtEwXK/T4l7QZSJ/kOSsZC0o5e2Xg3GzKKFxm0ZexJXw0Bo4CaEl39l7MCSRHk9EOOL5jT8JIDjmhTtcoe6lQ==", - "license": "MIT", - "dependencies": { - "get-stdin": "^5.0.1", - "minimist": "^1.2.0" - }, - "bin": { - "wordwrap": "cli.js" - } - }, "node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", @@ -39133,16 +39108,114 @@ } }, "node_modules/tablemark": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/tablemark/-/tablemark-3.1.0.tgz", - "integrity": "sha512-IwO6f0SEzp1Z+zqz/7ANUmeEac4gaNlknWyj/S9aSg11wZmWYnLeyI/xXvEOU88BYUIf8y30y0wxB58xIKrVlQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/tablemark/-/tablemark-4.1.0.tgz", + "integrity": "sha512-B3LDjbDo+ac+D5RwkBOPZZ6ua8716KdT+6NO3DKOCHJq0ezE6vV2r92rjrC1ci2H+ocuysl5ytf1T0QqV65yoA==", "license": "MIT", "dependencies": { - "sentence-case": "^3.0.4", - "split-text-to-chunks": "^1.0.0" + "ansi-regex": "^6.2.2", + "change-case": "^5.4.4", + "string-width": "^8.1.0", + "wordwrapjs": "^5.1.0", + "wrap-ansi": "^9.0.2" }, "engines": { - "node": ">=14.16" + "node": ">=20" + } + }, + "node_modules/tablemark/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/tablemark/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/tablemark/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT" + }, + "node_modules/tablemark/node_modules/string-width": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz", + "integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==", + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tablemark/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/tablemark/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/tablemark/node_modules/wrap-ansi/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/tapable": { @@ -40624,15 +40697,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.3" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -42036,6 +42100,15 @@ "node": ">=0.10.0" } }, + "node_modules/wordwrapjs": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.1.tgz", + "integrity": "sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==", + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", diff --git a/package.json b/package.json index 7cedd68bf..dd31075cc 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "rxjs": "7.8.1", "stripe": "18.5.0", "svgmap": "2.12.2", - "tablemark": "3.1.0", + "tablemark": "4.1.0", "twitter-api-v2": "1.23.0", "uuid": "11.1.0", "yahoo-finance2": "3.10.0", From 0ec9c1dd934f34b2153aef536e492b1024537565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20G=C3=BCnther?= Date: Fri, 24 Oct 2025 19:51:14 +0200 Subject: [PATCH 12/14] Bugfix/custom asset name rendering in import activities dialog (#5787) * Fix custom asset name rendering in import activities dialog * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/import/import.service.ts | 12 +++++++++++- apps/api/src/app/order/create-order.dto.ts | 3 ++- apps/api/src/app/order/order.service.ts | 4 ++-- .../src/app/services/import-activities.service.ts | 6 +----- .../activities-table/activities-table.component.html | 5 ++++- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d836e9a..f1abea2e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed the style in the footer row of the accounts table +- Fixed the rendering of names and symbols for custom assets in the import activities dialog ## 2.210.1 - 2025-10-22 diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 2725747aa..2ec28365e 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -539,6 +539,7 @@ export class ImportService { connectOrCreate: { create: { dataSource, + name, symbol, currency: assetProfile.currency, userId: dataSource === 'MANUAL' ? user.id : undefined @@ -746,10 +747,19 @@ export class ImportService { if (['FEE', 'INTEREST', 'LIABILITY'].includes(type)) { // Skip asset profile validation for FEE, INTEREST, and LIABILITY // as these activity types don't require asset profiles + const assetProfileInImport = assetProfilesWithMarketDataDto?.find( + (profile) => { + return ( + profile.dataSource === dataSource && profile.symbol === symbol + ); + } + ); + assetProfiles[getAssetProfileIdentifier({ dataSource, symbol })] = { currency, dataSource, - symbol + symbol, + name: assetProfileInImport?.name }; continue; diff --git a/apps/api/src/app/order/create-order.dto.ts b/apps/api/src/app/order/create-order.dto.ts index ba7a1d868..fb4ac32dd 100644 --- a/apps/api/src/app/order/create-order.dto.ts +++ b/apps/api/src/app/order/create-order.dto.ts @@ -44,7 +44,8 @@ export class CreateOrderDto { customCurrency?: string; @IsEnum(DataSource) - dataSource: DataSource; + @IsOptional() // Optional for type FEE, INTEREST, and LIABILITY (default data source is resolved in the backend) + dataSource?: DataSource; @IsISO8601() @Validate(IsAfter1970Constraint) diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index 11579bbf1..2b5d14150 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -129,7 +129,7 @@ export class OrderService { const assetSubClass = data.assetSubClass; const dataSource: DataSource = 'MANUAL'; - let name: string; + let name = data.SymbolProfile.connectOrCreate.create.name; let symbol: string; if ( @@ -142,7 +142,7 @@ export class OrderService { symbol = data.SymbolProfile.connectOrCreate.create.symbol; } else { // Create custom asset profile - name = data.SymbolProfile.connectOrCreate.create.symbol; + name = name ?? data.SymbolProfile.connectOrCreate.create.symbol; symbol = uuidv4(); } diff --git a/apps/client/src/app/services/import-activities.service.ts b/apps/client/src/app/services/import-activities.service.ts index 323f07a5b..0f2715e47 100644 --- a/apps/client/src/app/services/import-activities.service.ts +++ b/apps/client/src/app/services/import-activities.service.ts @@ -76,12 +76,8 @@ export class ImportActivitiesService { updateAccountBalance: false }); - if ( - dataSource === DataSource.MANUAL && - !['FEE', 'INTEREST', 'LIABILITY'].includes(type) - ) { + if (dataSource === DataSource.MANUAL) { // Create synthetic asset profile for MANUAL data source - // (except for FEE, INTEREST, and LIABILITY which don't require asset profiles) assetProfiles.push({ currency, symbol, diff --git a/libs/ui/src/lib/activities-table/activities-table.component.html b/libs/ui/src/lib/activities-table/activities-table.component.html index 8079a6258..843832e1a 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.html +++ b/libs/ui/src/lib/activities-table/activities-table.component.html @@ -143,7 +143,10 @@ } - @if (!isUUID(element.SymbolProfile?.symbol)) { + @if ( + element.SymbolProfile?.dataSource !== 'MANUAL' && + !isUUID(element.SymbolProfile?.symbol) + ) {
{{ element.SymbolProfile?.symbol | gfSymbol From 4ca65b88f9f92075de84a8896ed27af2607599ab Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 24 Oct 2025 19:55:01 +0200 Subject: [PATCH 13/14] Release 2.211.0-beta.0 (#5829) --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1abea2e3..8dff9d6c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 2.211.0-beta.0 - 2025-10-24 ### Added diff --git a/package-lock.json b/package-lock.json index d46062433..de1be8c3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.210.1", + "version": "2.211.0-beta.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.210.1", + "version": "2.211.0-beta.0", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index dd31075cc..6abe23cf4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.210.1", + "version": "2.211.0-beta.0", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio", From 482b97ba9b8e83f16f3e8acc76c693d4f39cfa7f Mon Sep 17 00:00:00 2001 From: Harsh Santwani <96873014+HydrallHarsh@users.noreply.github.com> Date: Sat, 25 Oct 2025 00:28:44 +0530 Subject: [PATCH 14/14] Feature/set up user detail dialog in admin control panel (#5819) * Set up user detail dialog * Update changelog --- CHANGELOG.md | 1 + .../admin-users/admin-users.component.ts | 70 +++++++++++++++++-- .../components/admin-users/admin-users.html | 12 +++- .../interfaces/interfaces.ts | 7 ++ .../user-detail-dialog.component.scss | 7 ++ .../user-detail-dialog.component.ts | 52 ++++++++++++++ .../user-detail-dialog.html | 32 +++++++++ 7 files changed, 176 insertions(+), 5 deletions(-) create mode 100644 apps/client/src/app/components/user-detail-dialog/interfaces/interfaces.ts create mode 100644 apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.scss create mode 100644 apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts create mode 100644 apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dff9d6c3..d48751572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Extended the export functionality by the user account’s performance calculation type +- Added a user detail dialog to the users section of the admin control panel ### Changed diff --git a/apps/client/src/app/components/admin-users/admin-users.component.ts b/apps/client/src/app/components/admin-users/admin-users.component.ts index 84b82d111..fce97877b 100644 --- a/apps/client/src/app/components/admin-users/admin-users.component.ts +++ b/apps/client/src/app/components/admin-users/admin-users.component.ts @@ -19,6 +19,7 @@ import { ViewChild } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; +import { MatDialog } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatPaginator, @@ -26,6 +27,7 @@ import { PageEvent } from '@angular/material/paginator'; import { MatTableDataSource, MatTableModule } from '@angular/material/table'; +import { ActivatedRoute, Router } from '@angular/router'; import { IonIcon } from '@ionic/angular/standalone'; import { differenceInSeconds, @@ -37,8 +39,10 @@ import { contractOutline, ellipsisHorizontal, keyOutline, + personOutline, trashOutline } from 'ionicons/icons'; +import { DeviceDetectorService } from 'ngx-device-detector'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; @@ -49,6 +53,8 @@ import { AdminService } from '../../services/admin.service'; import { DataService } from '../../services/data.service'; import { ImpersonationStorageService } from '../../services/impersonation-storage.service'; import { UserService } from '../../services/user/user.service'; +import { UserDetailDialogParams } from '../user-detail-dialog/interfaces/interfaces'; +import { GfUserDetailDialogComponent } from '../user-detail-dialog/user-detail-dialog.component'; @Component({ imports: [ @@ -71,6 +77,7 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { public dataSource = new MatTableDataSource(); public defaultDateFormat: string; + public deviceType: string; public displayedColumns: string[] = []; public getEmojiFlag = getEmojiFlag; public hasPermissionForSubscription: boolean; @@ -87,11 +94,16 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { private adminService: AdminService, private changeDetectorRef: ChangeDetectorRef, private dataService: DataService, + private deviceService: DeviceDetectorService, + private dialog: MatDialog, private impersonationStorageService: ImpersonationStorageService, private notificationService: NotificationService, + private route: ActivatedRoute, + private router: Router, private tokenStorageService: TokenStorageService, private userService: UserService ) { + this.deviceType = this.deviceService.getDeviceInfo().deviceType; this.info = this.dataService.fetchInfo(); this.hasPermissionForSubscription = hasPermission( @@ -121,6 +133,14 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { ]; } + this.route.queryParams + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe((params) => { + if (params['userDetailDialog'] && params['userId']) { + this.openUserDetailDialog(params['userId']); + } + }); + this.userService.stateChanged .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((state) => { @@ -138,7 +158,13 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { } }); - addIcons({ contractOutline, ellipsisHorizontal, keyOutline, trashOutline }); + addIcons({ + contractOutline, + ellipsisHorizontal, + keyOutline, + personOutline, + trashOutline + }); } public ngOnInit() { @@ -161,6 +187,12 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { return ''; } + public onChangePage(page: PageEvent) { + this.fetchUsers({ + pageIndex: page.pageIndex + }); + } + public onDeleteUser(aId: string) { this.notificationService.confirm({ confirmFn: () => { @@ -212,9 +244,9 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { window.location.reload(); } - public onChangePage(page: PageEvent) { - this.fetchUsers({ - pageIndex: page.pageIndex + public onOpenUserDetailDialog(userId: string) { + this.router.navigate([], { + queryParams: { userId, userDetailDialog: true } }); } @@ -245,4 +277,34 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { this.changeDetectorRef.markForCheck(); }); } + + private openUserDetailDialog(userId: string) { + const userData = this.dataSource.data.find(({ id }) => { + return id === userId; + }); + + if (!userData) { + this.router.navigate(['.'], { relativeTo: this.route }); + return; + } + + const dialogRef = this.dialog.open(GfUserDetailDialogComponent, { + autoFocus: false, + data: { + userData, + deviceType: this.deviceType, + locale: this.user?.settings?.locale + } as UserDetailDialogParams, + height: this.deviceType === 'mobile' ? '98vh' : '60vh', + width: this.deviceType === 'mobile' ? '100vw' : '50rem' + }); + + dialogRef + .afterClosed() + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe(() => { + this.fetchUsers(); + this.router.navigate(['.'], { relativeTo: this.route }); + }); + } } diff --git a/apps/client/src/app/components/admin-users/admin-users.html b/apps/client/src/app/components/admin-users/admin-users.html index 4e58abf08..e802e3272 100644 --- a/apps/client/src/app/components/admin-users/admin-users.html +++ b/apps/client/src/app/components/admin-users/admin-users.html @@ -216,6 +216,15 @@ + @if (hasPermissionToImpersonateAllUsers) {
diff --git a/apps/client/src/app/components/user-detail-dialog/interfaces/interfaces.ts b/apps/client/src/app/components/user-detail-dialog/interfaces/interfaces.ts new file mode 100644 index 000000000..81cf84d12 --- /dev/null +++ b/apps/client/src/app/components/user-detail-dialog/interfaces/interfaces.ts @@ -0,0 +1,7 @@ +import { AdminUsers } from '@ghostfolio/common/interfaces'; + +export interface UserDetailDialogParams { + deviceType: string; + locale: string; + userData: AdminUsers['users'][0]; +} diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.scss b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.scss new file mode 100644 index 000000000..b63df0134 --- /dev/null +++ b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.scss @@ -0,0 +1,7 @@ +:host { + display: block; + + .mat-mdc-dialog-content { + max-height: unset; + } +} diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts new file mode 100644 index 000000000..bd336c4f8 --- /dev/null +++ b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts @@ -0,0 +1,52 @@ +import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; +import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; +import { GfValueComponent } from '@ghostfolio/ui/value'; + +import { CommonModule } from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + CUSTOM_ELEMENTS_SCHEMA, + Inject, + OnDestroy +} from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatDialogModule } from '@angular/material/dialog'; +import { Subject } from 'rxjs'; + +import { UserDetailDialogParams } from './interfaces/interfaces'; + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + host: { class: 'd-flex flex-column h-100' }, + imports: [ + CommonModule, + GfDialogFooterComponent, + GfDialogHeaderComponent, + GfValueComponent, + MatButtonModule, + MatDialogModule + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + selector: 'gf-user-detail-dialog', + styleUrls: ['./user-detail-dialog.component.scss'], + templateUrl: './user-detail-dialog.html' +}) +export class GfUserDetailDialogComponent implements OnDestroy { + private unsubscribeSubject = new Subject(); + + public constructor( + @Inject(MAT_DIALOG_DATA) public data: UserDetailDialogParams, + public dialogRef: MatDialogRef + ) {} + + public onClose() { + this.dialogRef.close(); + } + + public ngOnDestroy() { + this.unsubscribeSubject.next(); + this.unsubscribeSubject.complete(); + } +} diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html new file mode 100644 index 000000000..d90a6abf6 --- /dev/null +++ b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.html @@ -0,0 +1,32 @@ + + +
+
+
+
+ User ID +
+
+ Registration Date +
+
+
+
+ +