Feature/add symbol profile model (#148)

* Add symbol profile model and positions by country chart

* Add positions by continent chart

* Fix tests

* Extend seed

* Update changelog
This commit is contained in:
Thomas
2021-06-06 15:31:28 +02:00
committed by GitHub
parent 21504573b4
commit 6a03120225
17 changed files with 283 additions and 24 deletions

View File

@@ -0,0 +1,6 @@
export interface Country {
code: string;
continent: string;
name: string;
weight: number;
}

View File

@@ -1,12 +1,15 @@
import { MarketState } from '@ghostfolio/api/services/interfaces/interfaces';
import { Currency } from '@prisma/client';
import { Country } from './country.interface';
export interface PortfolioPosition {
accounts: {
[name: string]: { current: number; original: number };
};
allocationCurrent: number;
allocationInvestment: number;
countries: Country[];
currency: Currency;
exchange?: string;
grossPerformance: number;
@@ -24,4 +27,5 @@ export interface PortfolioPosition {
symbol: string;
type?: string;
url?: string;
value: number;
}

View File

@@ -1,5 +1,8 @@
import { Account, Order, Platform } from '@prisma/client';
import { Account, Order, Platform, SymbolProfile } from '@prisma/client';
type AccountWithPlatform = Account & { Platform?: Platform };
export type OrderWithAccount = Order & { Account?: AccountWithPlatform };
export type OrderWithAccount = Order & {
Account?: AccountWithPlatform;
SymbolProfile?: SymbolProfile;
};