Skip to main content

finance_query/models/corporate/
fund_profile.rs

1use serde::{Deserialize, Serialize};
2
3use crate::models::quote::FormattedValue;
4
5/// Fund profile information including management, fees, and expenses
6#[derive(Default, Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8#[non_exhaustive]
9pub struct FundProfile {
10    /// Maximum age of the data in seconds
11    #[serde(default)]
12    pub max_age: Option<i64>,
13
14    /// URL to the fund's style box image
15    #[serde(default)]
16    pub style_box_url: Option<String>,
17
18    /// Fund family/company name
19    #[serde(default)]
20    pub family: Option<String>,
21
22    /// Morningstar category name
23    #[serde(default)]
24    pub category_name: Option<String>,
25
26    /// Legal type (e.g., "Exchange Traded Fund", "Mutual Fund")
27    #[serde(default)]
28    pub legal_type: Option<String>,
29
30    /// Fund management information
31    #[serde(default)]
32    pub management_info: Option<ManagementInfo>,
33
34    /// Fees and expenses for this fund
35    #[serde(default)]
36    pub fees_expenses_investment: Option<FeesExpenses>,
37
38    /// Average fees and expenses for funds in the same category
39    #[serde(default)]
40    pub fees_expenses_investment_cat: Option<FeesExpensesCat>,
41
42    /// List of brokerages offering this fund
43    #[serde(default)]
44    pub brokerages: Option<Vec<String>>,
45}
46
47/// Fund management information
48#[derive(Debug, Clone, Serialize, Deserialize)]
49#[serde(rename_all = "camelCase")]
50pub struct ManagementInfo {
51    /// Name of the fund manager
52    #[serde(default)]
53    pub manager_name: Option<String>,
54
55    /// Biography of the fund manager
56    #[serde(default)]
57    pub manager_bio: Option<String>,
58}
59
60/// Fees and expenses for a fund
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(rename_all = "camelCase")]
63pub struct FeesExpenses {
64    /// Annual expense ratio from the latest report
65    #[serde(default)]
66    pub annual_report_expense_ratio: Option<FormattedValue<f64>>,
67
68    /// Annual holdings turnover rate (percentage of portfolio changed per year)
69    #[serde(default)]
70    pub annual_holdings_turnover: Option<FormattedValue<f64>>,
71
72    /// Total net assets in millions
73    #[serde(default)]
74    pub total_net_assets: Option<FormattedValue<f64>>,
75
76    /// Projection values (typically empty)
77    #[serde(default)]
78    pub projection_values: Option<serde_json::Value>,
79}
80
81/// Average fees and expenses for funds in the same category
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(rename_all = "camelCase")]
84pub struct FeesExpensesCat {
85    /// Category average annual expense ratio
86    #[serde(default)]
87    pub annual_report_expense_ratio: Option<FormattedValue<f64>>,
88
89    /// Category average annual holdings turnover
90    #[serde(default)]
91    pub annual_holdings_turnover: Option<FormattedValue<f64>>,
92
93    /// Category average total net assets
94    #[serde(default)]
95    pub total_net_assets: Option<FormattedValue<f64>>,
96
97    /// Category projection values (typically empty)
98    #[serde(default)]
99    pub projection_values_cat: Option<serde_json::Value>,
100}