diff --git a/apps/api/src/app/endpoints/users/user-targets-settings.spec.ts b/apps/api/src/app/endpoints/users/user-targets-settings.spec.ts new file mode 100644 index 0000000000..eccef49e00 --- /dev/null +++ b/apps/api/src/app/endpoints/users/user-targets-settings.spec.ts @@ -0,0 +1,133 @@ +import { UserSettings } from '@ghostfolio/common/interfaces'; +import { permissions } from '@ghostfolio/common/permissions'; +import { createDefaultPortfolioTarget } from '@ghostfolio/common/portfolio-targets/portfolio-targets-presets'; +import { + ImpersonationContext, + RequestWithUser +} from '@ghostfolio/common/types'; + +import { UserController } from './user.controller'; + +jest.mock( + '@ghostfolio/api/services/configuration/configuration.service', + () => ({ ConfigurationService: class {} }) +); +jest.mock('@ghostfolio/api/services/property/property.service', () => ({ + PropertyService: class {} +})); +jest.mock('@ghostfolio/api/services/user/user.service', () => ({ + UserService: class {} +})); + +const context = { isActive: false } as ImpersonationContext; + +describe('User controller target settings replacement and authorization', () => { + function setup(allowed = true) { + const oldProfile = { + ...createDefaultPortfolioTarget(), + presetId: 'old-preset' + }; + const previous = { + locale: 'it-IT', + isExperimentalFeatures: true, + portfolioTargets: { + version: 1 as const, + activeProfileId: 'global', + profiles: [oldProfile, { ...oldProfile, id: 'stale' }] + } + }; + const request = { + user: { + id: 'owner', + role: 'USER', + permissions: allowed ? [permissions.updateUserSettings] : [], + settings: { settings: previous } + } + } as unknown as RequestWithUser; + const updateUserSetting = jest.fn(({ userSettings }) => + Promise.resolve(userSettings) + ); + const controller = new UserController( + undefined, + undefined, + undefined, + request, + { updateUserSetting } as never + ); + return { controller, previous, updateUserSetting }; + } + + it('replaces profiles and removed preset metadata while preserving unrelated settings', async () => { + const { controller, previous, updateUserSetting } = setup(); + const profile = createDefaultPortfolioTarget(); + delete profile.presetId; + profile.name = 'Custom'; + const portfolioTargets = { + version: 1 as const, + activeProfileId: 'global', + profiles: [profile] + }; + const saved = (await controller.updateUserSetting( + { portfolioTargets }, + context + )) as UserSettings; + expect(saved).toEqual({ + locale: 'it-IT', + isExperimentalFeatures: true, + portfolioTargets + }); + expect(saved.portfolioTargets.profiles).toHaveLength(1); + expect(saved.portfolioTargets.profiles[0]).not.toHaveProperty('presetId'); + expect(previous.portfolioTargets.profiles).toHaveLength(2); + expect(updateUserSetting).toHaveBeenCalledWith( + expect.objectContaining({ + userId: 'owner', + emitPortfolioChangedEvent: false + }) + ); + }); + + it('preserves targets on unrelated updates', async () => { + const { controller, previous } = setup(); + const saved = (await controller.updateUserSetting( + { locale: 'en-US' }, + context + )) as UserSettings; + expect(saved.portfolioTargets).toEqual(previous.portfolioTargets); + expect(saved.locale).toBe('en-US'); + }); + + it('rejects users without settings permission', async () => { + const { controller, updateUserSetting } = setup(false); + await expect( + controller.updateUserSetting( + { + portfolioTargets: { + version: 1, + activeProfileId: 'global', + profiles: [createDefaultPortfolioTarget()] + } + }, + context + ) + ).rejects.toMatchObject({ status: 403 }); + expect(updateUserSetting).not.toHaveBeenCalled(); + }); + + it('rejects target writes during impersonation', async () => { + const { controller, updateUserSetting } = setup(); + await expect( + controller.updateUserSetting( + { + portfolioTargets: { + version: 1, + activeProfileId: 'global', + profiles: [createDefaultPortfolioTarget()] + } + }, + { isActive: true } as ImpersonationContext + ) + ).rejects.toMatchObject({ status: 403 }); + expect(updateUserSetting).not.toHaveBeenCalled(); + }); +}); diff --git a/apps/api/src/app/endpoints/users/user.controller.ts b/apps/api/src/app/endpoints/users/user.controller.ts index 326e38bb41..5613251f57 100644 --- a/apps/api/src/app/endpoints/users/user.controller.ts +++ b/apps/api/src/app/endpoints/users/user.controller.ts @@ -227,6 +227,12 @@ export class UserController { data ); + // Targets are a versioned document: arrays and optional preset metadata + // must be replaced rather than merged with the previous profile. + if (data.portfolioTargets !== undefined) { + userSettings.portfolioTargets = data.portfolioTargets; + } + if (userSettings['filters.dataSource']) { userSettings['filters.dataSource'] = decodeDataSource( userSettings['filters.dataSource'] diff --git a/apps/api/src/app/portfolio/portfolio-targets-details.spec.ts b/apps/api/src/app/portfolio/portfolio-targets-details.spec.ts new file mode 100644 index 0000000000..e1f61a7aa9 --- /dev/null +++ b/apps/api/src/app/portfolio/portfolio-targets-details.spec.ts @@ -0,0 +1,216 @@ +import { RedactValuesInResponseInterceptor } from '@ghostfolio/api/interceptors/redact-values-in-response/redact-values-in-response.interceptor'; +import { SubscriptionType } from '@ghostfolio/common/enums'; +import { PortfolioDetails } from '@ghostfolio/common/interfaces'; +import { scopes } from '@ghostfolio/common/scopes'; +import { + ImpersonationContext, + RequestWithUser +} from '@ghostfolio/common/types'; + +import { lastValueFrom, of } from 'rxjs'; + +import { GetDetailsDto } from './get-details.dto'; +import { PortfolioController } from './portfolio.controller'; + +jest.mock('@ghostfolio/api/services/activities/activities.service', () => ({ + ActivitiesService: class {} +})); +jest.mock('@ghostfolio/api/services/api/api.service', () => ({ + ApiService: class {} +})); +jest.mock( + '@ghostfolio/api/services/configuration/configuration.service', + () => ({ ConfigurationService: class {} }) +); +jest.mock('./portfolio.service', () => ({ PortfolioService: class {} })); + +function holding() { + return { + investment: 600, + marketPrice: 100, + quantity: 6, + valueInBaseCurrency: 600, + assetProfile: { + assetClass: 'EQUITY', + assetSubClass: null, + name: 'Synthetic equity' + }, + markets: undefined, + marketsAdvanced: undefined + } as unknown as PortfolioDetails['holdings'][number]; +} + +async function details( + holdings = [holding()], + hasErrors = false, + readValues = true, + options: { + restricted?: boolean; + subscription?: SubscriptionType; + enableSubscription?: boolean; + } = {} +) { + const controller = new PortfolioController( + undefined, + { buildFiltersFromQueryParams: () => [] } as never, + { get: () => !!options.enableSubscription } as never, + { + getDetails: async () => ({ + holdings, + hasErrors, + accounts: {}, + platforms: {}, + summary: { + accountCashInBaseCurrency: 100, + cash: 100, + emergencyFund: { cash: 0 }, + filteredValueInBaseCurrency: 600 + } + }) + } as never, + { + user: { + subscription: { type: options.subscription }, + settings: { settings: { isRestrictedView: !!options.restricted } } + } + } as unknown as RequestWithUser + ); + return controller.getDetails( + { + userId: 'synthetic', + scopes: readValues ? [scopes.portfolioReadValues] : [] + } as ImpersonationContext, + {} as GetDetailsDto + ); +} + +describe('Portfolio details financial error flag for Targets', () => { + it('allows valid values with missing optional market/profile metadata', async () => { + expect((await details()).hasError).toBe(false); + }); + + it('allows unknown asset classification without inventing one', async () => { + const value = holding(); + value.assetProfile.assetClass = null; + const result = await details([value]); + expect(result.hasError).toBe(false); + expect(result.holdings[0].assetProfile.assetClass).toBeNull(); + }); + + it.each([undefined, null, NaN, Infinity])( + 'flags invalid financial value %s in a later holding', + async (value) => { + const bad = { ...holding(), valueInBaseCurrency: value }; + expect((await details([holding(), bad])).hasError).toBe(true); + } + ); + + it.each(['investment', 'marketPrice', 'quantity'])( + 'flags a missing %s', + async (field) => { + const bad = { ...holding(), [field]: undefined }; + expect((await details([bad])).hasError).toBe(true); + } + ); + + it('preserves genuine calculator errors', async () => { + expect((await details([holding()], true)).hasError).toBe(true); + }); + + it('does not label finite negative positions as a data error', async () => { + expect( + ( + await details([ + { ...holding(), quantity: -1, valueInBaseCurrency: -100 } + ]) + ).hasError + ).toBe(false); + }); + + it('keeps restricted monetary summary fields redacted', async () => { + expect((await details([holding()], false, false)).summary.cash).toBeNull(); + }); + + it.each([ + { + readValues: true, + restricted: false, + enableSubscription: false, + subscription: undefined, + masked: false + }, + { + readValues: false, + restricted: false, + enableSubscription: false, + subscription: undefined, + masked: true + }, + { + readValues: true, + restricted: true, + enableSubscription: false, + subscription: undefined, + masked: true + }, + { + readValues: true, + restricted: false, + enableSubscription: true, + subscription: SubscriptionType.Basic, + masked: true + }, + { + readValues: true, + restricted: false, + enableSubscription: true, + subscription: SubscriptionType.Premium, + masked: false + } + ])( + 'protects independent cash under controller permissions: %j', + async ({ readValues, masked, ...options }) => { + const result = await details([holding()], false, readValues, options); + expect(result.summary.accountCashInBaseCurrency).toBe( + masked ? null : 100 + ); + expect(result.summary.cash).toBe(masked ? null : 100); + } + ); + + it.each([ + { + readValues: true, + restricted: false, + missingContext: false, + masked: false + }, + { + readValues: false, + restricted: false, + missingContext: false, + masked: true + }, + { readValues: true, restricted: true, missingContext: false, masked: true }, + { readValues: true, restricted: false, missingContext: true, masked: true } + ])( + 'protects independent cash through the response interceptor: %j', + async ({ readValues, restricted, missingContext, masked }) => { + const request = { + impersonation: missingContext + ? undefined + : { scopes: readValues ? [scopes.portfolioReadValues] : [] }, + user: { settings: { settings: { isRestrictedView: restricted } } } + }; + const result = await lastValueFrom( + new RedactValuesInResponseInterceptor().intercept( + { switchToHttp: () => ({ getRequest: () => request }) } as never, + { handle: () => of({ summary: { accountCashInBaseCurrency: 100 } }) } + ) + ); + expect(result.summary.accountCashInBaseCurrency).toBe( + masked ? null : 100 + ); + } + ); +}); diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 8d4e081d7f..ba176728d5 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -2,7 +2,6 @@ import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorat import { Impersonation } from '@ghostfolio/api/decorators/impersonation.decorator'; import { RequiresScope } from '@ghostfolio/api/decorators/requires-scope.decorator'; import { - hasNotDefinedValuesInObject, nullifyValuesInObject, nullifyValuesInObjects } from '@ghostfolio/api/helper/object.helper'; @@ -121,7 +120,17 @@ export class PortfolioController { withSummary: true }); - if (hasErrors || hasNotDefinedValuesInObject(holdings)) { + // Optional profile/market metadata may be absent on a valid holding. + // Check the financial values of every holding instead of recursively + // treating missing metadata as a valuation error. + const hasInvalidHoldingValues = holdings.some( + ({ investment, marketPrice, quantity, valueInBaseCurrency }) => + [investment, marketPrice, quantity, valueInBaseCurrency].some( + (value) => !Number.isFinite(value) + ) + ); + + if (hasErrors || hasInvalidHoldingValues) { hasError = true; } @@ -147,6 +156,7 @@ export class PortfolioController { }); portfolioSummary = nullifyValuesInObject(summary, [ + 'accountCashInBaseCurrency', 'cash', 'currentNetWorth', 'currentValueInBaseCurrency', diff --git a/apps/api/src/app/portfolio/portfolio.service.spec.ts b/apps/api/src/app/portfolio/portfolio.service.spec.ts index 3994dc7c93..cc879ece55 100644 --- a/apps/api/src/app/portfolio/portfolio.service.spec.ts +++ b/apps/api/src/app/portfolio/portfolio.service.spec.ts @@ -2,6 +2,7 @@ import { PortfolioCalculator } from '@ghostfolio/api/app/portfolio/calculator/po import { userDummyData } from '@ghostfolio/api/app/portfolio/calculator/portfolio-calculator-test-utils'; import { PortfolioCalculatorFactory } from '@ghostfolio/api/app/portfolio/calculator/portfolio-calculator.factory'; import { CurrentRateService } from '@ghostfolio/api/app/portfolio/current-rate.service'; +import { WHERE_ACCOUNT_NOT_EXCLUDED } from '@ghostfolio/api/helper/account.helper'; import { AccountBalanceService } from '@ghostfolio/api/services/account-balance/account-balance.service'; import { AccountService } from '@ghostfolio/api/services/account/account.service'; import { CashDetails } from '@ghostfolio/api/services/account/interfaces/cash-details.interface'; @@ -430,6 +431,45 @@ describe('PortfolioService', () => { }); }); + describe('independent account cash selection', () => { + it.each([false, true])( + 'preserves exclusion and account-selection constraints (selected: %s)', + async (selected) => { + const filters: Filter[] = selected + ? [{ type: 'ACCOUNT', id: 'euro' }] + : []; + const euro = { id: 'euro', balance: 20, currency: 'EUR' }; + const dollar = { id: 'dollar', balance: 60, currency: 'USD' }; + const accounts = ( + selected ? [euro] : [euro, dollar] + ) as AccountWithBalance[]; + const accountsSpy = jest + .spyOn(accountService, 'accounts') + .mockResolvedValue(accounts); + const conversion = jest + .spyOn(exchangeRateDataService, 'toCurrency') + .mockImplementation((value, currency) => + currency === 'EUR' ? value * 2 : value + ); + const result = await accountService.getCashDetails({ + userId: userDummyData.id, + currency: 'USD', + filters + }); + expect(accountsSpy).toHaveBeenCalledWith({ + where: { + userId: userDummyData.id, + AND: [WHERE_ACCOUNT_NOT_EXCLUDED], + ...(selected ? { id: { in: ['euro'] } } : {}) + } + }); + expect(result.balanceInBaseCurrency).toBe(selected ? 40 : 100); + expect(result.accounts).toEqual(accounts); + expect(conversion).toHaveBeenCalledTimes(accounts.length); + } + ); + }); + describe('getDetails', () => { const setUpCashOnlyPortfolio = ({ baseCurrency = 'CHF', @@ -546,6 +586,46 @@ describe('PortfolioService', () => { .mockResolvedValue({ accounts: {}, platforms: {} }); }; + it.each([ + { filters: [] as Filter[] }, + { filters: [{ type: 'ACCOUNT', id: 'selected-account' }] as Filter[] } + ])( + 'passes the existing filtered cash result to the summary: %j', + async ({ filters }) => { + setUpCashOnlyPortfolio(); + const summarySpy = jest + .spyOn( + portfolioService as unknown as { + getSummary: (args: { + balanceInBaseCurrency: number; + }) => Promise; + }, + 'getSummary' + ) + .mockImplementation( + async ({ balanceInBaseCurrency }) => + ({ + accountCashInBaseCurrency: balanceInBaseCurrency + }) as PortfolioSummary + ); + const result = await portfolioService.getDetails({ + filters, + userId: userDummyData.id, + withSummary: true + }); + expect(accountService.getCashDetails).toHaveBeenCalledTimes(1); + expect(accountService.getCashDetails).toHaveBeenCalledWith({ + filters, + userId: userDummyData.id, + currency: 'CHF' + }); + expect(summarySpy).toHaveBeenCalledWith( + expect.objectContaining({ balanceInBaseCurrency: 1820 }) + ); + expect(result.summary.accountCashInBaseCurrency).toBe(1820); + } + ); + it('should return cash holdings when the calculator emits cash positions with the exchange-rate data source', async () => { setUpCashOnlyPortfolio(); @@ -1356,6 +1436,38 @@ describe('PortfolioService', () => { } as unknown as Awaited>); }); + it.each([ + { balance: 0.01, fund: 10000 }, + { balance: 100, fund: 3e15 }, + { balance: 100, fund: 1e16 } + ])( + 'exposes account cash unchanged by fund adjustments: %j', + async ({ balance, fund }) => { + jest + .spyOn(accountService, 'getCashDetails') + .mockResolvedValue({ accounts: [], balanceInBaseCurrency: balance }); + jest.spyOn(userService, 'user').mockResolvedValue({ + id: userDummyData.id, + settings: { settings: { baseCurrency: 'CHF', emergencyFund: fund } } + } as unknown as Awaited>); + const summary = await getSummary({ + portfolioCalculator: createPortfolioCalculator(), + balanceInBaseCurrency: balance, + emergencyFundHoldingsValueInBaseCurrency: 0, + filteredValueInBaseCurrency: new Big(3000), + userCurrency: 'CHF', + userId: userDummyData.id + }); + expect(summary.accountCashInBaseCurrency).toBe(balance); + expect(summary.cash).toBe(new Big(balance).minus(fund).toNumber()); + expect(summary.emergencyFund.cash).toBe(fund); + expect(summary.totalCashInBaseCurrency).toBe(1000); + // Only the pre-existing excluded-account lookup occurs in getSummary. + expect(accountService.getCashDetails).toHaveBeenCalledTimes(1); + expect(exchangeRateDataService.toCurrency).not.toHaveBeenCalled(); + } + ); + it('should derive the cash and net worth from the account balance when there are no excluded accounts, no emergency fund and no liabilities', async () => { jest.spyOn(accountService, 'getCashDetails').mockResolvedValue({ accounts: [], @@ -1877,6 +1989,30 @@ describe('PortfolioService', () => { expect(platforms[account.platformId].valueInBaseCurrency).toBe(110); }); + it('keeps permanently excluded accounts out of account totals', async () => { + const excluded = { + ...account, + id: 'excluded', + balance: 5000, + tags: [{ id: TAG_ID_EXCLUDE_FROM_ANALYSIS }] + }; + jest + .spyOn(accountService, 'getAccounts') + .mockResolvedValue([ + account, + excluded + ] as unknown as AccountWithBalance[]); + const { accounts } = await getValueOfAccountsAndPlatforms({ + activities: [], + filters: [], + portfolioItemsNow: {}, + userCurrency: 'USD', + userId: userDummyData.id + }); + expect(Object.keys(accounts)).toEqual([account.id]); + expect(accounts[account.id].valueInBaseCurrency).toBe(100); + }); + it('should not accumulate rounding errors of the balances of accounts sharing a platform', async () => { const platformId = randomUUID(); diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 8cb3ce9f1f..00f9ad31e0 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -2289,6 +2289,7 @@ export class PortfolioService { })?.toNumber(); return { + accountCashInBaseCurrency: balanceInBaseCurrency, annualizedPerformancePercent, annualizedPerformancePercentWithCurrencyEffect, cash, diff --git a/apps/api/src/helper/object.helper.spec.ts b/apps/api/src/helper/object.helper.spec.ts index e74fd2db47..994197da18 100644 --- a/apps/api/src/helper/object.helper.spec.ts +++ b/apps/api/src/helper/object.helper.spec.ts @@ -27,6 +27,14 @@ describe('query', () => { }); describe('redactAttributes', () => { + it('redacts independent summary cash with the centralized paths', () => { + expect( + redactPaths({ + object: { summary: { accountCashInBaseCurrency: 0.01 } }, + paths: DEFAULT_REDACTED_PATHS + }) + ).toEqual({ summary: { accountCashInBaseCurrency: null } }); + }); it('should redact provided attributes', () => { expect(redactPaths({ object: {}, paths: [] })).toStrictEqual({}); diff --git a/apps/client/src/app/pages/portfolio/portfolio-page.component.ts b/apps/client/src/app/pages/portfolio/portfolio-page.component.ts index f921654878..2539ee686a 100644 --- a/apps/client/src/app/pages/portfolio/portfolio-page.component.ts +++ b/apps/client/src/app/pages/portfolio/portfolio-page.component.ts @@ -18,6 +18,7 @@ import { analyticsOutline, calculatorOutline, pieChartOutline, + flagOutline, scanOutline, swapVerticalOutline } from 'ionicons/icons'; @@ -61,6 +62,11 @@ export class PortfolioPageComponent { routerLink: internalRoutes.portfolio.subRoutes.allocations.routerLink }, + { + iconName: 'flag-outline', + label: internalRoutes.portfolio.subRoutes.targets.title, + routerLink: internalRoutes.portfolio.subRoutes.targets.routerLink + }, { iconName: 'calculator-outline', label: internalRoutes.portfolio.subRoutes.fire.title, @@ -81,6 +87,7 @@ export class PortfolioPageComponent { addIcons({ analyticsOutline, calculatorOutline, + flagOutline, pieChartOutline, scanOutline, swapVerticalOutline diff --git a/apps/client/src/app/pages/portfolio/portfolio-page.routes.ts b/apps/client/src/app/pages/portfolio/portfolio-page.routes.ts index aeebf4a6b7..70dd307807 100644 --- a/apps/client/src/app/pages/portfolio/portfolio-page.routes.ts +++ b/apps/client/src/app/pages/portfolio/portfolio-page.routes.ts @@ -24,6 +24,11 @@ export const routes: Routes = [ loadChildren: () => import('./allocations/allocations-page.routes').then((m) => m.routes) }, + { + path: internalRoutes.portfolio.subRoutes.targets.path, + loadChildren: () => + import('./targets/targets-page.routes').then((m) => m.routes) + }, { path: internalRoutes.portfolio.subRoutes.fire.path, loadChildren: () => diff --git a/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html new file mode 100644 index 0000000000..9932949d02 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html @@ -0,0 +1,83 @@ +

Configure target

+ +
+ + Starting allocation + + @for (preset of presets; track preset.id) { + {{ preset.label }} + } + Custom + + +

+ Presets are starting points. Edit any percentage to customize your target. +

+
+
+
+ +
+ Total: + {{ total | targetPercent: data.user.settings.locale }} +
+
+
+ @for (assetClass of classes; track assetClass) { +
+ +
+ + % +
+
+ } +
+
+ +
+ + % +
+
+ @if (!isValid) { +

+ Each percentage must be between 0 and 100, and the total must equal + 100%. +

+ } +
+
+
+ + + + diff --git a/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.scss b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.scss new file mode 100644 index 0000000000..14cfd49a11 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.scss @@ -0,0 +1,16 @@ +:host { display: block; } +.configuration-content { min-width: min(760px, 80vw); } +.allocation-input { + display: flex; + gap: 1rem; + align-items: center; + justify-content: space-between; + margin-bottom: 0.65rem; + label { flex: 1; } + .input-group { width: 9rem; } +} +gf-portfolio-proportion-chart { display: block; min-height: 250px; } +@media (max-width: 600px) { + .configuration-content { min-width: 0; } + .allocation-input { gap: 0.5rem; } +} diff --git a/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.spec.ts b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.spec.ts new file mode 100644 index 0000000000..a61ab520a7 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.spec.ts @@ -0,0 +1,116 @@ +import { PortfolioTargetProfile, User } from '@ghostfolio/common/interfaces'; +import { createDefaultPortfolioTarget } from '@ghostfolio/common/portfolio-targets/portfolio-targets-presets'; +import { AssetClass } from '@ghostfolio/prisma/enums'; + +import { TestBed } from '@angular/core/testing'; +import '@angular/localize/init'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; + +import { GfTargetConfigurationDialogComponent } from './target-configuration-dialog.component'; +import { + createTargetFromPreset, + getTargetProfileName, + TARGET_PRESETS +} from './target-presets'; + +jest.mock('@ghostfolio/ui/i18n', () => ({ + translate: (value: string) => value +})); +jest.mock('@ghostfolio/ui/portfolio-proportion-chart', () => ({ + GfPortfolioProportionChartComponent: class {} +})); + +describe('Portfolio target configuration dialog', () => { + const close = jest.fn(); + function create(profile?: PortfolioTargetProfile) { + TestBed.configureTestingModule({ + providers: [ + { + provide: MAT_DIALOG_DATA, + useValue: { profile, user: { settings: {} } as User } + }, + { provide: MatDialogRef, useValue: { close } } + ] + }); + return TestBed.runInInjectionContext( + () => new GfTargetConfigurationDialogComponent() + ); + } + afterEach(() => { + TestBed.resetTestingModule(); + close.mockClear(); + }); + + it('starts with a valid moderate target for existing users without settings', () => { + const component = create(); + expect(component['profile'].presetId).toBe('moderate-60-40'); + expect(component['isValid']).toBe(true); + }); + + it('edits a copy and cancels without modifying persisted targets', () => { + const profile = createDefaultPortfolioTarget(); + const component = create(profile); + component['updateAllocation'](AssetClass.EQUITY, 50); + component['cancel'](); + expect(profile.allocations.EQUITY).toBe(0.6); + expect(close).toHaveBeenCalledWith(); + }); + + it('does not convert blank fields into valid zero allocations or tolerances', () => { + const component = create(); + component['updateTolerance'](null); + expect(component['isValid']).toBe(false); + component['updateTolerance'](5); + component['updateAllocation'](AssetClass.COMMODITY, null); + expect(component['isValid']).toBe(false); + component['save'](); + expect(close).not.toHaveBeenCalled(); + }); + + it('keeps tolerance when selecting a preset and invalidates the preset label on editing', () => { + const component = create(); + component['updateTolerance'](7); + component['applyPreset']('golden-butterfly'); + expect(component['profile'].tolerance).toBe(0.07); + expect(component['profile'].name).toBe('Golden Butterfly (simplified)'); + component['updateAllocation'](AssetClass.EQUITY, 35); + expect(component['profile'].presetId).toBeUndefined(); + expect(component['profile'].name).toBe('Custom'); + expect(component['chartData'][AssetClass.EQUITY].value).toBe(0.35); + expect(component['isValid']).toBe(false); + }); + + it('saves a valid profile and uses the same client label for each preset', () => { + const component = create(); + component['save'](); + expect(close).toHaveBeenCalledWith(component['profile']); + for (const { id, label } of TARGET_PRESETS) { + expect(getTargetProfileName(createTargetFromPreset(id))).toBe(label); + const modified = createTargetFromPreset(id); + modified.allocations.EQUITY = 0; + expect(createTargetFromPreset(id).allocations.EQUITY).toBeGreaterThan(0); + } + }); + it('resolves a stored preset in the active UI language without rewriting its name', () => { + const stored = createTargetFromPreset('moderate-60-40'); + const label = TARGET_PRESETS[2]; + const originalLabel = label.label; + try { + label.label = 'Moderato (60/40)'; + expect(getTargetProfileName(stored)).toBe('Moderato (60/40)'); + expect(stored.name).toBe('Moderate (60/40)'); + } finally { + label.label = originalLabel; + } + }); + + it('preserves a personal profile name while localizing generated labels', () => { + const stored = { + ...createDefaultPortfolioTarget(), + presetId: undefined, + name: 'Piano famiglia' + }; + expect(getTargetProfileName(stored)).toBe('Piano famiglia'); + expect(getTargetProfileName({ ...stored, name: 'Custom' })).toBe('Custom'); + }); +}); diff --git a/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.ts b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.ts new file mode 100644 index 0000000000..cc352cb526 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.ts @@ -0,0 +1,138 @@ +import { PortfolioTargetProfile, User } from '@ghostfolio/common/interfaces'; +import { TARGET_ASSET_CLASSES } from '@ghostfolio/common/portfolio-targets/portfolio-targets-calculator'; +import { isValidPortfolioTargetsSettings } from '@ghostfolio/common/portfolio-targets/portfolio-targets-validation'; +import { AssetClass } from '@ghostfolio/prisma/enums'; +import { translate } from '@ghostfolio/ui/i18n'; +import { GfPortfolioProportionChartComponent } from '@ghostfolio/ui/portfolio-proportion-chart'; + +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogModule, + MatDialogRef +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; + +import { GfTargetPercentPipe } from './target-percent.pipe'; +import { createTargetFromPreset, TARGET_PRESETS } from './target-presets'; + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ + GfTargetPercentPipe, + FormsModule, + GfPortfolioProportionChartComponent, + MatButtonModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatSelectModule + ], + selector: 'gf-target-configuration-dialog', + styleUrls: ['./target-configuration-dialog.component.scss'], + templateUrl: './target-configuration-dialog.component.html' +}) +export class GfTargetConfigurationDialogComponent { + protected readonly classes = TARGET_ASSET_CLASSES; + protected readonly presets = TARGET_PRESETS; + protected profile: PortfolioTargetProfile; + + protected readonly data = inject<{ + profile?: PortfolioTargetProfile; + user: User; + }>(MAT_DIALOG_DATA); + private readonly dialogRef = + inject< + MatDialogRef + >(MatDialogRef); + + protected readonly labels = Object.fromEntries( + TARGET_ASSET_CLASSES.map((assetClass) => [ + assetClass, + translate(assetClass) + ]) + ) as Record; + + public constructor() { + const defaultProfile = createTargetFromPreset('moderate-60-40'); + this.profile = { + ...(this.data.profile ?? defaultProfile), + allocations: { + ...(this.data.profile?.allocations ?? defaultProfile.allocations) + } + }; + this.updateChartData(); + } + + protected chartData: Record = {}; + + private updateChartData() { + this.chartData = Object.fromEntries( + this.classes.map((assetClass) => [ + assetClass, + { + name: this.labels[assetClass], + value: Math.max(0, this.profile.allocations[assetClass] ?? 0) + } + ]) + ); + } + + protected get total() { + return this.classes.reduce( + (sum, assetClass) => sum + (this.profile.allocations[assetClass] ?? 0), + 0 + ); + } + + protected get isValid() { + return isValidPortfolioTargetsSettings({ + version: 1, + activeProfileId: 'global', + profiles: [{ ...this.profile, id: 'global' }] + }); + } + + protected applyPreset(presetId: string) { + const next = createTargetFromPreset(presetId); + this.profile = { + ...next, + tolerance: this.profile.tolerance + }; + this.updateChartData(); + } + + protected updateAllocation(assetClass: AssetClass, percent: number) { + this.profile = { + ...this.profile, + presetId: undefined, + name: 'Custom', + allocations: { + ...this.profile.allocations, + [assetClass]: percent == null ? NaN : Number(percent) / 100 + } + }; + this.updateChartData(); + } + + protected updateTolerance(percent: number) { + this.profile = { + ...this.profile, + tolerance: percent == null ? NaN : Number(percent) / 100 + }; + } + + protected save() { + if (this.isValid) { + this.dialogRef.close(this.profile); + } + } + + protected cancel() { + this.dialogRef.close(); + } +} diff --git a/apps/client/src/app/pages/portfolio/targets/target-percent.pipe.spec.ts b/apps/client/src/app/pages/portfolio/targets/target-percent.pipe.spec.ts new file mode 100644 index 0000000000..4c51356439 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/target-percent.pipe.spec.ts @@ -0,0 +1,33 @@ +import { LOCALE_ID } from '@angular/core'; +import { TestBed } from '@angular/core/testing'; + +import { GfTargetPercentPipe } from './target-percent.pipe'; + +describe('Target percentage locale', () => { + let pipe: GfTargetPercentPipe; + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [{ provide: LOCALE_ID, useValue: 'en' }] + }); + pipe = TestBed.runInInjectionContext(() => new GfTargetPercentPipe()); + }); + afterEach(() => TestBed.resetTestingModule()); + + it('honors an Italian number locale on an English interface', () => { + expect(pipe.transform(0.1234, 'it-IT')).toBe('12,34%'); + expect(pipe.transform(0.1234, 'en-US')).toBe('12.34%'); + }); + + it('uses the interface locale when no number preference exists', () => { + expect(pipe.transform(0.1234)).toBe('12.34%'); + }); + + it('formats signed drift and tolerance without changing their values', () => { + expect(pipe.transform(-0.105, 'it-IT', 2, true)).toBe('-10,5%'); + expect(pipe.transform(0, 'it-IT', 2, true)).toBe('+0%'); + expect(pipe.transform(0.055, 'it-IT', 1)).toBe('5,5%'); + }); + it('falls back to the interface locale for a malformed stored preference', () => { + expect(pipe.transform(0.1234, 'not_a_locale')).toBe('12.34%'); + }); +}); diff --git a/apps/client/src/app/pages/portfolio/targets/target-percent.pipe.ts b/apps/client/src/app/pages/portfolio/targets/target-percent.pipe.ts new file mode 100644 index 0000000000..ab54b62173 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/target-percent.pipe.ts @@ -0,0 +1,34 @@ +import { LOCALE_ID, Pipe, PipeTransform, inject } from '@angular/core'; + +export function getTargetNumberLocale( + locale: string | undefined, + fallback: string +) { + try { + return Intl.getCanonicalLocales(locale ?? fallback)[0] ?? fallback; + } catch { + return fallback; + } +} + +/** Use the user's number locale independently from the interface language. */ +@Pipe({ name: 'targetPercent' }) +export class GfTargetPercentPipe implements PipeTransform { + private readonly defaultLocale = inject(LOCALE_ID); + + public transform( + value: number, + locale?: string, + maximumFractionDigits = 2, + signed = false + ) { + return new Intl.NumberFormat( + getTargetNumberLocale(locale, this.defaultLocale), + { + style: 'percent', + maximumFractionDigits, + signDisplay: signed ? 'always' : 'auto' + } + ).format(value); + } +} diff --git a/apps/client/src/app/pages/portfolio/targets/target-presets.ts b/apps/client/src/app/pages/portfolio/targets/target-presets.ts new file mode 100644 index 0000000000..53b83b90ae --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/target-presets.ts @@ -0,0 +1,45 @@ +import { PortfolioTargetProfile } from '@ghostfolio/common/interfaces'; +import { PORTFOLIO_TARGET_PRESETS } from '@ghostfolio/common/portfolio-targets/portfolio-targets-presets'; + +/** The user-visible presets share the same source as the default model. */ +export const TARGET_PRESETS = PORTFOLIO_TARGET_PRESETS.map(({ id }) => ({ + id, + label: + id === 'cautious-20-80' + ? $localize`Cautious (20/80)` + : id === 'conservative-40-60' + ? $localize`Conservative (40/60)` + : id === 'moderate-60-40' + ? $localize`Moderate (60/40)` + : id === 'aggressive-80-20' + ? $localize`Aggressive (80/20)` + : $localize`Golden Butterfly (simplified)` +})); + +export function createTargetFromPreset( + presetId: string +): PortfolioTargetProfile { + const preset = + PORTFOLIO_TARGET_PRESETS.find(({ id }) => id === presetId) ?? + PORTFOLIO_TARGET_PRESETS[2]; + + return { + id: 'global', + name: preset.name, + presetId: preset.id, + tolerance: 0.05, + allocations: { ...preset.allocations } + }; +} + +/** Preset and generated labels follow the UI language; personal names stay intact. */ +export function getTargetProfileName(profile: PortfolioTargetProfile): string { + const preset = TARGET_PRESETS.find(({ id }) => id === profile.presetId); + if (preset) { + return preset.label; + } + + return !profile.presetId && profile.name === 'Custom' + ? $localize`Custom` + : profile.name; +} diff --git a/apps/client/src/app/pages/portfolio/targets/targets-page.component.spec.ts b/apps/client/src/app/pages/portfolio/targets/targets-page.component.spec.ts new file mode 100644 index 0000000000..e374cd4e70 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/targets-page.component.spec.ts @@ -0,0 +1,382 @@ +import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; +import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { TAG_ID_EXCLUDE_FROM_ANALYSIS } from '@ghostfolio/common/config'; +import { + AccountsResponse, + PortfolioDetails, + User +} from '@ghostfolio/common/interfaces'; +import { permissions } from '@ghostfolio/common/permissions'; +import { createDefaultPortfolioTarget } from '@ghostfolio/common/portfolio-targets/portfolio-targets-presets'; +import { scopes } from '@ghostfolio/common/scopes'; +import { DataService } from '@ghostfolio/ui/services'; + +import { ChangeDetectorRef } from '@angular/core'; +import { TestBed } from '@angular/core/testing'; +import '@angular/localize/init'; +import { MatDialog } from '@angular/material/dialog'; +import { provideNoopAnimations } from '@angular/platform-browser/animations'; +import { BehaviorSubject, Subject, of, throwError } from 'rxjs'; + +import { GfTargetsPageComponent } from './targets-page.component'; + +jest.mock('@ghostfolio/ui/services', () => ({ DataService: class {} })); +// Keep the real monetary formatter; the icon renderer is irrelevant here and +// its browser-only dependency graph is not transformed by the Jest preset. +jest.mock('@ionic/angular/standalone', () => { + const { Component } = + jest.requireActual('@angular/core'); + class IonIconStub {} + Component({ + selector: 'ion-icon', + standalone: true, + template: '', + inputs: ['name'] + })(IonIconStub); + return { IonIcon: IonIconStub }; +}); +jest.mock('@ghostfolio/ui/i18n', () => ({ + translate: (value: string) => value +})); +jest.mock('@ghostfolio/client/services/user/user.service', () => ({ + UserService: class {} +})); +jest.mock('./target-configuration-dialog.component', () => ({ + GfTargetConfigurationDialogComponent: class {} +})); + +function makeUser(): User { + return { + id: 'owner', + permissions: [permissions.updateUserSettings], + scopes: [scopes.accountRead, scopes.portfolioReadValues], + settings: { + portfolioTargets: { + version: 1, + activeProfileId: 'global', + profiles: [createDefaultPortfolioTarget()] + } + } + } as User; +} + +function makeDetails(): PortfolioDetails { + return { + accounts: { + one: { + balance: 100, + currency: 'EUR', + name: 'One', + valueInBaseCurrency: 100 + } + }, + holdings: [], + summary: { + accountCashInBaseCurrency: 100, + cash: 100, + emergencyFund: { cash: 0 }, + filteredValueInBaseCurrency: 0, + liabilitiesInBaseCurrency: 0 + } + } as PortfolioDetails; +} + +describe('Portfolio Targets page requests and persistence', () => { + let component: GfTargetsPageComponent; + let dialog: { open: jest.Mock }; + let state: BehaviorSubject<{ user: User }>; + let impersonation: BehaviorSubject; + let afterClosed: Subject>; + let dataService: { + fetchAccounts: jest.Mock; + fetchPortfolioDetails: jest.Mock; + putUserSetting: jest.Mock; + }; + + beforeEach(() => { + state = new BehaviorSubject({ user: makeUser() }); + impersonation = new BehaviorSubject(null); + afterClosed = new Subject(); + dialog = { open: jest.fn(() => ({ afterClosed: () => afterClosed })) }; + dataService = { + fetchAccounts: jest.fn(() => + of({ + accounts: [ + { id: 'one', name: 'One', tags: [] }, + { + id: 'excluded', + name: 'Excluded', + tags: [{ id: TAG_ID_EXCLUDE_FROM_ANALYSIS }] + } + ] + } as AccountsResponse) + ), + fetchPortfolioDetails: jest.fn(() => of(makeDetails())), + putUserSetting: jest.fn(() => of({})) + }; + TestBed.configureTestingModule({ + providers: [ + provideNoopAnimations(), + { provide: ChangeDetectorRef, useValue: { markForCheck: jest.fn() } }, + { provide: DataService, useValue: dataService }, + { + provide: UserService, + useValue: { + stateChanged: state, + get: jest.fn(() => of(state.value.user)) + } + }, + { + provide: ImpersonationStorageService, + useValue: { onChangeHasImpersonation: () => impersonation } + }, + { + provide: MatDialog, + useValue: dialog + } + ] + }); + component = TestBed.runInInjectionContext( + () => new GfTargetsPageComponent() + ); + component.ngOnInit(); + }); + + afterEach(() => TestBed.resetTestingModule()); + + it.each([ + { locale: 'en-US', currency: 'USD', amount: '100.00' }, + { locale: 'it-IT', currency: 'EUR', amount: '100,00' } + ])( + 'renders portfolio value before the unchanged drift cards ($locale)', + ({ locale, currency, amount }) => { + const user = makeUser(); + user.settings.locale = locale; + user.settings.baseCurrency = currency; + state.next({ user }); + const fixture = TestBed.createComponent(GfTargetsPageComponent); + fixture.detectChanges(); + const element = fixture.nativeElement as HTMLElement; + const cards = element.querySelectorAll('.row.mb-3 > .col-md-4'); + expect(cards).toHaveLength(3); + const text = Array.from(cards, (card) => + card.textContent.replace(/\s+/g, ' ').trim() + ); + expect(text[0]).toContain('Portfolio value'); + expect(text[0]).toContain(amount); + expect(text[0]).toContain(currency); + expect(text[1]).toContain('Total allocation drift'); + expect(text[1]).toContain('100%'); + expect(text[2]).toContain('Maximum deviation'); + expect(text[2]).toContain('100%'); + expect(element.textContent).not.toContain('Classes outside tolerance'); + } + ); + + it.each([ + 'loading', + 'unavailable', + 'inconsistent', + 'unsupported', + 'restricted' + ])('does not render monetary summary cards in state %s', (status) => { + const details = makeDetails(); + if (status === 'restricted') { + const user = makeUser(); + user.settings.isRestrictedView = true; + state.next({ user }); + } else if (status === 'loading') { + dataService.fetchPortfolioDetails.mockReturnValue( + new Subject() + ); + } else { + if (status === 'unavailable') + delete details.summary.accountCashInBaseCurrency; + if (status === 'inconsistent') + details.accounts.one.valueInBaseCurrency = 50; + if (status === 'unsupported') details.accounts.one.balance = -10; + dataService.fetchPortfolioDetails.mockReturnValue(of(details)); + } + const fixture = TestBed.createComponent(GfTargetsPageComponent); + fixture.detectChanges(); + expect( + (fixture.nativeElement as HTMLElement).querySelectorAll( + '.row.mb-3 > .col-md-4' + ) + ).toHaveLength(0); + }); + + it('renders the calculated value for the selected account', () => { + const user = makeUser(); + user.settings.baseCurrency = 'USD'; + user.settings.locale = 'en-US'; + state.next({ user }); + const fixture = TestBed.createComponent(GfTargetsPageComponent); + fixture.detectChanges(); + const details = makeDetails(); + details.accounts.one.balance = 250; + details.accounts.one.valueInBaseCurrency = 250; + details.summary.accountCashInBaseCurrency = 250; + dataService.fetchPortfolioDetails.mockReturnValue(of(details)); + fixture.componentInstance['changeAccount']('one'); + fixture.componentRef.changeDetectorRef.detectChanges(); + expect(dataService.fetchPortfolioDetails).toHaveBeenLastCalledWith({ + filters: [{ type: 'ACCOUNT', id: 'one' }] + }); + expect( + (fixture.nativeElement as HTMLElement).querySelector( + '.row.mb-3 > .col-md-4' + ).textContent + ).toContain('250.00'); + expect((fixture.nativeElement as HTMLElement).textContent).not.toContain( + 'Excluded' + ); + }); + + it('uses tagged account data, preserves the global option and sends account-only filters', () => { + expect(component['accounts'].map(({ id }) => id)).toEqual(['one']); + expect(dataService.fetchAccounts).toHaveBeenCalledWith({ filters: [] }); + expect(dataService.fetchPortfolioDetails).toHaveBeenLastCalledWith({ + filters: [] + }); + component['changeAccount']('one'); + expect(dataService.fetchPortfolioDetails).toHaveBeenLastCalledWith({ + filters: [{ type: 'ACCOUNT', id: 'one' }] + }); + expect(component['profile'].id).toBe('global'); + }); + + it('falls back to the global portfolio when an account disappears or is excluded', () => { + component['changeAccount']('one'); + dataService.fetchAccounts.mockReturnValue(of({ accounts: [] })); + state.next({ user: makeUser() }); + expect(component['selectedAccountId']).toBe(''); + expect(dataService.fetchPortfolioDetails).toHaveBeenLastCalledWith({ + filters: [] + }); + }); + + it('cancels stale account-switch responses', () => { + const stale = new Subject(); + dataService.fetchPortfolioDetails.mockReturnValueOnce(stale); + component['changeAccount']('one'); + component['changeAccount'](''); + stale.next({ ...makeDetails(), holdings: [], accounts: {} }); + expect(component['result'].status).toBe('ready'); + }); + + it('clears financial data and cancels pending requests on impersonation', () => { + impersonation.next('another-user'); + expect(component['result']).toBeUndefined(); + expect(component['accounts']).toEqual([]); + expect(component['canEdit']).toBe(false); + }); + + it('does not request monetary data after values permission is removed', () => { + dataService.fetchPortfolioDetails.mockClear(); + const user = makeUser(); + user.scopes = []; + state.next({ user }); + expect(dataService.fetchPortfolioDetails).not.toHaveBeenCalled(); + expect(component['result']).toBeUndefined(); + }); + + it('does not request account data without account-read scope', () => { + dataService.fetchAccounts.mockClear(); + const user = makeUser(); + user.scopes = [scopes.portfolioReadValues]; + state.next({ user }); + expect(dataService.fetchAccounts).not.toHaveBeenCalled(); + expect(dataService.fetchPortfolioDetails).toHaveBeenLastCalledWith({ + filters: [] + }); + }); + + it('checks editing permission again when a dialog is submitted', () => { + component['openConfiguration'](); + impersonation.next('another-user'); + afterClosed.next(createDefaultPortfolioTarget()); + expect(dataService.putUserSetting).not.toHaveBeenCalled(); + }); + + it('always saves a global versioned configuration when viewing a single account', () => { + component['changeAccount']('one'); + component['openConfiguration'](); + afterClosed.next(createDefaultPortfolioTarget()); + expect(dataService.putUserSetting).toHaveBeenCalledWith({ + portfolioTargets: { + version: 1, + activeProfileId: 'global', + profiles: [createDefaultPortfolioTarget()] + } + }); + }); + + it('preserves the allocation display on save failure and permits retry', () => { + dataService.putUserSetting.mockReturnValue( + throwError(() => new Error('failed')) + ); + component['openConfiguration'](); + afterClosed.next(createDefaultPortfolioTarget()); + expect(component['hasSaveError']).toBe(true); + expect(component['hasError']).toBe(false); + expect(component['isSaving']).toBe(false); + expect(component['result'].status).toBe('ready'); + component['openConfiguration'](); + expect(dialog.open).toHaveBeenLastCalledWith( + expect.anything(), + expect.objectContaining({ + data: expect.objectContaining({ + profile: createDefaultPortfolioTarget() + }) + }) + ); + }); + + it('clears the allocation when the user state becomes unavailable', () => { + state.next({ user: undefined }); + expect(component['result']).toBeUndefined(); + expect(component['accounts']).toEqual([]); + expect(component['canEdit']).toBe(false); + }); + it('does not bypass the backend error signal even if amounts look plausible', () => { + dataService.fetchPortfolioDetails.mockReturnValue( + of({ ...makeDetails(), hasError: true }) + ); + component['changeAccount'](''); + expect(component['hasError']).toBe(true); + expect(component['result']).toBeUndefined(); + }); + + it('clears monetary results when restricted view is enabled', () => { + dataService.fetchPortfolioDetails.mockClear(); + const user = makeUser(); + user.settings.isRestrictedView = true; + state.next({ user }); + expect(dataService.fetchPortfolioDetails).not.toHaveBeenCalled(); + expect(component['result']).toBeUndefined(); + }); + it('identifies negative balances as unsupported even with a backend error', () => { + const details = makeDetails(); + details.accounts.one.balance = -10; + details.accounts.one.valueInBaseCurrency = -10; + details.summary.accountCashInBaseCurrency = -10; + details.summary.cash = -10; + dataService.fetchPortfolioDetails.mockReturnValue( + of({ ...details, hasError: true }) + ); + component['changeAccount'](''); + expect(component['hasError']).toBe(false); + expect(component['result'].status).toBe('unsupported'); + expect(component['result'].rows).toEqual([]); + }); + + it('shows no allocation when an older backend omits independent cash', () => { + const details = makeDetails(); + delete details.summary.accountCashInBaseCurrency; + dataService.fetchPortfolioDetails.mockReturnValue(of(details)); + component['changeAccount'](''); + expect(component['result'].status).toBe('unavailable'); + expect(component['result'].rows).toEqual([]); + }); +}); diff --git a/apps/client/src/app/pages/portfolio/targets/targets-page.component.ts b/apps/client/src/app/pages/portfolio/targets/targets-page.component.ts new file mode 100644 index 0000000000..50b8145844 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/targets-page.component.ts @@ -0,0 +1,344 @@ +import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; +import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { + TAG_ID_EXCLUDE_FROM_ANALYSIS, + UNKNOWN_KEY +} from '@ghostfolio/common/config'; +import { + AccountsResponse, + Filter, + PortfolioTargetProfile, + User +} from '@ghostfolio/common/interfaces'; +import { hasPermission, permissions } from '@ghostfolio/common/permissions'; +import { + calculatePortfolioTargets, + TargetAllocationResult, + TargetAllocationRow +} from '@ghostfolio/common/portfolio-targets/portfolio-targets-calculator'; +import { hasScope, scopes } from '@ghostfolio/common/scopes'; +import { AssetClass } from '@ghostfolio/prisma/enums'; +import { translate } from '@ghostfolio/ui/i18n'; +import { DataService } from '@ghostfolio/ui/services'; +import { GfValueComponent } from '@ghostfolio/ui/value'; + +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + DestroyRef, + inject, + LOCALE_ID, + OnInit +} from '@angular/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatDialog } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { of, Subscription, finalize, switchMap } from 'rxjs'; + +import { GfTargetConfigurationDialogComponent } from './target-configuration-dialog.component'; +import { + GfTargetPercentPipe, + getTargetNumberLocale +} from './target-percent.pipe'; +import { getTargetProfileName } from './target-presets'; + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ + GfTargetPercentPipe, + GfValueComponent, + MatButtonModule, + MatCardModule, + MatFormFieldModule, + MatSelectModule, + MatTooltipModule + ], + selector: 'gf-targets-page', + styleUrls: ['./targets-page.scss'], + templateUrl: './targets-page.html' +}) +export class GfTargetsPageComponent implements OnInit { + protected user?: User; + protected accounts: AccountsResponse['accounts'] = []; + protected hasSaveError = false; + protected profile?: PortfolioTargetProfile; + protected result?: TargetAllocationResult; + protected selectedAccountId = ''; + protected isLoading = true; + protected isSaving = false; + protected hasError = false; + protected canEdit = false; + protected readonly labels: Record = Object.fromEntries( + Object.values(AssetClass).map((assetClass) => [ + assetClass, + translate(assetClass) + ]) + ); + private readonly defaultLocale = inject(LOCALE_ID); + private readonly changeDetectorRef = inject(ChangeDetectorRef); + private readonly dataService = inject(DataService); + private readonly destroyRef = inject(DestroyRef); + private readonly dialog = inject(MatDialog); + private readonly impersonationService = inject(ImpersonationStorageService); + private readonly userService = inject(UserService); + private isImpersonating = false; + private allocationRequest?: Subscription; + private draftProfile?: PortfolioTargetProfile; + private contextVersion = 0; + + public ngOnInit() { + this.impersonationService + .onChangeHasImpersonation() + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((id) => { + this.contextVersion++; + this.draftProfile = undefined; + this.isImpersonating = !!id; + this.allocationRequest?.unsubscribe(); + this.result = undefined; + this.accounts = []; + this.selectedAccountId = ''; + this.updateEditingPermission(); + }); + + this.userService.stateChanged + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((state) => { + if (!state?.user) { + this.contextVersion++; + this.allocationRequest?.unsubscribe(); + this.user = undefined; + this.profile = undefined; + this.result = undefined; + this.accounts = []; + this.draftProfile = undefined; + this.isLoading = false; + this.updateEditingPermission(); + return; + } + if (this.user?.id !== state.user.id) { + this.contextVersion++; + this.draftProfile = undefined; + this.selectedAccountId = ''; + } + this.user = state.user; + this.profile = this.user.settings.portfolioTargets?.profiles.find( + ({ id }) => + id === state.user.settings.portfolioTargets?.activeProfileId + ); + this.updateEditingPermission(); + this.fetchAllocations(); + }); + } + + protected get profileName() { + return this.profile ? getTargetProfileName(this.profile) : undefined; + } + + protected get hasReadValues() { + return ( + hasScope(this.user?.scopes, scopes.portfolioReadValues) && + !this.user?.settings?.isRestrictedView + ); + } + + protected get displayedRows() { + return this.result?.rows ?? []; + } + + protected formatClass(assetClass: string) { + return assetClass === UNKNOWN_KEY + ? $localize`Unclassified` + : (this.labels[assetClass] ?? assetClass); + } + + protected allocationTooltip(row: TargetAllocationRow) { + if (!this.hasReadValues || this.result?.status !== 'ready') { + return ''; + } + + const locale = getTargetNumberLocale( + this.user?.settings.locale, + this.defaultLocale + ); + const percent = new Intl.NumberFormat(locale, { + style: 'percent', + maximumFractionDigits: 2 + }); + const actual = percent.format(row.actual); + const target = percent.format(row.target); + const deviation = new Intl.NumberFormat(locale, { + maximumFractionDigits: 2, + signDisplay: 'exceptZero' + }).format(row.drift * 100); + const currency = this.user?.settings.baseCurrency; + const value = currency + ? new Intl.NumberFormat(locale, { + style: 'currency', + currency, + maximumFractionDigits: 2 + }).format(row.actual * this.result.totalValue) + : undefined; + + return [ + this.formatClass(row.assetClass), + value + ? $localize`Actual: ${actual} (${value})` + : $localize`Actual: ${actual}`, + $localize`Target: ${target}`, + $localize`Deviation: ${deviation} percentage points`, + row.outOfTolerance + ? $localize`Outside tolerance` + : $localize`Within tolerance` + ].join('\n'); + } + + protected changeAccount(accountId: string) { + this.selectedAccountId = accountId; + this.fetchAllocations(); + } + + protected openConfiguration() { + if (!this.canEdit || !this.user || this.isSaving) { + return; + } + + const contextVersion = this.contextVersion; + const ref = this.dialog.open(GfTargetConfigurationDialogComponent, { + maxWidth: '96vw', + width: '820px', + data: { profile: this.draftProfile ?? this.profile, user: this.user } + }); + + ref + .afterClosed() + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((profile?: PortfolioTargetProfile) => { + if ( + !profile || + !this.canEdit || + this.isSaving || + contextVersion !== this.contextVersion + ) { + return; + } + this.draftProfile = profile; + this.isSaving = true; + this.hasSaveError = false; + this.dataService + .putUserSetting({ + portfolioTargets: { + version: 1, + activeProfileId: 'global', + profiles: [{ ...profile, id: 'global' }] + } + }) + .pipe( + switchMap(() => this.userService.get(true)), + finalize(() => { + this.isSaving = false; + this.changeDetectorRef.markForCheck(); + }), + takeUntilDestroyed(this.destroyRef) + ) + .subscribe({ + next: () => { + this.draftProfile = undefined; + }, + error: () => { + this.hasSaveError = true; + this.changeDetectorRef.markForCheck(); + } + }); + }); + } + + private updateEditingPermission() { + this.canEdit = + !!this.user && + !this.isImpersonating && + hasPermission(this.user.permissions, permissions.updateUserSettings); + this.changeDetectorRef.markForCheck(); + } + + private fetchAllocations() { + if (!this.user) { + return; + } + + this.allocationRequest?.unsubscribe(); + this.isLoading = true; + this.hasError = false; + this.result = undefined; + this.changeDetectorRef.markForCheck(); + + if (!this.hasReadValues) { + this.accounts = []; + this.isLoading = false; + return; + } + + this.allocationRequest = ( + hasScope(this.user.scopes, scopes.accountRead) + ? this.dataService.fetchAccounts({ filters: [] }) + : of({ accounts: [] as AccountsResponse['accounts'] }) + ) + .pipe( + switchMap(({ accounts }) => { + this.accounts = accounts.filter( + (account) => + !account.tags?.some( + ({ id }) => id === TAG_ID_EXCLUDE_FROM_ANALYSIS + ) + ); + if (!this.accounts.some(({ id }) => id === this.selectedAccountId)) { + this.selectedAccountId = ''; + } + const filters: Filter[] = this.selectedAccountId + ? [{ type: 'ACCOUNT', id: this.selectedAccountId }] + : []; + return this.dataService.fetchPortfolioDetails({ filters }); + }), + takeUntilDestroyed(this.destroyRef) + ) + .subscribe({ + next: (details) => { + if (this.profile) { + if (!this.hasReadValues) { + this.hasError = true; + } else { + this.result = calculatePortfolioTargets({ + details, + targets: this.profile.allocations, + tolerance: this.profile.tolerance + }); + // Known negative exposures remain an unsupported financial case, + // even when the backend also reports valuation errors. No + // percentages are shown for either state. + if ( + 'hasError' in details && + details.hasError && + this.result.status !== 'unsupported' + ) { + this.result = undefined; + this.hasError = true; + } + } + } + this.isLoading = false; + this.changeDetectorRef.markForCheck(); + }, + error: () => { + this.accounts = []; + this.hasError = true; + this.isLoading = false; + this.changeDetectorRef.markForCheck(); + } + }); + } +} diff --git a/apps/client/src/app/pages/portfolio/targets/targets-page.html b/apps/client/src/app/pages/portfolio/targets/targets-page.html new file mode 100644 index 0000000000..56eaf5d36e --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/targets-page.html @@ -0,0 +1,247 @@ +
+

Targets

+ +
+
+ @if (profile) { +
{{ profileName }}
+ Allowed deviation: + + ±{{ profile.tolerance | targetPercent: user?.settings.locale : 1 }} + + } @else { + No target configured yet + } +
+ @if (canEdit) { + + } +
+ + @if (accounts.length > 0) { + + @if (selectedAccountId) { +

+ Comparing the selected account with the global portfolio target. +

+ } + } + + @if (hasSaveError) { + + } + + @if (!profile) { + + +

+ Create a target to compare the actual asset allocation with your + desired allocation. +

+
+
+ } @else if (isLoading) { +

Loading portfolio allocation…

+ } @else if (hasError || !result || result.status === 'unavailable') { + + +

+ The current allocation cannot be calculated with the available data or + permissions. +

+
+
+ } @else if (result.status === 'empty') { +

The selected portfolio is empty.

+ } @else if (result.status === 'unsupported') { + + +

+ Negative cash balances, short positions and liabilities can be valid + financial data, but are not supported by this version of the + allocation comparison. +

+
+
+ } @else if (result.status === 'inconsistent') { + + +

+ Account values, holdings and cash cannot be reconciled. The allocation + comparison is unavailable. +

+
+
+ } @else { + @if (result.unclassifiedValue > 0) { +

+ Some holdings have no asset classification. The reported allocation is + incomplete. +

+ } +
+
+ +
Portfolio value
+
+ +
+
+
+ +
+ Total allocation drift +
+
+ {{ result.totalDrift | targetPercent: user?.settings.locale }} +
+
+
+
+ +
Maximum deviation
+
+ {{ result.maxDrift | targetPercent: user?.settings.locale }} +
+
+
+
+ + + Actual vs target allocation + +
+ + + Actual + + + + Target + +
+ @for (row of displayedRows; track row.assetClass) { +
+
+ {{ formatClass(row.assetClass) }} + + {{ + row.drift | targetPercent: user?.settings.locale : 2 : true + }} + +
+
+
+
+
+
+
+
+ } +
+
+ + + Deviation details + + + + + + + + + + + + + @for (row of displayedRows; track row.assetClass) { + + + + + + + + } + +
Asset classActualTargetDeviationStatus
{{ formatClass(row.assetClass) }} + {{ row.actual | targetPercent: user?.settings.locale }} + + {{ row.target | targetPercent: user?.settings.locale }} + + {{ + row.drift | targetPercent: user?.settings.locale : 2 : true + }} + + @if (row.outOfTolerance) { + Outside tolerance + } @else { + Within tolerance + } +
+
+
+ } +
diff --git a/apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts b/apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts new file mode 100644 index 0000000000..06e1cb29d7 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts @@ -0,0 +1,14 @@ +import { AuthGuard } from '@ghostfolio/client/core/auth.guard'; + +import { Routes } from '@angular/router'; + +import { GfTargetsPageComponent } from './targets-page.component'; + +export const routes: Routes = [ + { + canActivate: [AuthGuard], + component: GfTargetsPageComponent, + path: '', + title: $localize`Targets` + } +]; diff --git a/apps/client/src/app/pages/portfolio/targets/targets-page.scss b/apps/client/src/app/pages/portfolio/targets/targets-page.scss new file mode 100644 index 0000000000..dfea1beb05 --- /dev/null +++ b/apps/client/src/app/pages/portfolio/targets/targets-page.scss @@ -0,0 +1,119 @@ +:host { + display: block; +} + +.account-select { + width: min(320px, 100%); +} + +.comparison-legend { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: flex-end; + gap: 1.25rem; + margin-bottom: 1.25rem; +} + +.legend-item { + display: inline-flex; + align-items: center; + gap: 0.45rem; +} + +.legend-marker { + flex: none; + width: 0.65rem; + height: 0.65rem; + border-radius: 0.15rem; +} + +.comparison-row { + border-radius: 0.35rem; + cursor: help; + + &:focus-visible { + outline: 2px solid currentColor; + outline-offset: 6px; + } +} + +.comparison-track { + height: 0.62rem; + background: rgba(128, 128, 128, 0.11); + border-radius: 0.35rem; + margin-bottom: 0.3rem; + overflow: hidden; +} + +.comparison-bar { + height: 100%; + border-radius: 0.35rem; +} + +.current-bar, +.current-marker { + background: #36cfcc; +} + +.target-bar, +.target-marker { + background: #3686cf; +} + +.targets-table-container { + min-width: 0; + overflow-x: auto; +} + +.targets-table { + width: 100%; + min-width: 40rem; + margin: 0; + border-collapse: collapse; + + th, + td { + padding: 0.875rem 1rem; + border-bottom: 1px solid rgba(128, 128, 128, 0.2); + vertical-align: middle; + + &:first-child { + width: 32%; + padding-left: 0; + text-align: left; + } + + &:last-child { + padding-right: 0; + } + } + + thead th { + font-weight: 600; + } + + tbody th { + font-weight: inherit; + } + + tbody tr:last-child { + th, + td { + border-bottom: 0; + } + } + + .numeric-column { + width: 15%; + text-align: right; + white-space: nowrap; + font-variant-numeric: tabular-nums; + } + + .status-column { + width: 23%; + text-align: right; + white-space: nowrap; + } +} diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf index 5e2e396f85..2ee91be14f 100644 --- a/apps/client/src/locales/messages.ca.xlf +++ b/apps/client/src/locales/messages.ca.xlf @@ -4089,7 +4089,7 @@ Alternative Investment - Alternative Investment + Inversions alternatives libs/ui/src/lib/i18n.ts 54 @@ -4097,7 +4097,7 @@ Commodity - Commodity + Matèries primeres libs/ui/src/lib/i18n.ts 55 @@ -4105,7 +4105,7 @@ Equity - Equity + Renda variable libs/ui/src/lib/i18n.ts 56 @@ -4113,7 +4113,7 @@ Fixed Income - Fixed Income + Renda fixa libs/ui/src/lib/i18n.ts 57 @@ -4121,7 +4121,7 @@ Liquidity - Liquidity + Liquiditat libs/ui/src/lib/i18n.ts 58 @@ -4129,7 +4129,7 @@ Real Estate - Real Estate + Immobiliari libs/ui/src/lib/i18n.ts 59 @@ -7658,7 +7658,7 @@ Cancel - Cancel + Cancel·la apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html 165 @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Detall de les desviacions + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + No es poden conciliar els valors dels comptes, les posicions i l’efectiu. La comparació d’assignacions no està disponible. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Crea un objectiu per comparar l’assignació actual dels actius amb l’assignació desitjada. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Objectiu: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Moderat (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Desviació total de l’assignació + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Objectius + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Actual + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Encara no hi ha cap objectiu configurat + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Comparació del compte seleccionat amb l’objectiu global de la cartera. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Desviació permesa + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Desviació permesa: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Agressiu (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Fora de tolerància + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Conservador (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + S’està carregant l’assignació de la cartera… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Algunes posicions no tenen una classificació per classe d’actiu. L’assignació mostrada és incompleta. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Els saldos d’efectiu negatius, les posicions curtes i els passius poden ser dades financeres vàlides, però aquesta versió de la comparació d’assignacions no els admet. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (simplificat) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Objectiu + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Cada percentatge ha d’estar entre 0 i 100, i el total ha de ser del 100%. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Desa l’objectiu + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Valor de la cartera + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Desviació màxima + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Dins de tolerància + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + La cartera seleccionada és buida. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Assignació actual i objectiu + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + No es pot calcular l’assignació actual amb les dades o els permisos disponibles. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Desviació: punts percentuals + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Tots els comptes + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Assignació inicial + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Actual: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Personalitzat + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Classe d’actiu + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + Les preconfiguracions són punts de partida. Modifica els percentatges per personalitzar l’objectiu. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Configura l’objectiu + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Prudent (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Sense classificar + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Actual: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + No s’ha pogut desar l’objectiu. Torna-ho a provar. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Desviació + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Configura l’objectiu + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 0f3c89b207..c8bf5b0f31 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Abweichungen im Detail + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Kontowerte, Positionen und Barbestände lassen sich nicht abstimmen. Der Allokationsvergleich ist nicht verfügbar. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Erstelle ein Ziel, um die aktuelle Vermögensaufteilung mit der gewünschten Aufteilung zu vergleichen. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Ziel: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Moderat (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Gesamte Allokationsabweichung + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Ziele + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Ist + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Noch kein Ziel konfiguriert + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Das ausgewählte Konto wird mit dem globalen Portfolioziel verglichen. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Zulässige Abweichung + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Zulässige Abweichung: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Aggressiv (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Außerhalb der Toleranz + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Konservativ (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Portfolioallokation wird geladen… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Einige Positionen haben keine Anlageklasse. Die angezeigte Allokation ist unvollständig. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Negative Barbestände, Short-Positionen und Verbindlichkeiten können gültige Finanzdaten sein, werden aber von dieser Version des Allokationsvergleichs nicht unterstützt. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (vereinfacht) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Ziel + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Jeder Prozentsatz muss zwischen 0 und 100 liegen und die Summe muss 100 % ergeben. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Ziel speichern + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Portfoliowert + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Maximale Abweichung + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Innerhalb der Toleranz + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + Das ausgewählte Portfolio ist leer. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Ist- und Zielallokation + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + Die aktuelle Allokation kann mit den verfügbaren Daten oder Berechtigungen nicht berechnet werden. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Abweichung: Prozentpunkte + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Alle Konten + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Ausgangsallokation + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Ist: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Benutzerdefiniert + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Anlageklasse + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + Die Vorlagen dienen als Ausgangspunkt. Passe die Prozentsätze an dein Ziel an. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Ziel konfigurieren + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Vorsichtig (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Nicht klassifiziert + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Ist: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Das Ziel konnte nicht gespeichert werden. Bitte versuche es erneut. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Abweichung + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Ziel konfigurieren + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index 6e0634f1ea..7106f00ee6 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -9880,6 +9880,370 @@ 170 + + Deviation details + Detalle de las desviaciones + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + No se pueden conciliar los valores de las cuentas, las posiciones y el efectivo. La comparación de asignaciones no está disponible. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Crea un objetivo para comparar la asignación actual de activos con la deseada. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Objetivo: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Moderado (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Desviación total de la asignación + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Objetivos + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Actual + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Aún no hay ningún objetivo configurado + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Comparación de la cuenta seleccionada con el objetivo global de la cartera. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Desviación permitida + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Desviación permitida: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Agresivo (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Fuera de tolerancia + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Conservador (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Cargando la asignación de la cartera… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Algunas posiciones no tienen una clasificación por clase de activo. La asignación mostrada está incompleta. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Los saldos de efectivo negativos, las posiciones cortas y los pasivos pueden ser datos financieros válidos, pero esta versión de la comparación de asignaciones no los admite. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (simplificado) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Objetivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Cada porcentaje debe estar entre 0 y 100, y el total debe ser del 100%. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Guardar objetivo + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Valor de la cartera + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Desviación máxima + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Dentro de tolerancia + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + La cartera seleccionada está vacía. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Asignación actual y objetivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + No se puede calcular la asignación actual con los datos o permisos disponibles. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Desviación: puntos porcentuales + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Todas las cuentas + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Asignación inicial + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Actual: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Personalizado + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Clase de activo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + Las asignaciones predefinidas son puntos de partida. Modifica los porcentajes para personalizar tu objetivo. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Configurar objetivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Cauto (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Sin clasificar + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Actual: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + No se ha podido guardar el objetivo. Inténtalo de nuevo. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Desviación + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Configurar objetivo + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index a63c1e8312..6cee7df7ba 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -6329,7 +6329,7 @@ Alternative Investment - Alternative Investment + Investissements alternatifs libs/ui/src/lib/i18n.ts 54 @@ -6337,7 +6337,7 @@ Commodity - Commodity + Matières premières libs/ui/src/lib/i18n.ts 55 @@ -6345,7 +6345,7 @@ Equity - Equity + Actions libs/ui/src/lib/i18n.ts 56 @@ -6353,7 +6353,7 @@ Fixed Income - Fixed Income + Revenu fixe libs/ui/src/lib/i18n.ts 57 @@ -6361,7 +6361,7 @@ Liquidity - Liquidity + Liquidités libs/ui/src/lib/i18n.ts 58 @@ -6369,7 +6369,7 @@ Real Estate - Real Estate + Immobilier libs/ui/src/lib/i18n.ts 59 @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Détail des écarts + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Les valeurs des comptes, les positions et la trésorerie ne peuvent pas être rapprochées. La comparaison des allocations est indisponible. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Créez un objectif pour comparer l’allocation actuelle des actifs à l’allocation souhaitée. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Objectif : + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Modéré (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Écart total d’allocation + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Objectifs + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Actuelle + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Aucun objectif configuré pour le moment + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Comparaison du compte sélectionné avec l’objectif global du portefeuille. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Écart autorisé + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Écart autorisé : + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Agressif (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Hors tolérance + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Conservateur (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Chargement de l’allocation du portefeuille… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Certaines positions ne sont rattachées à aucune classe d’actifs. L’allocation affichée est incomplète. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Les soldes de trésorerie négatifs, les positions courtes et les dettes peuvent être des données financières valides, mais cette version de la comparaison des allocations ne les prend pas en charge. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (simplifié) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Objectif + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Chaque pourcentage doit être compris entre 0 et 100, et le total doit être égal à 100 %. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Enregistrer l’objectif + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Valeur du portefeuille + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Écart maximal + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Dans la tolérance + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + Le portefeuille sélectionné est vide. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Allocation actuelle et cible + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + L’allocation actuelle ne peut pas être calculée avec les données ou les autorisations disponibles. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Écart : points de pourcentage + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Tous les comptes + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Allocation initiale + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Actuelle : + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Personnalisé + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Classe d’actifs + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + Les allocations prédéfinies sont des points de départ. Modifiez les pourcentages pour personnaliser votre objectif. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Configurer l’objectif + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Prudent (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Non classé + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Actuelle : () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Impossible d’enregistrer l’objectif. Veuillez réessayer. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Écart + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Configurer l’objectif + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index 594517fee0..06c623fc08 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -6330,7 +6330,7 @@ Alternative Investment - Alternative Investment + Investimenti alternativi libs/ui/src/lib/i18n.ts 54 @@ -6338,7 +6338,7 @@ Commodity - Commodity + Materie prime libs/ui/src/lib/i18n.ts 55 @@ -6346,7 +6346,7 @@ Equity - Equity + Azioni libs/ui/src/lib/i18n.ts 56 @@ -6354,7 +6354,7 @@ Fixed Income - Fixed Income + Reddito fisso libs/ui/src/lib/i18n.ts 57 @@ -6362,7 +6362,7 @@ Liquidity - Liquidity + Liquidità libs/ui/src/lib/i18n.ts 58 @@ -6370,7 +6370,7 @@ Real Estate - Real Estate + Immobiliare libs/ui/src/lib/i18n.ts 59 @@ -9880,6 +9880,370 @@ 170 + + Deviation details + Dettaglio degli scostamenti + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Non è possibile riconciliare i valori dei conti, le posizioni e la cassa. Il confronto delle allocazioni non è disponibile. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Crea un obiettivo per confrontare l’allocazione attuale con quella desiderata. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Obiettivo: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Moderato (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Scostamento totale + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Obiettivi + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Attuale + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Nessun obiettivo configurato + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Confronto del conto selezionato con l’obiettivo globale del portafoglio. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Scostamento consentito + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Scostamento consentito: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Aggressivo (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Fuori tolleranza + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Conservativo (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Caricamento dell’allocazione del portafoglio… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Alcune posizioni non hanno una classificazione per classe di attivo. L’allocazione riportata è incompleta. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Saldi di cassa negativi, posizioni corte e passività possono essere dati finanziari validi, ma non sono supportati da questa versione del confronto delle allocazioni. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (semplificato) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Obiettivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Ogni percentuale deve essere compresa tra 0 e 100 e il totale deve essere pari al 100%. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Salva obiettivo + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Valore del portafoglio + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Scostamento massimo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Entro la tolleranza + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + Il portafoglio selezionato è vuoto. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Allocazione attuale e obiettivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + Non è possibile calcolare l’allocazione attuale con i dati o i permessi disponibili. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Scostamento: punti percentuali + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Tutti i conti + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Allocazione iniziale + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Attuale: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Personalizzato + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Classe di attivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + I preset sono punti di partenza. Modifica le percentuali per personalizzare il tuo obiettivo. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Configura obiettivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Prudente (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Non classificato + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Attuale: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Impossibile salvare l’obiettivo. Riprova. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Scostamento + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Configura obiettivo + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.ja.xlf b/apps/client/src/locales/messages.ja.xlf index 549a813144..d4a3eef594 100644 --- a/apps/client/src/locales/messages.ja.xlf +++ b/apps/client/src/locales/messages.ja.xlf @@ -3737,7 +3737,7 @@ Alternative Investment - Alternative Investment + オルタナティブ投資 libs/ui/src/lib/i18n.ts 54 @@ -3745,7 +3745,7 @@ Commodity - Commodity + コモディティ libs/ui/src/lib/i18n.ts 55 @@ -3753,7 +3753,7 @@ Equity - Equity + 株式 libs/ui/src/lib/i18n.ts 56 @@ -3761,7 +3761,7 @@ Fixed Income - Fixed Income + 債券 libs/ui/src/lib/i18n.ts 57 @@ -3769,7 +3769,7 @@ Liquidity - Liquidity + 流動性資産 libs/ui/src/lib/i18n.ts 58 @@ -3777,7 +3777,7 @@ Real Estate - Real Estate + 不動産 libs/ui/src/lib/i18n.ts 59 @@ -9880,6 +9880,370 @@ 122 + + Deviation details + 乖離の詳細 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + 口座の評価額、保有資産、現金の整合性を確認できません。配分比較を利用できません。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + 目標を作成して、現在の資産配分と希望する配分を比較しましょう。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + 目標: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + 中庸型(60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + 配分の総乖離 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + 目標配分 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + 現在 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + 目標配分はまだ設定されていません + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + 選択した口座をポートフォリオ全体の目標配分と比較しています。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + 許容乖離 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + 許容乖離: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + 積極型(80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + 許容範囲外 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + 保守型(40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + ポートフォリオの配分を読み込み中… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + 資産クラスが設定されていない保有資産があります。表示される配分は不完全です。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + 現金残高が負の場合、ショートポジションや負債がある場合も、財務データとして有効なことがありますが、このバージョンの配分比較では対応していません。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + ゴールデン・バタフライ(簡略版) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + 目標 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + 各比率は0から100の範囲にし、合計を100%にする必要があります。 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + 目標を保存 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + ポートフォリオの評価額 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + 最大乖離 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + 許容範囲内 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + 選択したポートフォリオは空です。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + 現在の配分と目標配分 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + 利用可能なデータまたは権限では、現在の配分を計算できません。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + 乖離:パーセントポイント + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + すべての口座 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + 初期配分 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + 現在: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + カスタム + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + 資産クラス + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + プリセットは出発点です。各比率を編集して目標配分を調整してください。 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + 目標配分を設定 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + 慎重型(20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + 未分類 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + 現在:() + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + 目標を保存できませんでした。もう一度お試しください。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + 乖離 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + 目標配分を設定 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.ko.xlf b/apps/client/src/locales/messages.ko.xlf index 61dbadccec..b56c007c7e 100644 --- a/apps/client/src/locales/messages.ko.xlf +++ b/apps/client/src/locales/messages.ko.xlf @@ -3737,7 +3737,7 @@ Alternative Investment - Alternative Investment + 대체 투자 libs/ui/src/lib/i18n.ts 54 @@ -3745,7 +3745,7 @@ Commodity - Commodity + 원자재 libs/ui/src/lib/i18n.ts 55 @@ -3753,7 +3753,7 @@ Equity - Equity + 주식 libs/ui/src/lib/i18n.ts 56 @@ -3761,7 +3761,7 @@ Fixed Income - Fixed Income + 채권 libs/ui/src/lib/i18n.ts 57 @@ -3769,7 +3769,7 @@ Liquidity - Liquidity + 유동성 libs/ui/src/lib/i18n.ts 58 @@ -3777,7 +3777,7 @@ Real Estate - Real Estate + 부동산 libs/ui/src/lib/i18n.ts 59 @@ -9880,6 +9880,370 @@ 122 + + Deviation details + 편차 상세 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + 계좌 평가액, 보유 자산 및 현금의 합계를 일치시킬 수 없습니다. 비중 비교를 사용할 수 없습니다. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + 목표를 만들어 현재 자산 비중과 원하는 비중을 비교하세요. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + 목표: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + 중립형 (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + 전체 비중 편차 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + 목표 비중 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + 현재 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + 아직 설정된 목표가 없습니다 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + 선택한 계좌를 포트폴리오 전체의 목표 비중과 비교합니다. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + 허용 편차 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + 허용 편차: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + 공격형 (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + 허용 범위 초과 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + 보수형 (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + 포트폴리오 비중을 불러오는 중… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + 일부 보유 자산에 자산군이 지정되지 않았습니다. 표시된 비중은 불완전합니다. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + 마이너스 현금 잔액, 공매도 포지션 및 부채는 유효한 재무 데이터일 수 있지만, 이 버전의 비중 비교에서는 지원하지 않습니다. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + 골든 버터플라이 (단순화) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + 목표 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + 각 비율은 0에서 100 사이여야 하며 합계는 100%여야 합니다. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + 목표 저장 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + 포트폴리오 가치 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + 최대 편차 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + 허용 범위 이내 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + 선택한 포트폴리오가 비어 있습니다. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + 현재 비중과 목표 비중 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + 현재 이용 가능한 데이터 또는 권한으로는 현재 비중을 계산할 수 없습니다. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + 편차: 퍼센트포인트 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + 모든 계좌 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + 초기 비중 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + 현재: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + 사용자 지정 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + 자산군 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + 사전 설정은 시작점입니다. 각 비율을 수정하여 목표 비중을 조정하세요. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + 목표 설정 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + 신중형 (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + 미분류 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + 현재: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + 목표를 저장하지 못했습니다. 다시 시도해 주세요. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + 편차 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + 목표 설정 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index af3dc7dfe9..edc5e50f71 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -6329,7 +6329,7 @@ Alternative Investment - Alternative Investment + Alternatieve beleggingen libs/ui/src/lib/i18n.ts 54 @@ -6337,7 +6337,7 @@ Commodity - Commodity + Grondstoffen libs/ui/src/lib/i18n.ts 55 @@ -6345,7 +6345,7 @@ Equity - Equity + Aandelen libs/ui/src/lib/i18n.ts 56 @@ -6353,7 +6353,7 @@ Fixed Income - Fixed Income + Vastrentende waarden libs/ui/src/lib/i18n.ts 57 @@ -6361,7 +6361,7 @@ Liquidity - Liquidity + Liquiditeit libs/ui/src/lib/i18n.ts 58 @@ -6369,7 +6369,7 @@ Real Estate - Real Estate + Vastgoed libs/ui/src/lib/i18n.ts 59 @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Details van afwijkingen + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Rekeningwaarden, posities en kasmiddelen kunnen niet met elkaar worden afgestemd. De allocatievergelijking is niet beschikbaar. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Maak een doel om de huidige vermogensverdeling met de gewenste verdeling te vergelijken. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Doel: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Gematigd (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Totale allocatieafwijking + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Doelen + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Huidig + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Er is nog geen doel ingesteld + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + De geselecteerde rekening wordt vergeleken met het globale portefeuilledoel. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Toegestane afwijking + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Toegestane afwijking: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Aggressief (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Buiten tolerantie + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Conservatief (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Portefeuilleverdeling wordt geladen… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Sommige posities hebben geen beleggingscategorie. De weergegeven verdeling is onvolledig. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Negatieve kassaldi, shortposities en schulden kunnen geldige financiële gegevens zijn, maar worden niet ondersteund door deze versie van de allocatievergelijking. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (vereenvoudigd) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Doel + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Elk percentage moet tussen 0 en 100 liggen en het totaal moet 100% zijn. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Doel opslaan + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Portefeuillewaarde + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Maximale afwijking + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Binnen tolerantie + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + De geselecteerde portefeuille is leeg. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Huidige en gewenste verdeling + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + De huidige verdeling kan niet worden berekend met de beschikbare gegevens of rechten. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Afwijking: procentpunt + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Alle rekeningen + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Beginverdeling + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Huidig: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Aangepast + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Beleggingscategorie + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + De vooraf ingestelde verdelingen zijn uitgangspunten. Pas de percentages aan om je doel in te stellen. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Doel instellen + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Voorzichtig (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Niet geclassificeerd + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Huidig: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Het doel kon niet worden opgeslagen. Probeer het opnieuw. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Afwijking + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Doel instellen + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index 8e0d27e5d5..ff532cad87 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -3704,7 +3704,7 @@ Alternative Investment - Alternative Investment + Inwestycje alternatywne libs/ui/src/lib/i18n.ts 54 @@ -3712,7 +3712,7 @@ Commodity - Commodity + Surowce libs/ui/src/lib/i18n.ts 55 @@ -3720,7 +3720,7 @@ Equity - Equity + Akcje libs/ui/src/lib/i18n.ts 56 @@ -3728,7 +3728,7 @@ Fixed Income - Fixed Income + Instrumenty dłużne libs/ui/src/lib/i18n.ts 57 @@ -3736,7 +3736,7 @@ Liquidity - Liquidity + Płynność libs/ui/src/lib/i18n.ts 58 @@ -3744,7 +3744,7 @@ Real Estate - Real Estate + Nieruchomości libs/ui/src/lib/i18n.ts 59 @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Szczegóły odchyleń + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Nie można uzgodnić wartości rachunków, pozycji i gotówki. Porównanie alokacji jest niedostępne. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Utwórz cel, aby porównać bieżącą alokację aktywów z alokacją docelową. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Docelowa: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Umiarkowany (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Łączne odchylenie alokacji + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Cele + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Bieżąca + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Nie skonfigurowano jeszcze celu + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Porównanie wybranego rachunku z globalną alokacją docelową portfela. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Dopuszczalne odchylenie + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Dopuszczalne odchylenie: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Agresywny (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Poza tolerancją + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Konserwatywny (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Ładowanie alokacji portfela… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Niektóre pozycje nie mają przypisanej klasy aktywów. Wyświetlana alokacja jest niepełna. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Ujemne salda gotówkowe, pozycje krótkie i zobowiązania mogą stanowić prawidłowe dane finansowe, ale ta wersja porównania alokacji ich nie obsługuje. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (uproszczony) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Docelowa + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Każda wartość procentowa musi mieścić się w zakresie od 0 do 100, a suma musi wynosić 100%. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Zapisz cel + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Wartość portfela + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Maksymalne odchylenie + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + W granicach tolerancji + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + Wybrany portfel jest pusty. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Alokacja bieżąca i docelowa + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + Nie można obliczyć bieżącej alokacji przy dostępnych danych lub uprawnieniach. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Odchylenie: p.p. + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Wszystkie rachunki + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Alokacja początkowa + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Bieżąca: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Własna + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Klasa aktywów + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + Gotowe alokacje są punktem wyjścia. Zmień wartości procentowe, aby dostosować cel. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Skonfiguruj cel + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Ostrożny (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Niesklasyfikowane + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Bieżąca: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Nie udało się zapisać celu. Spróbuj ponownie. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Odchylenie + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Skonfiguruj cel + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index 48e9955899..b9f0b80912 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -6329,7 +6329,7 @@ Alternative Investment - Alternative Investment + Investimentos alternativos libs/ui/src/lib/i18n.ts 54 @@ -6337,7 +6337,7 @@ Commodity - Commodity + Matérias-primas libs/ui/src/lib/i18n.ts 55 @@ -6345,7 +6345,7 @@ Equity - Equity + Ações libs/ui/src/lib/i18n.ts 56 @@ -6353,7 +6353,7 @@ Fixed Income - Fixed Income + Rendimento fixo libs/ui/src/lib/i18n.ts 57 @@ -6361,7 +6361,7 @@ Liquidity - Liquidity + Liquidez libs/ui/src/lib/i18n.ts 58 @@ -6369,7 +6369,7 @@ Real Estate - Real Estate + Imobiliário libs/ui/src/lib/i18n.ts 59 @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Detalhes dos desvios + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Não é possível reconciliar os valores das contas, as posições e o caixa. A comparação de alocações não está disponível. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Crie um objetivo para comparar a alocação atual dos ativos com a pretendida. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Objetivo: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Moderado (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Desvio total da alocação + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Objetivos + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Atual + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Ainda não foi configurado nenhum objetivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Comparação da conta selecionada com o objetivo global da carteira. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Desvio permitido + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Desvio permitido: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Agressivo (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Fora da tolerância + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Conservador (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + A carregar a alocação da carteira… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Algumas posições não têm uma classe de ativos atribuída. A alocação apresentada está incompleta. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Saldos de caixa negativos, posições curtas e passivos podem ser dados financeiros válidos, mas não são suportados por esta versão da comparação de alocações. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (simplificado) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Objetivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Cada percentagem deve estar entre 0 e 100 e o total deve ser igual a 100%. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Guardar objetivo + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Valor da carteira + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Desvio máximo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Dentro da tolerância + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + A carteira selecionada está vazia. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Alocação atual e objetivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + Não é possível calcular a alocação atual com os dados ou as permissões disponíveis. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Desvio: pontos percentuais + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Todas as contas + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Alocação inicial + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Atual: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Personalizado + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Classe de ativos + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + As alocações predefinidas são pontos de partida. Edite as percentagens para personalizar o seu objetivo. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Configurar objetivo + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Cauteloso (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Não classificado + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Atual: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Não foi possível guardar o objetivo. Tente novamente. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Desvio + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Configurar objetivo + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index 17f5ee66c2..49ab3ff1a1 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Sapma ayrıntıları + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Hesap değerleri, pozisyonlar ve nakit tutarları uzlaştırılamıyor. Dağılım karşılaştırması kullanılamıyor. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Mevcut varlık dağılımını istediğiniz dağılımla karşılaştırmak için bir hedef oluşturun. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Hedef: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Orta riskli (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Toplam dağılım sapması + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Hedefler + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Mevcut + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Henüz bir hedef yapılandırılmadı + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Seçili hesap, portföyün genel hedef dağılımıyla karşılaştırılıyor. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + İzin verilen sapma + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + İzin verilen sapma: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Agresif (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Tolerans dışında + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Muhafazakâr (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Portföy dağılımı yükleniyor… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Bazı pozisyonların varlık sınıfı belirtilmemiş. Gösterilen dağılım eksik. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Negatif nakit bakiyeleri, kısa pozisyonlar ve borçlar geçerli finansal veriler olabilir, ancak dağılım karşılaştırmasının bu sürümünde desteklenmez. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (basitleştirilmiş) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Hedef + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Her yüzde 0 ile 100 arasında olmalı ve toplam %100 olmalıdır. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Hedefi kaydet + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Portföy değeri + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + En büyük sapma + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + Tolerans içinde + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + Seçili portföy boş. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Mevcut ve hedef dağılım + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + Mevcut veri veya izinlerle güncel dağılım hesaplanamıyor. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Sapma: yüzde puanı + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Tüm hesaplar + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Başlangıç dağılımı + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Mevcut: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Özel + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Varlık sınıfı + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + Hazır dağılımlar bir başlangıç noktasıdır. Hedefinizi özelleştirmek için yüzdeleri düzenleyin. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Hedefi yapılandır + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Temkinli (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Sınıflandırılmamış + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Mevcut: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Hedef kaydedilemedi. Lütfen tekrar deneyin. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Sapma + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Hedefi yapılandır + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.uk.xlf b/apps/client/src/locales/messages.uk.xlf index 446fba7f5e..e96de357d1 100644 --- a/apps/client/src/locales/messages.uk.xlf +++ b/apps/client/src/locales/messages.uk.xlf @@ -4409,7 +4409,7 @@ Alternative Investment - Alternative Investment + Альтернативні інвестиції libs/ui/src/lib/i18n.ts 54 @@ -4417,7 +4417,7 @@ Commodity - Commodity + Сировинні товари libs/ui/src/lib/i18n.ts 55 @@ -4425,7 +4425,7 @@ Equity - Equity + Акції libs/ui/src/lib/i18n.ts 56 @@ -4433,7 +4433,7 @@ Fixed Income - Fixed Income + Інструменти з фіксованим доходом libs/ui/src/lib/i18n.ts 57 @@ -4441,7 +4441,7 @@ Liquidity - Liquidity + Ліквідність libs/ui/src/lib/i18n.ts 58 @@ -4449,7 +4449,7 @@ Real Estate - Real Estate + Нерухомість libs/ui/src/lib/i18n.ts 59 @@ -9879,6 +9879,370 @@ 170 + + Deviation details + Докладні відхилення + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + Не вдається узгодити вартість рахунків, позицій і коштів. Порівняння розподілів недоступне. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + Створіть ціль, щоб порівняти поточний розподіл активів із бажаним. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + Цільова: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + Помірний (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + Загальне відхилення розподілу + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + Цілі + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + Поточна + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + Ціль ще не налаштовано + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + Порівняння вибраного рахунку із загальним цільовим розподілом портфеля. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + Допустиме відхилення + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + Допустиме відхилення: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + Агресивний (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + Поза межами допуску + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + Консервативний (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + Завантаження розподілу портфеля… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + Деякі позиції не мають класу активів. Показаний розподіл є неповним. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + Від’ємні залишки коштів, короткі позиції та зобов’язання можуть бути коректними фінансовими даними, але ця версія порівняння розподілів їх не підтримує. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + Golden Butterfly (спрощений) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + Цільова + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + Кожне значення має бути від 0 до 100, а сума має дорівнювати 100%. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + Зберегти ціль + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + Вартість портфеля + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + Максимальне відхилення + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + У межах допуску + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + Вибраний портфель порожній. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + Поточний і цільовий розподіл + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + Неможливо обчислити поточний розподіл із доступними даними або дозволами. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + Відхилення (в. п.): + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + Усі рахунки + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + Початковий розподіл + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + Поточна: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + Власний + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + Клас активів + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + Готові розподіли є початковими варіантами. Змініть відсотки, щоб налаштувати свою ціль. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + Налаштувати ціль + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + Обережний (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + Не класифіковано + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + Поточна: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + Не вдалося зберегти ціль. Спробуйте ще раз. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + Відхилення + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + Налаштувати ціль + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index c62e56b18d..5fc835dd93 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -8928,6 +8928,328 @@ 122 + + Deviation details + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index e1b2dc1d6a..1e77ed79ff 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -9880,6 +9880,370 @@ 170 + + Deviation details + 偏差明细 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 202 + + + + Account values, holdings and cash cannot be reconciled. The allocation comparison is unavailable. + 账户价值、持仓与现金无法核对一致,资产配置比较不可用。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 92 + + + + Create a target to compare the actual asset allocation with your desired allocation. + 创建目标,将当前资产配置与期望配置进行比较。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 60 + + + + Target: + 目标: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 185 + + + + Moderate (60/40) + 稳健型(60/40) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 13 + + + + Total allocation drift + 配置总偏差 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 123 + + + + Targets + 目标配置 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 2 + + + apps/client/src/app/pages/portfolio/targets/targets-page.routes.ts + 12 + + + libs/common/src/lib/routes/routes.ts + 220 + + + + Actual + 实际 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 154 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 210 + + + + No target configured yet + 尚未配置目标 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 15 + + + + Comparing the selected account with the global portfolio target. + 正在将所选账户与整个投资组合的目标配置进行比较。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 45 + + + + Allowed deviation + 允许偏差 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 54 + + + + Allowed deviation: + 允许偏差: + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 10 + + + + Aggressive (80/20) + 进取型(80/20) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 15 + + + + Outside tolerance + 超出容差 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 188 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 233 + + + + Conservative (40/60) + 保守型(40/60) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 11 + + + + Loading portfolio allocation… + 正在加载投资组合配置… + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 66 + + + + Some holdings have no asset classification. The reported allocation is incomplete. + 部分持仓未指定资产类别,显示的配置不完整。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 100 + + + + Negative cash balances, short positions and liabilities can be valid financial data, but are not supported by this version of the allocation comparison. + 负现金余额、空头头寸和负债可能是有效的财务数据,但此版本的资产配置比较尚不支持。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 82 + + + + Golden Butterfly (simplified) + 黄金蝴蝶(简化版) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 16 + + + + Target + 目标 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 158 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 211 + + + + Each percentage must be between 0 and 100, and the total must equal 100%. + 每项百分比必须在0到100之间,且总和必须为100%。 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 71 + + + + Save target + 保存目标 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 81 + + + + Portfolio value + 投资组合价值 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 108 + + + + Maximum deviation + 最大偏差 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 134 + + + + Within tolerance + 在容差范围内 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 189 + + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 235 + + + + The selected portfolio is empty. + 所选投资组合为空。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 77 + + + + Actual vs target allocation + 实际配置与目标配置 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 144 + + + + The current allocation cannot be calculated with the available data or permissions. + 无法根据现有数据或权限计算当前配置。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 71 + + + + Deviation: percentage points + 偏差:个百分点 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 186 + + + + All accounts + 所有账户 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 37 + + + + Starting allocation + 初始配置 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 5 + + + + Actual: + 实际: + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 184 + + + + Custom + 自定义 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 13 + + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 43 + + + + Asset class + 资产类别 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 209 + + + + Presets are starting points. Edit any percentage to customize your target. + 预设配置仅作为起点。修改各项百分比以自定义目标。 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 17 + + + + Configure target + 配置目标 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 25 + + + + Cautious (20/80) + 谨慎型(20/80) + + apps/client/src/app/pages/portfolio/targets/target-presets.ts + 9 + + + + Unclassified + 未分类 + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 151 + + + + Actual: () + 实际:() + + apps/client/src/app/pages/portfolio/targets/targets-page.component.ts + 183 + + + + The target could not be saved. Please try again. + 无法保存目标,请重试。 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 52 + + + + Deviation + 偏差 + + apps/client/src/app/pages/portfolio/targets/targets-page.html + 212 + + + + Configure target + 配置目标 + + apps/client/src/app/pages/portfolio/targets/target-configuration-dialog.component.html + 1 + + diff --git a/apps/client/src/styles.scss b/apps/client/src/styles.scss index fd843c65db..3c806a177f 100644 --- a/apps/client/src/styles.scss +++ b/apps/client/src/styles.scss @@ -494,6 +494,18 @@ ngx-skeleton-loader { } } +// Tooltips render in the global overlay, outside the Targets component. +.targets-allocation-tooltip .mat-mdc-tooltip-surface { + max-width: min(22rem, calc(100vw - 2rem)); + white-space: pre-line; + text-align: left; + line-height: 1.55; + + &::first-line { + font-weight: 600; + } +} + .svgMap-tooltip { border-bottom: none; diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index 23ec74cc89..f90933831b 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -178,6 +178,7 @@ export const DEFAULT_REDACTED_PATHS = [ 'settings.emergencyFund', 'settings.projectedTotalAmount', 'settings.savingsRate', + 'summary.accountCashInBaseCurrency', 'totalBalanceInBaseCurrency', 'totalDividendInBaseCurrency', 'totalInterestInBaseCurrency', diff --git a/libs/common/src/lib/dtos/update-user-setting.dto.ts b/libs/common/src/lib/dtos/update-user-setting.dto.ts index b51d8bb61b..d46b6fbe0b 100644 --- a/libs/common/src/lib/dtos/update-user-setting.dto.ts +++ b/libs/common/src/lib/dtos/update-user-setting.dto.ts @@ -1,4 +1,8 @@ -import { XRayRulesSettings } from '@ghostfolio/common/interfaces'; +import { + PortfolioTargetsSettings, + XRayRulesSettings +} from '@ghostfolio/common/interfaces'; +import { isValidPortfolioTargetsSettings } from '@ghostfolio/common/portfolio-targets/portfolio-targets-validation'; import type { ColorScheme, DateRange, @@ -15,7 +19,9 @@ import { IsIn, IsNumber, IsOptional, - IsString + IsString, + ValidateBy, + ValidateIf } from 'class-validator'; import { eachYearOfInterval, format } from 'date-fns'; @@ -105,6 +111,18 @@ export class UpdateUserSettingDto { @IsOptional() performanceCalculationType?: PerformanceCalculationType; + /** Desired asset-class allocation and tolerance for the global portfolio. */ + @ValidateIf((_object, value: unknown) => value !== undefined) + @ValidateBy({ + name: 'isValidPortfolioTargetsSettings', + validator: { + validate: isValidPortfolioTargetsSettings, + defaultMessage: () => + 'portfolioTargets must contain one valid global target allocation' + } + }) + portfolioTargets?: PortfolioTargetsSettings; + /** * The target financial amount the user aims to reach before retiring. * Can be explicitly set to null to clear the value and calculate it dynamically. diff --git a/libs/common/src/lib/interfaces/index.ts b/libs/common/src/lib/interfaces/index.ts index dfd20f118f..d6d1287ce2 100644 --- a/libs/common/src/lib/interfaces/index.ts +++ b/libs/common/src/lib/interfaces/index.ts @@ -35,6 +35,7 @@ import type { PortfolioDetails } from './portfolio-details.interface'; import type { PortfolioPerformance } from './portfolio-performance.interface'; import type { PortfolioPosition } from './portfolio-position.interface'; import type { PortfolioReportRule } from './portfolio-report-rule.interface'; +import type { PortfolioTargetProfile, PortfolioTargetsSettings } from './portfolio-targets.interface'; import type { PortfolioSummary } from './portfolio-summary.interface'; import type { Product } from './product.interface'; import type { ReferralPartner } from './referral-partner.interface'; @@ -197,6 +198,8 @@ export { PortfolioReportResponse, PortfolioReportRule, PortfolioSummary, + PortfolioTargetProfile, + PortfolioTargetsSettings, Product, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, diff --git a/libs/common/src/lib/interfaces/portfolio-summary.interface.ts b/libs/common/src/lib/interfaces/portfolio-summary.interface.ts index d9bd435b1b..9a9af922ef 100644 --- a/libs/common/src/lib/interfaces/portfolio-summary.interface.ts +++ b/libs/common/src/lib/interfaces/portfolio-summary.interface.ts @@ -2,6 +2,13 @@ import { FireWealth } from './fire-wealth.interface'; import { PortfolioPerformance } from './portfolio-performance.interface'; export interface PortfolioSummary extends PortfolioPerformance { + /** + * Independently converted account balances in the user's base currency, + * before emergency-fund adjustments. Follows account selection and excludes + * accounts excluded from analysis; does not follow asset/symbol/tag filters. + * Absent on older servers and null when financial values are masked. + */ + accountCashInBaseCurrency?: number | null; activityCount: number; annualizedPerformancePercent: number; annualizedPerformancePercentWithCurrencyEffect: number; diff --git a/libs/common/src/lib/interfaces/portfolio-targets.interface.ts b/libs/common/src/lib/interfaces/portfolio-targets.interface.ts new file mode 100644 index 0000000000..8c06f90737 --- /dev/null +++ b/libs/common/src/lib/interfaces/portfolio-targets.interface.ts @@ -0,0 +1,21 @@ +import { AssetClass } from '@ghostfolio/prisma/enums'; + +/** + * The first release uses a single global profile. The collection supports + * future account-specific profiles without changing the persisted shape. + */ +export interface PortfolioTargetProfile { + id: string; + name: string; + presetId?: string; + /** Fractions in [0, 1]; the complete allocation must sum to 1. */ + allocations: Record; + /** Maximum absolute drift per asset class, as a fraction (0.05 = 5%). */ + tolerance: number; +} + +export interface PortfolioTargetsSettings { + version: 1; + activeProfileId: string; + profiles: PortfolioTargetProfile[]; +} diff --git a/libs/common/src/lib/interfaces/user-settings.interface.ts b/libs/common/src/lib/interfaces/user-settings.interface.ts index b093314d79..af0cda9ef8 100644 --- a/libs/common/src/lib/interfaces/user-settings.interface.ts +++ b/libs/common/src/lib/interfaces/user-settings.interface.ts @@ -1,3 +1,4 @@ +import { PortfolioTargetsSettings } from './portfolio-targets.interface'; import { XRayRulesSettings } from '@ghostfolio/common/interfaces/x-ray-rules-settings.interface'; import { ColorScheme, @@ -27,6 +28,7 @@ export interface UserSettings { language?: string; locale?: string; performanceCalculationType?: PerformanceCalculationType; + portfolioTargets?: PortfolioTargetsSettings; projectedTotalAmount?: number; retirementDate?: string; safeWithdrawalRate?: number; diff --git a/libs/common/src/lib/portfolio-targets/portfolio-targets-calculator.spec.ts b/libs/common/src/lib/portfolio-targets/portfolio-targets-calculator.spec.ts new file mode 100644 index 0000000000..3023975d16 --- /dev/null +++ b/libs/common/src/lib/portfolio-targets/portfolio-targets-calculator.spec.ts @@ -0,0 +1,696 @@ +import { PortfolioDetails } from '@ghostfolio/common/interfaces'; +import { AssetClass, AssetSubClass } from '@ghostfolio/prisma/enums'; + +import { + calculatePortfolioTargets, + isValidPortfolioTarget +} from './portfolio-targets-calculator'; + +const allocations = { + [AssetClass.ALTERNATIVE_INVESTMENT]: 0, + [AssetClass.COMMODITY]: 0, + [AssetClass.EQUITY]: 0.6, + [AssetClass.FIXED_INCOME]: 0.4, + [AssetClass.LIQUIDITY]: 0, + [AssetClass.REAL_ESTATE]: 0 +}; + +function makeDetails({ + cash = 0, + equity = 0, + bonds = 0 +}: { + cash?: number; + equity?: number; + bonds?: number; +}): Pick { + const holdings = [ + ...(equity !== 0 + ? [ + { + assetProfile: { assetClass: AssetClass.EQUITY }, + valueInBaseCurrency: equity + } + ] + : []), + ...(bonds !== 0 + ? [ + { + assetProfile: { assetClass: AssetClass.FIXED_INCOME }, + valueInBaseCurrency: bonds + } + ] + : []) + ] as PortfolioDetails['holdings']; + + return { + accounts: { + example: { + balance: cash, + currency: 'EUR', + name: 'Example', + valueInBaseCurrency: cash + equity + bonds + } + }, + holdings, + summary: { + accountCashInBaseCurrency: cash, + cash, + emergencyFund: { cash: 0 }, + filteredValueInBaseCurrency: equity + bonds, + liabilitiesInBaseCurrency: 0 + } as PortfolioDetails['summary'] + }; +} + +describe('Portfolio targets calculator', () => { + it('validates a complete 100% target and the tolerance', () => { + expect(isValidPortfolioTarget(allocations, 0.05)).toBe(true); + expect( + isValidPortfolioTarget({ ...allocations, [AssetClass.EQUITY]: 0.5 }, 0.05) + ).toBe(false); + expect(isValidPortfolioTarget(allocations, -0.01)).toBe(false); + }); + + it('reconciles account cash exactly once', () => { + const result = calculatePortfolioTargets({ + details: makeDetails({ equity: 600, bonds: 300, cash: 100 }), + targets: allocations, + tolerance: 0.05 + }); + + expect(result.status).toBe('ready'); + expect(result.totalValue).toBe(1000); + expect(result.accountCashValue).toBe(100); + expect( + result.rows.find(({ assetClass }) => assetClass === AssetClass.LIQUIDITY) + ?.actual + ).toBeCloseTo(0.1); + expect( + result.rows.find(({ assetClass }) => assetClass === AssetClass.EQUITY) + ?.actual + ).toBeCloseTo(0.6); + expect(result.outOfToleranceCount).toBe(2); + expect(result.totalDrift).toBeCloseTo(0.1); + }); + + it('handles a cash-only account', () => { + const result = calculatePortfolioTargets({ + details: makeDetails({ cash: 100 }), + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect( + result.rows.find(({ assetClass }) => assetClass === AssetClass.LIQUIDITY) + ?.actual + ).toBe(1); + }); + + it('does not fabricate allocations if values are redacted', () => { + const details = makeDetails({ equity: 100 }); + details.holdings[0].valueInBaseCurrency = undefined; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unavailable'); + }); + + it('rejects negative account-to-holdings residuals', () => { + const details = makeDetails({ equity: 100 }); + details.accounts.example.valueInBaseCurrency = 50; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('inconsistent'); + }); + + it('handles an empty portfolio', () => { + expect( + calculatePortfolioTargets({ + details: makeDetails({}), + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('empty'); + }); + it('does not misclassify an omitted snapshot position as cash', () => { + const details = makeDetails({ equity: 100, cash: 25 }); + details.holdings = []; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('inconsistent'); + expect(result.rows).toEqual([]); + }); + + it('requires independently verifiable cash and a snapshot total', () => { + const details = makeDetails({ equity: 100 }); + delete details.summary; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unavailable'); + }); + + it.each([-100, -0.0000000001])( + 'reports negative cash %s as unsupported, not inconsistent', + (cash) => { + const result = calculatePortfolioTargets({ + details: makeDetails({ equity: 200, cash }), + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('unsupported'); + expect(result.rows).toEqual([]); + } + ); + + it('does not hide a negative account balance with another account balance', () => { + const details = makeDetails({ equity: 200, cash: 100 }); + details.accounts.example.balance = -10; + details.accounts.other = { + balance: 110, + currency: 'EUR', + name: 'Other', + valueInBaseCurrency: 110 + }; + details.accounts.example.valueInBaseCurrency = 190; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unsupported'); + }); + + it('reports short holdings and liabilities as unsupported', () => { + const details = makeDetails({ equity: -100, cash: 200 }); + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unsupported'); + const liabilityDetails = makeDetails({ equity: 100 }); + liabilityDetails.summary.liabilitiesInBaseCurrency = 10; + expect( + calculatePortfolioTargets({ + details: liabilityDetails, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unsupported'); + }); + + it('reconciles securities-only portfolios including positions without an account', () => { + const details = makeDetails({ equity: 600, bonds: 400 }); + details.accounts = { + UNKNOWN: { ...details.accounts.example, currency: undefined } + }; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.accountCashValue).toBe(0); + expect(result.unclassifiedValue).toBe(0); + expect(result.totalDrift).toBe(0); + }); + + it('uses converted base-currency amounts rather than summing native balances', () => { + const details = makeDetails({ equity: 600, bonds: 300, cash: 100 }); + details.accounts = { + euro: { + balance: 20, + currency: 'EUR', + name: 'Euro', + valueInBaseCurrency: 620 + }, + dollar: { + balance: 100, + currency: 'USD', + name: 'Dollar', + valueInBaseCurrency: 380 + } + }; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.accountCashValue).toBe(100); + expect(result.totalValue).toBe(1000); + }); + + it('preserves cash reserved for an emergency fund', () => { + const details = makeDetails({ cash: 100 }); + details.summary.cash = 40; + details.summary.emergencyFund.cash = 60; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).accountCashValue + ).toBe(100); + }); + + it('shows unclassified holdings separately and applies the same tolerance', () => { + const details = makeDetails({ equity: 95, cash: 5 }); + details.holdings[0].assetProfile.assetClass = undefined; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 1 + }); + expect(result.status).toBe('ready'); + expect(result.unclassifiedValue).toBe(95); + expect( + result.rows.find(({ assetClass }) => assetClass === 'UNKNOWN')?.actual + ).toBe(0.95); + expect(result.outOfToleranceCount).toBe(0); + expect( + result.rows.reduce((sum, { actual }) => sum + actual, 0) + ).toBeCloseTo(1); + expect(result.totalDrift).toBeCloseTo(1); + }); + + it('permits only floating-point summation noise without normalizing values', () => { + const details = makeDetails({ equity: 0.1, bonds: 0.2 }); + details.accounts.example.valueInBaseCurrency = 0.3; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.accountCashValue).toBe(0); + details.accounts.example.valueInBaseCurrency -= 1e-10; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('inconsistent'); + }); + + it('does not treat a small but nonzero portfolio as empty', () => { + expect( + calculatePortfolioTargets({ + details: makeDetails({ cash: 1e-12 }), + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('ready'); + }); + + it('treats the tolerance boundary inclusively', () => { + const result = calculatePortfolioTargets({ + details: makeDetails({ equity: 650, bonds: 350 }), + targets: allocations, + tolerance: 0.05 + }); + expect(result.outOfToleranceCount).toBe(0); + }); + + it('treats redacted account values as unavailable', () => { + const details = makeDetails({ cash: 100 }); + details.accounts.example.valueInBaseCurrency = undefined; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unavailable'); + }); + function includeAccountCash( + details: ReturnType, + cash: number, + currency = 'USD' + ) { + details.holdings.push({ + assetProfile: { + assetClass: AssetClass.LIQUIDITY, + assetSubClass: AssetSubClass.CASH, + currency, + symbol: currency + }, + quantity: cash, + valueInBaseCurrency: cash + } as PortfolioDetails['holdings'][number]); + details.summary.filteredValueInBaseCurrency += cash; + return details; + } + + it.each([false, true])( + 'accepts summary cancellation for a 0.01 balance and 10000 fund (cash holding: %s)', + (withCashHolding) => { + const details = makeDetails({ cash: 0.01 }); + // Actual getSummary output: Big(0.01).minus(10000).toNumber(). + // The two serialized fields cannot reconstruct 0.01 exactly in binary. + details.summary.cash = -9999.99; + details.summary.emergencyFund.cash = 10000; + if (withCashHolding) { + includeAccountCash(details, 0.01); + } + + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + + expect(result.status).toBe('ready'); + expect(result.accountCashValue).toBe(0.01); + expect(result.totalValue).toBe(0.01); + expect( + result.rows.find( + ({ assetClass }) => assetClass === AssetClass.LIQUIDITY + )?.actual + ).toBe(1); + } + ); + + it('rejects a one-dollar cash discrepancy beside 1e15 in securities', () => { + const details = includeAccountCash( + makeDetails({ equity: 1e15, cash: 100 }), + 99 + ); + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + + expect(result.status).toBe('inconsistent'); + expect(result.rows).toEqual([]); + }); + + it.each( + [1e4, 1e15, 3e15, 1e16].flatMap((fund) => + [99, 100].map((cash) => ({ fund, cash })) + ) + )( + 'reconciles two accounts with fund $fund and synthetic cash $cash', + ({ fund, cash }) => { + const details = includeAccountCash( + makeDetails({ equity: 1e15, cash: 100 }), + cash + ); + details.accounts = { + securities: { + balance: 0, + currency: 'USD', + name: 'Securities', + valueInBaseCurrency: 1e15 + }, + cash: { + balance: 100, + currency: 'USD', + name: 'Cash', + valueInBaseCurrency: 100 + } + }; + details.summary.cash = 100 - fund; + details.summary.emergencyFund.cash = fund; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe(cash === 100 ? 'ready' : 'inconsistent'); + if (cash === 99) expect(result.rows).toEqual([]); + } + ); + + it.each([undefined, null, NaN, Infinity, -Infinity])( + 'requires finite independent cash (%s), without a legacy fallback', + (cash) => { + const details = makeDetails({ cash: 100 }); + details.summary.accountCashInBaseCurrency = cash; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unavailable'); + } + ); + + it('treats a legacy response without independent cash as unavailable', () => { + const details = makeDetails({ cash: 100 }); + delete details.summary.accountCashInBaseCurrency; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unavailable'); + }); + + it('does not depend on the adjusted summary fields', () => { + const details = makeDetails({ cash: 100 }); + delete details.summary.cash; + delete details.summary.emergencyFund; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('ready'); + }); + + it('keeps negative independent cash unsupported', () => { + const details = makeDetails({ equity: 100 }); + details.summary.accountCashInBaseCurrency = -1; + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('unsupported'); + }); + + it.each([0, 1])( + 'checks independently converted multi-currency cash with FX difference %s', + (difference) => { + const details = makeDetails({ equity: 600, cash: 100 }); + details.accounts = { + euro: { + balance: 20, + currency: 'EUR', + name: 'Euro', + valueInBaseCurrency: 640 + }, + dollar: { + balance: 60, + currency: 'USD', + name: 'Dollar', + valueInBaseCurrency: 60 + } + }; + includeAccountCash(details, 40 + difference, 'EUR'); + includeAccountCash(details, 60, 'USD'); + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe(difference ? 'inconsistent' : 'ready'); + } + ); + + it.each(['security', 'cash'])('rejects a duplicated %s holding', (kind) => { + const details = includeAccountCash( + makeDetails({ equity: 100, cash: 50 }), + 50 + ); + details.holdings.push({ ...details.holdings[kind === 'security' ? 0 : 1] }); + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('inconsistent'); + }); + + it('distinguishes a separately valued CASH instrument from synthetic account cash', () => { + const details = includeAccountCash( + makeDetails({ equity: 20, cash: 10 }), + 10 + ); + details.holdings[0].assetProfile = { + assetClass: AssetClass.LIQUIDITY, + assetSubClass: AssetSubClass.CASH, + currency: 'USD', + symbol: 'separate-cash-instrument' + } as PortfolioDetails['holdings'][number]['assetProfile']; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.accountCashValue).toBe(10); + expect(result.totalValue).toBe(30); + }); + + it('accepts coherent cash beside 1e15 in securities', () => { + const details = includeAccountCash( + makeDetails({ equity: 1e15, cash: 100 }), + 100 + ); + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('ready'); + }); + + it('does not apply a large emergency fund budget to missing securities', () => { + const details = includeAccountCash( + makeDetails({ equity: 1, cash: 0.01 }), + 0.01 + ); + details.summary.cash = -999999999999.99; + details.summary.emergencyFund.cash = 1e12; + // Emergency-fund adjustments must not affect any reconciliation budget. + details.holdings[0].valueInBaseCurrency -= 0.0001; + + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('inconsistent'); + }); + + it('reconciles the real queue snapshot without double-counting account cash', () => { + const details = includeAccountCash( + makeDetails({ equity: 600, bonds: 300, cash: 100 }), + 100 + ); + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.totalValue).toBe(1000); + expect(result.accountCashValue).toBe(100); + expect( + result.rows.find(({ assetClass }) => assetClass === AssetClass.LIQUIDITY) + ?.actual + ).toBeCloseTo(0.1); + expect(result.totalDrift).toBeCloseTo(0.1); + expect(result.outOfToleranceCount).toBe(2); + }); + + it('accepts a cash-only queue snapshot', () => { + const details = includeAccountCash(makeDetails({ cash: 250 }), 250); + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.totalValue).toBe(250); + expect( + result.rows.find(({ assetClass }) => assetClass === AssetClass.LIQUIDITY) + ?.actual + ).toBe(1); + }); + + it('reconciles multiple synthetic currency holdings by their base-currency values', () => { + const details = makeDetails({ equity: 600, cash: 100 }); + includeAccountCash(details, 40, 'EUR'); + includeAccountCash(details, 60, 'USD'); + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.totalValue).toBe(700); + expect(result.accountCashValue).toBe(100); + }); + + it('rejects incomplete cash positions even if an unrelated holding hides the difference', () => { + const details = includeAccountCash( + makeDetails({ equity: 600, cash: 100 }), + 50 + ); + details.holdings[0].valueInBaseCurrency = 650; + details.summary.filteredValueInBaseCurrency += 50; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('inconsistent'); + expect(result.rows).toEqual([]); + }); + + it('does not confuse a separately held cash instrument with an account balance', () => { + const details = makeDetails({ equity: 100, cash: 50 }); + details.holdings[0].assetProfile = { + assetClass: AssetClass.LIQUIDITY, + assetSubClass: AssetSubClass.CASH, + currency: 'USD', + symbol: 'synthetic-cash-instrument' + } as PortfolioDetails['holdings'][number]['assetProfile']; + const result = calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }); + expect(result.status).toBe('ready'); + expect(result.totalValue).toBe(150); + expect( + result.rows.find(({ assetClass }) => assetClass === AssetClass.LIQUIDITY) + ?.actual + ).toBe(1); + }); + + it('still rejects omitted securities in a snapshot which already contains cash', () => { + const details = includeAccountCash( + makeDetails({ equity: 600, cash: 100 }), + 100 + ); + details.holdings.shift(); + expect( + calculatePortfolioTargets({ + details, + targets: allocations, + tolerance: 0.05 + }).status + ).toBe('inconsistent'); + }); +}); diff --git a/libs/common/src/lib/portfolio-targets/portfolio-targets-calculator.ts b/libs/common/src/lib/portfolio-targets/portfolio-targets-calculator.ts new file mode 100644 index 0000000000..41864e94b6 --- /dev/null +++ b/libs/common/src/lib/portfolio-targets/portfolio-targets-calculator.ts @@ -0,0 +1,303 @@ +import { UNKNOWN_KEY } from '@ghostfolio/common/config'; +import { + PortfolioDetails, + PortfolioTargetsSettings +} from '@ghostfolio/common/interfaces'; +import { AssetClass, AssetSubClass } from '@ghostfolio/prisma/enums'; + +export const TARGET_ASSET_CLASSES = Object.values(AssetClass); + +export type TargetAllocationKey = AssetClass | typeof UNKNOWN_KEY; + +/** + * Forward-error bound gamma(n) * magnitude for n rounding steps. EPSILON + * conservatively bounds unit roundoff (EPSILON / 2), including evaluation of + * the bound from already rounded, nonnegative magnitudes. No currency units + * or decimal-place assumptions enter this calculation. + */ +function roundoffBudget(magnitude: number, operations: number) { + const error = operations * Number.EPSILON; + return (error / (1 - error)) * Math.abs(magnitude); +} + +export interface TargetAllocationRow { + assetClass: TargetAllocationKey; + actual: number; + target: number; + /** Signed percentage-point difference, expressed as a fraction. */ + drift: number; + outOfTolerance: boolean; +} + +export interface TargetAllocationResult { + rows: TargetAllocationRow[]; + /** Total asset value, including cash balances. */ + totalValue: number; + /** Independently verified account cash, whether already represented in holdings or not. */ + accountCashValue: number; + /** Half of the absolute drifts, including unclassified holdings. */ + totalDrift: number; + maxDrift: number; + outOfToleranceCount: number; + unclassifiedValue: number; + status: 'ready' | 'empty' | 'unavailable' | 'inconsistent' | 'unsupported'; +} + +/** The first release permits only one active target, but uses a versioned shape. */ +export function getActivePortfolioTarget(settings: PortfolioTargetsSettings) { + return settings.profiles.find(({ id }) => id === settings.activeProfileId); +} + +export function isValidPortfolioTarget( + allocations: Partial>, + tolerance: number +): boolean { + if (!Number.isFinite(tolerance) || tolerance < 0 || tolerance > 1) { + return false; + } + + const values = TARGET_ASSET_CLASSES.map( + (assetClass) => allocations[assetClass] ?? 0 + ); + + return ( + values.every( + (value) => Number.isFinite(value) && value >= 0 && value <= 1 + ) && + Math.abs(values.reduce((sum, value) => sum + value, 0) - 1) < 1e-8 && + Object.keys(allocations).every((key) => + TARGET_ASSET_CLASSES.includes(key as AssetClass) + ) + ); +} + +/** + * Computes actual allocation from the unfiltered (or account-only filtered) + * portfolio details. Cached snapshots computed by the queue worker already + * include account cash as currency holdings. Never add that cash a second time. + * + * Never use this method on redacted values: combining percentage-only + * holdings with account balances would yield incorrect allocations. + */ +export function calculatePortfolioTargets({ + details, + targets, + tolerance +}: { + details: Pick; + targets: Partial>; + tolerance: number; +}): TargetAllocationResult { + const empty = ( + status: TargetAllocationResult['status'] + ): TargetAllocationResult => ({ + rows: [], + totalValue: 0, + accountCashValue: 0, + totalDrift: 0, + maxDrift: 0, + outOfToleranceCount: 0, + unclassifiedValue: 0, + status + }); + + if (!isValidPortfolioTarget(targets, tolerance)) { + return empty('inconsistent'); + } + + const values = new Map( + TARGET_ASSET_CLASSES.map((assetClass) => [assetClass, 0]) + ); + + let holdingsValue = 0; + let cashHoldingsValue = 0; + let cashHoldingsCount = 0; + let hasCashHoldings = false; + for (const holding of details.holdings) { + const value = holding.valueInBaseCurrency; + if (value === undefined || !Number.isFinite(value)) { + return empty('unavailable'); + } + + if (value < 0 || holding.quantity < 0) { + return empty('unsupported'); + } + + holdingsValue += value; + + const profile = holding.assetProfile; + // The backend's synthetic currency positions use the currency code as + // their symbol. Ordinary cash instruments have their own symbol and must + // not be confused with an account's balance. + if ( + profile?.assetClass === AssetClass.LIQUIDITY && + profile.assetSubClass === AssetSubClass.CASH && + typeof profile.currency === 'string' && + profile.symbol === profile.currency + ) { + hasCashHoldings = true; + cashHoldingsCount++; + cashHoldingsValue += value; + } + + const assetClass = holding.assetProfile?.assetClass; + const key = + assetClass && TARGET_ASSET_CLASSES.includes(assetClass) + ? assetClass + : UNKNOWN_KEY; + + values.set(key, (values.get(key) ?? 0) + value); + } + + const accountValues = Object.values(details.accounts); + if ( + accountValues.some( + ({ valueInBaseCurrency, balance }) => + !Number.isFinite(valueInBaseCurrency) || !Number.isFinite(balance) + ) + ) { + return empty('unavailable'); + } + + // Negative balances and short positions are legitimate, but the v1 + // long-only comparison cannot represent them. Never normalize them away. + if ( + accountValues.some( + ({ balance, valueInBaseCurrency }) => + balance < 0 || valueInBaseCurrency < 0 + ) + ) { + return empty('unsupported'); + } + + const accountsTotal = accountValues.reduce( + (sum, account) => sum + account.valueInBaseCurrency, + 0 + ); + + if (accountValues.length === 0 && holdingsValue > 0) { + return empty('unavailable'); + } + + // A positive residual alone is not proof of cash: getDetails can omit a + // position whose symbol profile is missing. Its existing summary provides + // the snapshot total and independently converted account cash, for this + // same unfiltered/account-only selection. + const summary = details.summary; + const snapshotValue = summary?.filteredValueInBaseCurrency; + const accountCashValue = summary?.accountCashInBaseCurrency; + if ( + typeof snapshotValue !== 'number' || + typeof accountCashValue !== 'number' || + !summary || + ![ + summary.filteredValueInBaseCurrency, + accountCashValue, + summary.liabilitiesInBaseCurrency + ].every((value) => typeof value === 'number' && Number.isFinite(value)) + ) { + return empty('unavailable'); + } + + if (accountCashValue < 0 || summary.liabilitiesInBaseCurrency !== 0) { + return empty('unsupported'); + } + + const cashNotInHoldings = hasCashHoldings ? 0 : accountCashValue; + const totalValue = holdingsValue + cashNotInHoldings; + if ( + ![holdingsValue, accountsTotal, accountCashValue, totalValue].every( + Number.isFinite + ) + ) { + return empty('unavailable'); + } + + // Holdings: one Big-to-number conversion per value, then n - 1 additions. + // The snapshot independently converts the Big sum once. + const holdingsError = roundoffBudget(holdingsValue, details.holdings.length); + const snapshotError = roundoffBudget(snapshotValue, 1); + + // Accounts: up to two FX multiplications (an indirect rate and the amount) + // or a serialized snapshot price, a final conversion, then n - 1 additions. + const accountsError = roundoffBudget(accountsTotal, accountValues.length + 2); + + // AccountService converts each nonnegative balance with up to two FX + // multiplications, sums using Big and converts the sum once. These three + // rounding steps stay at cash scale, independently of securities/funds. + const cashError = roundoffBudget(accountCashValue, 3); + const cashHoldingsError = roundoffBudget( + cashHoldingsValue, + cashHoldingsCount + ); + const totalError = hasCashHoldings + ? holdingsError + : holdingsError + cashError + roundoffBudget(totalValue, 1); + + if ( + ![holdingsError, snapshotError, accountsError, cashError, totalError].every( + Number.isFinite + ) + ) { + return empty('unavailable'); + } + + // Each comparison uses only its own operands. In particular, a large + // security position must never enlarge the independent cash error budget. + if ( + Math.abs(holdingsValue - snapshotValue) > holdingsError + snapshotError || + Math.abs(accountsTotal - totalValue) > accountsError + totalError || + (hasCashHoldings && + Math.abs(cashHoldingsValue - accountCashValue) > + cashHoldingsError + cashError) + ) { + return empty('inconsistent'); + } + + if (totalValue === 0) { + return empty('empty'); + } + + values.set( + AssetClass.LIQUIDITY, + (values.get(AssetClass.LIQUIDITY) ?? 0) + cashNotInHoldings + ); + + const rows: TargetAllocationRow[] = TARGET_ASSET_CLASSES.map((assetClass) => { + const actual = (values.get(assetClass) ?? 0) / totalValue; + const target = targets[assetClass] ?? 0; + const drift = actual - target; + return { + assetClass, + actual, + target, + drift, + outOfTolerance: Math.abs(drift) > tolerance + 1e-10 + }; + }); + + const unclassifiedValue = values.get(UNKNOWN_KEY) ?? 0; + if (unclassifiedValue > 0) { + rows.push({ + assetClass: UNKNOWN_KEY, + actual: unclassifiedValue / totalValue, + target: 0, + drift: unclassifiedValue / totalValue, + outOfTolerance: unclassifiedValue / totalValue > tolerance + 1e-10 + }); + } + + const drifts = rows.map(({ drift }) => Math.abs(drift)); + + return { + rows, + totalValue, + accountCashValue, + totalDrift: drifts.reduce((sum, value) => sum + value, 0) / 2, + maxDrift: Math.max(...drifts), + outOfToleranceCount: rows.filter(({ outOfTolerance }) => outOfTolerance) + .length, + unclassifiedValue, + status: 'ready' + }; +} diff --git a/libs/common/src/lib/portfolio-targets/portfolio-targets-dto.spec.ts b/libs/common/src/lib/portfolio-targets/portfolio-targets-dto.spec.ts new file mode 100644 index 0000000000..3c65c395a4 --- /dev/null +++ b/libs/common/src/lib/portfolio-targets/portfolio-targets-dto.spec.ts @@ -0,0 +1,50 @@ +import { UpdateUserSettingDto } from '@ghostfolio/common/dtos/update-user-setting.dto'; + +import { validate } from 'class-validator'; + +import { createDefaultPortfolioTarget } from './portfolio-targets-presets'; + +function makeDto() { + return Object.assign(new UpdateUserSettingDto(), { + portfolioTargets: { + version: 1 as const, + activeProfileId: 'global', + profiles: [createDefaultPortfolioTarget()] + } + }); +} + +describe('Portfolio targets HTTP validation', () => { + it('accepts the versioned target and existing users without one', async () => { + expect(await validate(makeDto())).toEqual([]); + expect(await validate(new UpdateUserSettingDto())).toEqual([]); + }); + + it.each([-0.01, 1.01, NaN, Infinity])( + 'rejects tolerance %s', + async (tolerance) => { + const dto = makeDto(); + dto.portfolioTargets.profiles[0].tolerance = tolerance; + expect(await validate(dto)).toEqual( + expect.arrayContaining([ + expect.objectContaining({ property: 'portfolioTargets' }) + ]) + ); + } + ); + + it('rejects null instead of storing an unversioned target', async () => { + const dto = Object.assign(makeDto(), { portfolioTargets: null }); + expect(await validate(dto)).toHaveLength(1); + }); + + it('rejects incomplete allocations and unsupported versions', async () => { + const dto = makeDto(); + delete dto.portfolioTargets.profiles[0].allocations.COMMODITY; + expect(await validate(dto)).toHaveLength(1); + const unsupported = Object.assign(makeDto(), { + portfolioTargets: { ...makeDto().portfolioTargets, version: 2 } + }); + expect(await validate(unsupported)).toHaveLength(1); + }); +}); diff --git a/libs/common/src/lib/portfolio-targets/portfolio-targets-presets.spec.ts b/libs/common/src/lib/portfolio-targets/portfolio-targets-presets.spec.ts new file mode 100644 index 0000000000..049bf9b750 --- /dev/null +++ b/libs/common/src/lib/portfolio-targets/portfolio-targets-presets.spec.ts @@ -0,0 +1,37 @@ +import { AssetClass } from '@ghostfolio/prisma/enums'; + +import { isValidPortfolioTarget } from './portfolio-targets-calculator'; +import { + createDefaultPortfolioTarget, + PORTFOLIO_TARGET_PRESETS +} from './portfolio-targets-presets'; + +describe('Portfolio target presets', () => { + it('provides five valid, editable starting points', () => { + expect(PORTFOLIO_TARGET_PRESETS).toHaveLength(5); + for (const { allocations } of PORTFOLIO_TARGET_PRESETS) { + expect(isValidPortfolioTarget(allocations, 0.05)).toBe(true); + } + }); + + it('keeps the original global default independent from the presets', () => { + const target = createDefaultPortfolioTarget(); + target.allocations[AssetClass.EQUITY] = 0.1; + + expect(PORTFOLIO_TARGET_PRESETS[2].allocations[AssetClass.EQUITY]).toBe( + 0.6 + ); + expect(target.tolerance).toBe(0.05); + expect(target.id).toBe('global'); + }); + + it('represents Golden Butterfly at macro-class level', () => { + const butterfly = PORTFOLIO_TARGET_PRESETS.find( + ({ id }) => id === 'golden-butterfly' + ); + + expect(butterfly?.allocations[AssetClass.EQUITY]).toBe(0.4); + expect(butterfly?.allocations[AssetClass.FIXED_INCOME]).toBe(0.4); + expect(butterfly?.allocations[AssetClass.COMMODITY]).toBe(0.2); + }); +}); diff --git a/libs/common/src/lib/portfolio-targets/portfolio-targets-presets.ts b/libs/common/src/lib/portfolio-targets/portfolio-targets-presets.ts new file mode 100644 index 0000000000..46afe9e632 --- /dev/null +++ b/libs/common/src/lib/portfolio-targets/portfolio-targets-presets.ts @@ -0,0 +1,50 @@ +import { PortfolioTargetProfile } from '@ghostfolio/common/interfaces'; +import { AssetClass } from '@ghostfolio/prisma/enums'; + +export interface PortfolioTargetPreset { + id: string; + name: string; + allocations: Record; +} + +function makePreset( + id: string, + name: string, + equity: number, + fixedIncome: number, + commodity = 0 +): PortfolioTargetPreset { + return { + id, + name, + allocations: { + [AssetClass.ALTERNATIVE_INVESTMENT]: 0, + [AssetClass.COMMODITY]: commodity, + [AssetClass.EQUITY]: equity, + [AssetClass.FIXED_INCOME]: fixedIncome, + [AssetClass.LIQUIDITY]: 0, + [AssetClass.REAL_ESTATE]: 0 + } + }; +} + +/** Editable starting points, not investment recommendations. */ +export const PORTFOLIO_TARGET_PRESETS: PortfolioTargetPreset[] = [ + makePreset('cautious-20-80', 'Cautious (20/80)', 0.2, 0.8), + makePreset('conservative-40-60', 'Conservative (40/60)', 0.4, 0.6), + makePreset('moderate-60-40', 'Moderate (60/40)', 0.6, 0.4), + makePreset('aggressive-80-20', 'Aggressive (80/20)', 0.8, 0.2), + makePreset('golden-butterfly', 'Golden Butterfly (simplified)', 0.4, 0.4, 0.2) +]; + +export function createDefaultPortfolioTarget(): PortfolioTargetProfile { + const preset = PORTFOLIO_TARGET_PRESETS[2]; + + return { + id: 'global', + name: preset.name, + presetId: preset.id, + allocations: { ...preset.allocations }, + tolerance: 0.05 + }; +} diff --git a/libs/common/src/lib/portfolio-targets/portfolio-targets-validation.spec.ts b/libs/common/src/lib/portfolio-targets/portfolio-targets-validation.spec.ts new file mode 100644 index 0000000000..d77d66709a --- /dev/null +++ b/libs/common/src/lib/portfolio-targets/portfolio-targets-validation.spec.ts @@ -0,0 +1,86 @@ +import { AssetClass } from '@ghostfolio/prisma/enums'; + +import { isValidPortfolioTargetsSettings } from './portfolio-targets-validation'; + +const allocations = { + [AssetClass.ALTERNATIVE_INVESTMENT]: 0, + [AssetClass.COMMODITY]: 0.2, + [AssetClass.EQUITY]: 0.4, + [AssetClass.FIXED_INCOME]: 0.4, + [AssetClass.LIQUIDITY]: 0, + [AssetClass.REAL_ESTATE]: 0 +}; + +const validSettings = { + version: 1, + activeProfileId: 'global', + profiles: [ + { + id: 'global', + name: 'Golden Butterfly (simplified)', + allocations, + tolerance: 0.05 + } + ] +}; + +describe('Portfolio targets settings validation', () => { + it('accepts a single complete allocation', () => { + expect(isValidPortfolioTargetsSettings(validSettings)).toBe(true); + }); + + it('rejects multiple profiles in v1', () => { + expect( + isValidPortfolioTargetsSettings({ + ...validSettings, + profiles: [...validSettings.profiles, ...validSettings.profiles] + }) + ).toBe(false); + }); + + it('rejects non-100-percent allocations', () => { + expect( + isValidPortfolioTargetsSettings({ + ...validSettings, + profiles: [ + { + ...validSettings.profiles[0], + allocations: { ...allocations, [AssetClass.EQUITY]: 0.3 } + } + ] + }) + ).toBe(false); + }); + + it('rejects invalid tolerances', () => { + expect( + isValidPortfolioTargetsSettings({ + ...validSettings, + profiles: [{ ...validSettings.profiles[0], tolerance: -0.1 }] + }) + ).toBe(false); + }); + + it('rejects a mismatched active profile', () => { + expect( + isValidPortfolioTargetsSettings({ + ...validSettings, + activeProfileId: 'other' + }) + ).toBe(false); + }); + + it('rejects unknown allocation keys', () => { + expect( + isValidPortfolioTargetsSettings({ + ...validSettings, + profiles: [ + { + ...validSettings.profiles[0], + allocations: { ...allocations, UNKNOWN: 0 } + } + ] + }) + ).toBe(false); + }); +}); diff --git a/libs/common/src/lib/portfolio-targets/portfolio-targets-validation.ts b/libs/common/src/lib/portfolio-targets/portfolio-targets-validation.ts new file mode 100644 index 0000000000..554aa8566e --- /dev/null +++ b/libs/common/src/lib/portfolio-targets/portfolio-targets-validation.ts @@ -0,0 +1,71 @@ +import { PortfolioTargetsSettings } from '@ghostfolio/common/interfaces/portfolio-targets.interface'; +import { AssetClass } from '@ghostfolio/prisma/enums'; + +const assetClasses = Object.values(AssetClass); + +export function isValidPortfolioTargetsSettings( + value: unknown +): value is PortfolioTargetsSettings { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + + const settings = value as Partial; + + if ( + settings.version !== 1 || + typeof settings.activeProfileId !== 'string' || + !Array.isArray(settings.profiles) || + // Only one global target is supported in the first release. + settings.profiles.length !== 1 + ) { + return false; + } + + const profile = settings.profiles[0]; + + if ( + !profile || + typeof profile.id !== 'string' || + profile.id.length === 0 || + profile.id.length > 100 || + profile.id !== settings.activeProfileId || + typeof profile.name !== 'string' || + profile.name.trim().length === 0 || + profile.name.length > 100 || + (profile.presetId !== undefined && + (typeof profile.presetId !== 'string' || + profile.presetId.length > 100)) || + typeof profile.tolerance !== 'number' || + !Number.isFinite(profile.tolerance) || + profile.tolerance < 0 || + profile.tolerance > 1 || + !profile.allocations || + typeof profile.allocations !== 'object' || + Array.isArray(profile.allocations) + ) { + return false; + } + + const keys = Object.keys(profile.allocations); + if ( + keys.length !== assetClasses.length || + keys.some((key) => !assetClasses.includes(key as AssetClass)) + ) { + return false; + } + + const weights = assetClasses.map( + (assetClass) => profile.allocations[assetClass] + ); + + return ( + weights.every( + (weight) => + typeof weight === 'number' && + Number.isFinite(weight) && + weight >= 0 && + weight <= 1 + ) && Math.abs(weights.reduce((sum, weight) => sum + weight, 0) - 1) < 1e-8 + ); +} diff --git a/libs/common/src/lib/routes/routes.ts b/libs/common/src/lib/routes/routes.ts index ca3cdd3663..9402715144 100644 --- a/libs/common/src/lib/routes/routes.ts +++ b/libs/common/src/lib/routes/routes.ts @@ -214,6 +214,11 @@ export const internalRoutes = { routerLink: ['/portfolio'], title: $localize`Analysis` }, + targets: { + path: 'targets', + routerLink: ['/portfolio', 'targets'], + title: $localize`Targets` + }, fire: { path: 'fire', routerLink: ['/portfolio', 'fire'],