mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.3 KiB
61 lines
1.3 KiB
import {
|
|
EnhancedSymbolProfile,
|
|
PortfolioDetails,
|
|
PortfolioPosition
|
|
} from '@ghostfolio/common/interfaces';
|
|
import { Market } from '@ghostfolio/common/types';
|
|
|
|
import { Order } from '@prisma/client';
|
|
|
|
export interface PublicPortfolioResponse extends PublicPortfolioResponseV1 {
|
|
alias?: string;
|
|
hasDetails: boolean;
|
|
holdings: {
|
|
[symbol: string]: Pick<
|
|
PortfolioPosition,
|
|
| 'allocationInPercentage'
|
|
| 'assetClass'
|
|
| 'countries'
|
|
| 'currency'
|
|
| 'dataSource'
|
|
| 'dateOfFirstActivity'
|
|
| 'markets'
|
|
| 'name'
|
|
| 'netPerformancePercentWithCurrencyEffect'
|
|
| 'sectors'
|
|
| 'symbol'
|
|
| 'url'
|
|
| 'valueInBaseCurrency'
|
|
| 'valueInPercentage'
|
|
>;
|
|
};
|
|
latestActivities: (Pick<
|
|
Order,
|
|
'currency' | 'date' | 'fee' | 'quantity' | 'type' | 'unitPrice'
|
|
> & {
|
|
SymbolProfile?: EnhancedSymbolProfile;
|
|
value: number;
|
|
valueInBaseCurrency: number;
|
|
})[];
|
|
markets: {
|
|
[key in Market]: Pick<
|
|
PortfolioDetails['markets'][key],
|
|
'id' | 'valueInPercentage'
|
|
>;
|
|
};
|
|
}
|
|
|
|
interface PublicPortfolioResponseV1 {
|
|
createdAt: Date;
|
|
performance: {
|
|
'1d': {
|
|
relativeChange: number;
|
|
};
|
|
max: {
|
|
relativeChange: number;
|
|
};
|
|
ytd: {
|
|
relativeChange: number;
|
|
};
|
|
};
|
|
}
|
|
|