import { Currency } from '../Shared/LocalizationOptions'; import MorningstarOptions, { MorningstarConverterOptions, MorningstarHoldingValueOptions, MorningstarHoldingWeightOptions, MorningstarMetadata } from '../Shared/MorningstarOptions'; export interface RiskScoreConverterOptions extends MorningstarConverterOptions { } export type RiskScoreMetadataMessage = { type: string; message: string; invalidHoldings?: RiskScoreInvalidHolding[]; }; export type RiskScoreInvalidHolding = { identifier: string; identifierType: string; status: string; }; export interface RiskScoreMetadata extends MorningstarMetadata { messages: RiskScoreMetadataMessage[]; } export interface BaseRiskScorePortfolio { /** * The name of the portfolio. * * This value is used for the column names in the DataTable. */ name: string; /** * Currency to use for value conversions. Use `BAS` for base currency. */ currency?: Currency; /** * A unique identifier of a portfolio. * * Morningstar echoes this property in the response. */ externalId?: string; /** * The total market value of a portfolio. * * This field is required if the holdings are specified with `weight` */ totalValue?: number; } export interface RiskScorePortfolio extends BaseRiskScorePortfolio { /** * List of holdings in your portfolio. * * You specify the quantity of a holding using either `weight` or `value`. * If `weight` is used, you must specify `totalValue`. */ holdings: MorningstarHoldingWeightOptions[] | MorningstarHoldingValueOptions[]; } export interface RiskScoreOptions extends MorningstarOptions { /** * Converter options. */ converter?: RiskScoreConverterOptions; /** * The portfolios you would like to analyse for risk. * * A maximum of two portfolios can be passed in the request. */ portfolios?: [RiskScorePortfolio] | [RiskScorePortfolio, RiskScorePortfolio]; } export default RiskScoreOptions;