fmp_rs/models/
esg.rs

1//! Models for ESG and social sentiment endpoints
2
3use serde::{Deserialize, Serialize};
4
5/// ESG (Environmental, Social, Governance) score data
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct EsgScore {
9    /// Symbol
10    pub symbol: String,
11    /// Company name
12    pub company_name: Option<String>,
13    /// ESG score (0-100)
14    pub esg_score: Option<f64>,
15    /// Environmental score
16    pub environment_score: Option<f64>,
17    /// Social score
18    pub social_score: Option<f64>,
19    /// Governance score
20    pub governance_score: Option<f64>,
21    /// ESG performance
22    pub esg_performance: Option<String>,
23    /// Date of assessment
24    pub date: Option<String>,
25    /// Industry
26    pub industry: Option<String>,
27    /// Year
28    pub year: Option<String>,
29    /// Form type
30    pub form_type: Option<String>,
31}
32
33/// ESG risk rating data
34#[derive(Debug, Clone, Serialize, Deserialize)]
35#[serde(rename_all = "camelCase")]
36pub struct EsgRiskRating {
37    /// Symbol
38    pub symbol: String,
39    /// Company name
40    pub company_name: Option<String>,
41    /// Industry
42    pub industry: Option<String>,
43    /// Year
44    pub year: Option<String>,
45    /// ESG risk score
46    pub esg_risk_score: Option<f64>,
47    /// Industry rank
48    pub industry_rank: Option<String>,
49    /// ESG risk percentile
50    pub esg_risk_percentile: Option<f64>,
51    /// ESG risk level
52    pub esg_risk_level: Option<String>,
53    /// Environment risk score
54    pub environment_risk_score: Option<f64>,
55    /// Governance risk score
56    pub governance_risk_score: Option<f64>,
57    /// Social risk score
58    pub social_risk_score: Option<f64>,
59}
60
61/// ESG benchmark data
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(rename_all = "camelCase")]
64pub struct EsgBenchmark {
65    /// Year
66    pub year: Option<String>,
67    /// Industry
68    pub industry: Option<String>,
69    /// ESG benchmark
70    pub esg_benchmark: Option<f64>,
71    /// Environment benchmark
72    pub environment_benchmark: Option<f64>,
73    /// Social benchmark
74    pub social_benchmark: Option<f64>,
75    /// Governance benchmark
76    pub governance_benchmark: Option<f64>,
77}
78
79/// Congressional trading data
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(rename_all = "camelCase")]
82pub struct CongressionalTrading {
83    /// Disclosure date
84    pub disclosure_date: Option<String>,
85    /// Transaction date
86    pub transaction_date: Option<String>,
87    /// Representative name
88    pub representative: Option<String>,
89    /// Transaction type (Purchase/Sale)
90    pub transaction: Option<String>,
91    /// Stock symbol
92    pub ticker: Option<String>,
93    /// Asset description
94    pub asset_description: Option<String>,
95    /// Asset type
96    pub asset_type: Option<String>,
97    /// Amount (range)
98    pub amount: Option<String>,
99    /// House or Senate
100    pub house: Option<String>,
101    /// Political party
102    pub party: Option<String>,
103    /// State
104    pub state: Option<String>,
105    /// District
106    pub district: Option<String>,
107}
108
109/// Senate trading data
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(rename_all = "camelCase")]
112pub struct SenateTrading {
113    /// Disclosure date
114    pub disclosure_date: Option<String>,
115    /// Transaction date
116    pub transaction_date: Option<String>,
117    /// Senator name
118    pub senator: Option<String>,
119    /// Transaction type
120    pub transaction_type: Option<String>,
121    /// Stock symbol
122    pub ticker: Option<String>,
123    /// Asset description
124    pub asset_description: Option<String>,
125    /// Asset type
126    pub asset_type: Option<String>,
127    /// Amount
128    pub amount: Option<String>,
129    /// Political party
130    pub party: Option<String>,
131    /// State
132    pub state: Option<String>,
133    /// Date received
134    pub date_received: Option<String>,
135}
136
137/// Social sentiment data
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(rename_all = "camelCase")]
140pub struct SocialSentiment {
141    /// Date
142    pub date: String,
143    /// Symbol
144    pub symbol: String,
145    /// Stock tweeter posts
146    pub stocktwits_posts: Option<i32>,
147    /// Twitter posts
148    pub twitter_posts: Option<i32>,
149    /// Twitter comments
150    pub twitter_comments: Option<i32>,
151    /// Twitter likes
152    pub twitter_likes: Option<i32>,
153    /// Twitter sentiment
154    pub twitter_sentiment: Option<f64>,
155    /// StockTwits sentiment
156    pub stocktwits_sentiment: Option<f64>,
157    /// General sentiment
158    pub general_sentiment: Option<String>,
159}