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.

75 lines
1.5 KiB

import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import { Account, Currency, DataSource } from '@prisma/client';
4 years ago
import { OrderType } from '../../models/order-type';
export const Industry = {
Automotive: 'Automotive',
Biotechnology: 'Biotechnology',
Food: 'Food',
Internet: 'Internet',
Pharmaceutical: 'Pharmaceutical',
Software: 'Software',
Unknown: UNKNOWN_KEY
4 years ago
};
export const MarketState = {
closed: 'closed',
delayed: 'delayed',
open: 'open'
};
4 years ago
export const Sector = {
Consumer: 'Consumer',
Healthcare: 'Healthcare',
Technology: 'Technology',
Unknown: UNKNOWN_KEY
4 years ago
};
export const Type = {
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;
quantity: number;
symbol: string;
type: OrderType;
unitPrice: number;
}
export interface IDataProviderHistoricalResponse {
marketPrice: number;
performance?: number;
}
export interface IDataProviderResponse {
currency: Currency;
dataSource: DataSource;
4 years ago
exchange?: string;
industry?: Industry;
marketChange?: number;
marketChangePercent?: number;
marketPrice: number;
marketState: MarketState;
4 years ago
name: string;
sector?: Sector;
type?: Type;
url?: string;
}
export type Industry = typeof Industry[keyof typeof Industry];
export type MarketState = typeof MarketState[keyof typeof MarketState];
4 years ago
export type Sector = typeof Sector[keyof typeof Sector];
export type Type = typeof Type[keyof typeof Type];