#![allow(missing_docs)]
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};
use strum_macros::{Display, EnumString};
use time::OffsetDateTime;
use crate::utils::counter::deserialize_counter_id_as_symbol;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FinancialReports {
pub list: serde_json::Value,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DividendList {
pub list: Vec<DividendItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DividendItem {
#[serde(
rename = "counter_id",
deserialize_with = "deserialize_counter_id_as_symbol"
)]
pub symbol: String,
#[serde(default)]
pub id: String,
pub desc: String,
pub record_date: String,
pub ex_date: String,
pub payment_date: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRating {
pub latest: InstitutionRatingLatest,
pub summary: InstitutionRatingSummary,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingLatest {
pub evaluate: RatingEvaluate,
pub target: RatingTarget,
pub industry_id: i64,
pub industry_name: String,
pub industry_rank: i32,
pub industry_total: i32,
pub industry_mean: i32,
pub industry_median: i32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RatingEvaluate {
pub buy: i32,
pub over: i32,
pub hold: i32,
pub under: i32,
pub sell: i32,
pub no_opinion: i32,
pub total: i32,
pub start_date: String,
pub end_date: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RatingTarget {
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub highest_price: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub lowest_price: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub prev_close: Option<Decimal>,
pub start_date: String,
pub end_date: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingSummary {
pub ccy_symbol: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub change: Option<Decimal>,
pub evaluate: RatingSummaryEvaluate,
pub recommend: InstitutionRecommend,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub target: Option<Decimal>,
pub updated_at: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RatingSummaryEvaluate {
pub buy: i32,
pub date: String,
pub hold: i32,
pub sell: i32,
pub strong_buy: i32,
pub under: i32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingDetail {
pub ccy_symbol: String,
pub evaluate: InstitutionRatingDetailEvaluate,
pub target: InstitutionRatingDetailTarget,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingDetailEvaluate {
pub list: Vec<InstitutionRatingDetailEvaluateItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingDetailEvaluateItem {
pub buy: i32,
pub date: String,
pub hold: i32,
pub sell: i32,
#[serde(default)]
pub strong_buy: i32,
#[serde(default)]
pub no_opinion: i32,
pub under: i32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingDetailTarget {
pub data_percent: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub prediction_accuracy: Option<Decimal>,
pub updated_at: String,
pub list: Vec<InstitutionRatingDetailTargetItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingDetailTargetItem {
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub avg_target: Option<Decimal>,
pub date: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub max_target: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub min_target: Option<Decimal>,
pub meet: bool,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub price: Option<Decimal>,
pub timestamp: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForecastEps {
pub items: Vec<ForecastEpsItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForecastEpsItem {
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub forecast_eps_median: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub forecast_eps_mean: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub forecast_eps_lowest: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub forecast_eps_highest: Option<Decimal>,
pub institution_total: i32,
pub institution_up: i32,
pub institution_down: i32,
#[serde(deserialize_with = "crate::serde_utils::deserialize_timestamp")]
pub forecast_start_date: OffsetDateTime,
#[serde(deserialize_with = "crate::serde_utils::deserialize_timestamp")]
pub forecast_end_date: OffsetDateTime,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FinancialConsensus {
pub list: Vec<ConsensusReport>,
pub current_index: i32,
pub currency: String,
#[serde(default)]
pub opt_periods: Vec<String>,
pub current_period: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConsensusReport {
pub fiscal_year: i32,
pub fiscal_period: String,
pub period_text: String,
pub details: Vec<ConsensusDetail>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConsensusDetail {
pub key: String,
pub name: String,
pub description: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub actual: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub estimate: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub comp_value: Option<Decimal>,
pub comp_desc: String,
pub comp: String,
pub is_released: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationData {
pub metrics: ValuationMetricsData,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationMetricsData {
pub pe: Option<ValuationMetricData>,
pub pb: Option<ValuationMetricData>,
pub ps: Option<ValuationMetricData>,
pub dvd_yld: Option<ValuationMetricData>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationMetricData {
pub desc: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub high: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub low: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub median: Option<Decimal>,
pub list: Vec<ValuationPoint>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationPoint {
#[serde(deserialize_with = "crate::serde_utils::deserialize_timestamp")]
pub timestamp: OffsetDateTime,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub value: Option<Decimal>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationHistoryResponse {
pub history: ValuationHistoryData,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationHistoryData {
pub metrics: ValuationHistoryMetrics,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationHistoryMetrics {
pub pe: Option<ValuationHistoryMetric>,
pub pb: Option<ValuationHistoryMetric>,
pub ps: Option<ValuationHistoryMetric>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationHistoryMetric {
pub desc: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub high: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub low: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub median: Option<Decimal>,
pub list: Vec<ValuationPoint>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryValuationList {
pub list: Vec<IndustryValuationItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryValuationItem {
#[serde(
rename = "counter_id",
deserialize_with = "deserialize_counter_id_as_symbol"
)]
pub symbol: String,
pub name: String,
pub currency: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub assets: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub bps: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub eps: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub dps: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub div_yld: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub div_payout_ratio: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub five_y_avg_dps: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub pe: Option<Decimal>,
pub history: Vec<IndustryValuationHistory>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryValuationHistory {
pub date: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub pe: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub pb: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub ps: Option<Decimal>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryValuationDist {
pub pe: Option<ValuationDist>,
pub pb: Option<ValuationDist>,
pub ps: Option<ValuationDist>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationDist {
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub low: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub high: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub median: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub value: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub ranking: Option<Decimal>,
pub rank_index: String,
pub rank_total: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompanyOverview {
pub name: String,
pub company_name: String,
pub founded: String,
pub listing_date: String,
pub market: String,
pub region: String,
pub address: String,
pub office_address: String,
pub website: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub issue_price: Option<Decimal>,
pub shares_offered: String,
pub chairman: String,
pub secretary: String,
pub audit_inst: String,
pub category: String,
pub year_end: String,
pub employees: String,
#[serde(rename = "Phone")]
pub phone: String,
pub fax: String,
pub email: String,
pub legal_repr: String,
pub manager: String,
pub bus_license: String,
pub accounting_firm: String,
pub securities_rep: String,
pub legal_counsel: String,
pub zip_code: String,
pub ticker: String,
pub icon: String,
pub profile: String,
#[serde(default)]
pub ads_ratio: String,
pub sector: i32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExecutiveList {
pub professional_list: Vec<ExecutiveGroup>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExecutiveGroup {
#[serde(
rename = "counter_id",
deserialize_with = "deserialize_counter_id_as_symbol"
)]
pub symbol: String,
pub forward_url: String,
pub total: i32,
pub professionals: Vec<Professional>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Professional {
pub id: String,
pub name: String,
pub name_zhcn: String,
pub name_en: String,
pub title: String,
pub biography: String,
pub photo: String,
pub wiki_url: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ShareholderList {
pub shareholder_list: Vec<Shareholder>,
#[serde(default)]
pub forward_url: String,
pub total: i32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Shareholder {
pub shareholder_id: String,
pub shareholder_name: String,
pub institution_type: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub percent_of_shares: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub shares_changed: Option<Decimal>,
pub report_date: String,
#[serde(default)]
pub stocks: Vec<ShareholderStock>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ShareholderStock {
#[serde(
rename = "counter_id",
deserialize_with = "deserialize_counter_id_as_symbol"
)]
pub symbol: String,
pub code: String,
pub market: String,
pub chg: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundHolders {
pub lists: Vec<FundHolder>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundHolder {
pub code: String,
#[serde(
rename = "counter_id",
deserialize_with = "deserialize_counter_id_as_symbol"
)]
pub symbol: String,
pub currency: String,
pub name: String,
#[serde(with = "crate::serde_utils::decimal_empty_is_0")]
pub position_ratio: Decimal,
pub report_date: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CorpActions {
pub items: Vec<CorpActionItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CorpActionItem {
pub id: String,
pub date: String,
pub date_str: String,
pub date_type: String,
pub date_zone: String,
pub act_type: String,
pub act_desc: String,
pub action: String,
pub recent: bool,
pub is_delay: bool,
pub delay_content: String,
pub live: Option<CorpActionLive>,
pub security: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CorpActionLive {
pub id: String,
pub status: serde_json::Value, pub started_at: String,
pub name: String,
pub icon: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InvestRelations {
#[serde(default)]
pub forward_url: String,
pub invest_securities: Vec<InvestSecurity>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InvestSecurity {
pub company_id: String,
pub company_name: String,
pub company_name_en: String,
pub company_name_zhcn: String,
#[serde(
rename = "counter_id",
deserialize_with = "deserialize_counter_id_as_symbol"
)]
pub symbol: String,
pub currency: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub percent_of_shares: Option<Decimal>,
pub shares_rank: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub shares_value: Option<Decimal>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OperatingList {
pub list: Vec<OperatingItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OperatingItem {
pub id: String,
pub report: String,
pub title: String,
pub txt: String,
pub latest: bool,
#[serde(default)]
pub keywords: Vec<serde_json::Value>,
#[serde(default)]
pub web_url: String,
pub financial: OperatingFinancial,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OperatingFinancial {
pub code: String,
pub counter_id: String,
pub currency: String,
pub name: String,
pub region: String,
pub report: String,
pub report_txt: String,
pub indicators: Vec<OperatingIndicator>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OperatingIndicator {
pub field_name: String,
pub indicator_name: String,
pub indicator_value: String,
#[serde(default, with = "crate::serde_utils::decimal_opt_str_is_none")]
pub yoy: Option<Decimal>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuybackData {
#[serde(default)]
pub recent_buybacks: Option<RecentBuybacks>,
#[serde(default)]
pub buyback_history: Vec<BuybackHistoryItem>,
#[serde(default)]
pub buyback_ratios: Vec<BuybackRatios>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RecentBuybacks {
pub currency: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub net_buyback_ttm: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub net_buyback_yield_ttm: Option<Decimal>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuybackHistoryItem {
pub fiscal_year: String,
pub fiscal_year_range: String,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub net_buyback: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub net_buyback_yield: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub net_buyback_growth_rate: Option<Decimal>,
pub currency: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuybackRatios {
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub net_buyback_payout_ratio: Option<Decimal>,
#[serde(with = "crate::serde_utils::decimal_opt_str_is_none")]
pub net_buyback_to_cashflow_ratio: Option<Decimal>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StockRatings {
#[serde(default)]
pub style_txt_name: String,
#[serde(default)]
pub scale_txt_name: String,
#[serde(default)]
pub report_period_txt: String,
#[serde(default)]
pub multi_score: serde_json::Value,
#[serde(default)]
pub multi_letter: String,
#[serde(default)]
pub multi_score_change: i32,
#[serde(default)]
pub industry_name: String,
#[serde(default)]
pub industry_rank: serde_json::Value,
#[serde(default)]
pub industry_total: serde_json::Value,
#[serde(default)]
pub industry_mean_score: serde_json::Value,
#[serde(default)]
pub industry_median_score: serde_json::Value,
#[serde(default)]
pub ratings: Vec<RatingCategory>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RatingCategory {
#[serde(rename = "type")]
pub kind: i32,
#[serde(default)]
pub sub_indicators: Vec<RatingSubIndicatorGroup>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RatingSubIndicatorGroup {
pub indicator: RatingIndicator,
#[serde(default)]
pub sub_indicators: Vec<RatingLeafIndicator>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RatingIndicator {
pub name: String,
#[serde(default)]
pub score: serde_json::Value,
#[serde(default)]
pub letter: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RatingLeafIndicator {
pub name: String,
#[serde(default)]
pub value: String,
#[serde(default)]
pub value_type: String,
#[serde(default)]
pub score: serde_json::Value,
#[serde(default)]
pub letter: String,
}
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, EnumString, Display)]
pub enum InstitutionRecommend {
Unknown,
#[strum(serialize = "strong_buy")]
StrongBuy,
#[strum(serialize = "buy")]
Buy,
#[strum(serialize = "hold")]
Hold,
#[strum(serialize = "sell")]
Sell,
#[strum(serialize = "strong_sell")]
StrongSell,
#[strum(serialize = "underperform")]
Underperform,
#[strum(serialize = "no_opinion")]
NoOpinion,
}
impl_default_for_enum_string!(InstitutionRecommend);
impl_serde_for_enum_string!(InstitutionRecommend);
#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize, Default)]
pub enum FinancialReportKind {
#[serde(rename = "IS")]
IncomeStatement,
#[serde(rename = "BS")]
BalanceSheet,
#[serde(rename = "CF")]
CashFlow,
#[default]
#[serde(rename = "ALL")]
All,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BusinessSegments {
pub date: String,
pub total: String,
pub currency: String,
#[serde(default)]
pub business: Vec<BusinessSegmentItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BusinessSegmentItem {
pub name: String,
pub percent: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BusinessSegmentsHistory {
#[serde(default)]
pub historical: Vec<BusinessSegmentsHistoricalItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BusinessSegmentsHistoricalItem {
pub date: String,
pub total: String,
pub currency: String,
#[serde(default)]
pub business: Vec<BusinessSegmentHistoryItem>,
#[serde(default)]
pub regionals: Vec<BusinessSegmentHistoryItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BusinessSegmentHistoryItem {
pub name: String,
pub percent: String,
pub value: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingViews {
#[serde(default)]
pub elist: Vec<InstitutionRatingViewItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InstitutionRatingViewItem {
pub date: String,
pub buy: String,
pub over: String,
pub hold: String,
pub under: String,
pub sell: String,
pub total: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryRankResponse {
#[serde(default)]
pub items: Vec<IndustryRankGroup>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryRankGroup {
#[serde(default)]
pub lists: Vec<IndustryRankItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryRankItem {
pub name: String,
pub counter_id: String,
pub chg: String,
pub leading_name: String,
pub leading_ticker: String,
pub leading_chg: String,
pub value_name: String,
pub value_data: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryPeersResponse {
pub top: IndustryPeersTop,
pub chain: Option<IndustryPeerNode>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryPeersTop {
pub name: String,
pub market: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndustryPeerNode {
pub name: String,
pub counter_id: String,
pub stock_num: i32,
pub chg: String,
pub ytd_chg: String,
#[serde(default)]
pub next: Vec<IndustryPeerNode>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FinancialReportSnapshot {
pub name: String,
pub ticker: String,
pub fp_start: String,
pub fp_end: String,
pub currency: String,
pub report_desc: String,
pub fo_revenue: Option<SnapshotForecastMetric>,
pub fo_ebit: Option<SnapshotForecastMetric>,
pub fo_eps: Option<SnapshotForecastMetric>,
pub fr_revenue: Option<SnapshotReportedMetric>,
pub fr_profit: Option<SnapshotReportedMetric>,
pub fr_operate_cash: Option<SnapshotReportedMetric>,
pub fr_invest_cash: Option<SnapshotReportedMetric>,
pub fr_finance_cash: Option<SnapshotReportedMetric>,
pub fr_total_assets: Option<SnapshotReportedMetric>,
pub fr_total_liability: Option<SnapshotReportedMetric>,
pub fr_roe_ttm: String,
pub fr_profit_margin: String,
pub fr_profit_margin_ttm: String,
pub fr_asset_turn_ttm: String,
pub fr_leverage_ttm: String,
pub fr_debt_assets_ratio: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SnapshotForecastMetric {
pub value: String,
pub yoy: String,
pub cmp_desc: String,
pub est_value: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SnapshotReportedMetric {
pub value: String,
pub yoy: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ShareholderTopResponse {
pub data: serde_json::Value,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ShareholderDetailResponse {
pub data: serde_json::Value,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationHistoryPoint {
pub date: String,
pub pe: String,
pub pb: String,
pub ps: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationComparisonItem {
pub symbol: String,
pub name: String,
pub currency: String,
pub market_value: String,
pub price_close: String,
pub pe: String,
pub pb: String,
pub ps: String,
pub roe: String,
pub eps: String,
pub bps: String,
pub dps: String,
pub div_yld: String,
pub assets: String,
pub history: Vec<ValuationHistoryPoint>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValuationComparisonResponse {
pub list: Vec<ValuationComparisonItem>,
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub enum FinancialReportPeriod {
#[serde(rename = "af")]
Annual,
#[serde(rename = "saf")]
SemiAnnual,
#[serde(rename = "q1")]
Q1,
#[serde(rename = "q2")]
Q2,
#[serde(rename = "q3")]
Q3,
#[serde(rename = "qf")]
QuarterlyFull,
#[serde(rename = "3q")]
ThreeQ,
}