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.2 KiB

import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import { Account, Currency, DataSource, SymbolProfile } from '@prisma/client';
4 years ago
import { OrderType } from '../../models/order-type';
export const MarketState = {
closed: 'closed',
delayed: 'delayed',
open: 'open'
};
4 years ago
export const Type = {
Cash: 'Cash',
4 years ago
Cryptocurrency: 'Cryptocurrency',
ETF: 'ETF',
Stock: 'Stock',
Unknown: UNKNOWN_KEY
4 years ago
};
export interface IOrder {
account: Account;
4 years ago
currency: Currency;
date: string;
fee: number;
id?: string;
isDraft: boolean;
4 years ago
quantity: number;
symbol: string;
symbolProfile: SymbolProfile;
4 years ago
type: OrderType;
unitPrice: number;
}
export interface IDataProviderHistoricalResponse {
marketPrice: number;
performance?: number;
}
export interface IDataProviderResponse {
currency: Currency;
dataSource: DataSource;
4 years ago
exchange?: string;
marketChange?: number;
marketChangePercent?: number;
marketPrice: number;
marketState: MarketState;
4 years ago
name: string;
type?: Type;
url?: string;
}
export interface IDataGatheringItem {
dataSource: DataSource;
date?: Date;
symbol: string;
}
export type MarketState = typeof MarketState[keyof typeof MarketState];
4 years ago
export type Type = typeof Type[keyof typeof Type];