|
@ -20,13 +20,16 @@ import { ImpersonationService } from '@ghostfolio/api/services/impersonation.ser |
|
|
import { MarketState } from '@ghostfolio/api/services/interfaces/interfaces'; |
|
|
import { MarketState } from '@ghostfolio/api/services/interfaces/interfaces'; |
|
|
import { EnhancedSymbolProfile } from '@ghostfolio/api/services/interfaces/symbol-profile.interface'; |
|
|
import { EnhancedSymbolProfile } from '@ghostfolio/api/services/interfaces/symbol-profile.interface'; |
|
|
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; |
|
|
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile.service'; |
|
|
import { UNKNOWN_KEY, baseCurrency } from '@ghostfolio/common/config'; |
|
|
import { |
|
|
|
|
|
ASSET_SUB_CLASS_EMERGENCY_FUND, |
|
|
|
|
|
UNKNOWN_KEY, |
|
|
|
|
|
baseCurrency |
|
|
|
|
|
} from '@ghostfolio/common/config'; |
|
|
import { DATE_FORMAT, parseDate } from '@ghostfolio/common/helper'; |
|
|
import { DATE_FORMAT, parseDate } from '@ghostfolio/common/helper'; |
|
|
import { |
|
|
import { |
|
|
Accounts, |
|
|
Accounts, |
|
|
PortfolioDetails, |
|
|
PortfolioDetails, |
|
|
PortfolioPerformanceResponse, |
|
|
PortfolioPerformanceResponse, |
|
|
PortfolioPosition, |
|
|
|
|
|
PortfolioReport, |
|
|
PortfolioReport, |
|
|
PortfolioSummary, |
|
|
PortfolioSummary, |
|
|
Position, |
|
|
Position, |
|
@ -967,9 +970,7 @@ export class PortfolioServiceNew { |
|
|
value: Big; |
|
|
value: Big; |
|
|
userCurrency: string; |
|
|
userCurrency: string; |
|
|
}) { |
|
|
}) { |
|
|
const cashPositions: { |
|
|
const cashPositions: PortfolioDetails['holdings'] = {}; |
|
|
[symbol: string]: Partial<PortfolioPosition>; |
|
|
|
|
|
} = {}; |
|
|
|
|
|
|
|
|
|
|
|
for (const account of cashDetails.accounts) { |
|
|
for (const account of cashDetails.accounts) { |
|
|
const convertedBalance = this.exchangeRateDataService.toCurrency( |
|
|
const convertedBalance = this.exchangeRateDataService.toCurrency( |
|
@ -993,6 +994,7 @@ export class PortfolioServiceNew { |
|
|
assetSubClass: AssetClass.CASH, |
|
|
assetSubClass: AssetClass.CASH, |
|
|
countries: [], |
|
|
countries: [], |
|
|
currency: account.currency, |
|
|
currency: account.currency, |
|
|
|
|
|
dataSource: undefined, |
|
|
grossPerformance: 0, |
|
|
grossPerformance: 0, |
|
|
grossPerformancePercent: 0, |
|
|
grossPerformancePercent: 0, |
|
|
investment: convertedBalance, |
|
|
investment: convertedBalance, |
|
@ -1010,12 +1012,12 @@ export class PortfolioServiceNew { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cashPositions['EMERGENCY_FUND'] = { |
|
|
cashPositions[ASSET_SUB_CLASS_EMERGENCY_FUND] = { |
|
|
...cashPositions[userCurrency], |
|
|
...cashPositions[userCurrency], |
|
|
assetSubClass: 'EMERGENCY_FUND', |
|
|
assetSubClass: ASSET_SUB_CLASS_EMERGENCY_FUND, |
|
|
investment: emergencyFund.toNumber(), |
|
|
investment: emergencyFund.toNumber(), |
|
|
name: 'EMERGENCY_FUND', |
|
|
name: ASSET_SUB_CLASS_EMERGENCY_FUND, |
|
|
symbol: 'EMERGENCY_FUND', |
|
|
symbol: ASSET_SUB_CLASS_EMERGENCY_FUND, |
|
|
value: emergencyFund.toNumber() |
|
|
value: emergencyFund.toNumber() |
|
|
}; |
|
|
}; |
|
|
cashPositions[userCurrency].investment = new Big( |
|
|
cashPositions[userCurrency].investment = new Big( |
|
|