using System;
using System.Text;
using System.Collections.Generic;
using MarketData.Utils;

namespace MarketData.MarketDataModel
{
  public class FeedStatistics : List<FeedStatistic>
  {
    public FeedStatistics()
    {
    }
    public FeedStatistics(List<FeedStatistic> feedStatistics)
    {
      foreach (FeedStatistic feedStatistic in feedStatistics) Add(feedStatistic);
    }
  }
  public class FeedStatistic
  {
    public enum FeedStatisticType
    {
      ZACKS_RANK, VALUATIONS, YIELD_CURVE, SPLITS, SECURITY_MASTER, SEC_FILINGS, PRICES, OPTIONS, INSIDER_TRANSACTIONS, FUNDAMENTALS, INCOME_STATEMENT, CASHFLOW_STATEMENT,
      BALANCE_SHEET, HISTORICAL, HEADLINES, ETF_HOLDINGS, ECONOMIC_INDICATORS, EARNINGS_ANNOUNCEMENTS, DIVIDEND_HISTORY, CURRENCY_CONVERSION, ANALYST_RATINGS, ANALYST_PRICE_TARGET,
      INVALID
    };
    public FeedStatistic()
    {
    }
    public String Feed { get; set; }
    public int Records { get; set; }
    public DateTime Date { get; set; }

    public static List<String> GetFeedStatisticTypes()
    {
      List<String> types = new List<String>();
      types.Add("Zacks Rank");
      types.Add("Valuations");
      types.Add("Yield Curve");
      types.Add("Splits");
      types.Add("Security Master");
      types.Add("SEC Filings");
      types.Add("Prices");
      types.Add("Options");
      types.Add("Insider Transactions");
      types.Add("Fundamentals");
      types.Add("Income Statement");
      types.Add("Cashflow Statement");
      types.Add("Balance Sheet");
      types.Add("Historical");
      types.Add("Headlines");
      types.Add("ETF Holdings");
      types.Add("Economic Indicators");
      types.Add("Earnings Announcements");
      types.Add("Dividend History");
      types.Add("Currency Conversion");
      types.Add("Analyst Ratings");
      types.Add("Analyst Price Target");
      return types;
    }
    public static String TypeToString(FeedStatisticType feedStatisticType)
    {
      if (feedStatisticType.Equals(FeedStatisticType.ZACKS_RANK)) return "Zacks Rank";
      if (feedStatisticType.Equals(FeedStatisticType.VALUATIONS)) return "Valuations";
      if (feedStatisticType.Equals(FeedStatisticType.YIELD_CURVE)) return "Yield Curve";
      if (feedStatisticType.Equals(FeedStatisticType.SPLITS)) return "Splits";
      if (feedStatisticType.Equals(FeedStatisticType.SECURITY_MASTER)) return "Security Master";
      if (feedStatisticType.Equals(FeedStatisticType.SEC_FILINGS)) return "SEC Filings";
      if (feedStatisticType.Equals(FeedStatisticType.PRICES)) return "Prices";
      if (feedStatisticType.Equals(FeedStatisticType.OPTIONS)) return "Options";
      if (feedStatisticType.Equals(FeedStatisticType.INSIDER_TRANSACTIONS)) return "Insider Transactions";
      if (feedStatisticType.Equals(FeedStatisticType.FUNDAMENTALS)) return "Fundamentals";
      if (feedStatisticType.Equals(FeedStatisticType.INCOME_STATEMENT)) return "Income Statement";
      if (feedStatisticType.Equals(FeedStatisticType.CASHFLOW_STATEMENT)) return "Cashflow Statement";
      if (feedStatisticType.Equals(FeedStatisticType.BALANCE_SHEET)) return "Balance Sheet";
      if (feedStatisticType.Equals(FeedStatisticType.HISTORICAL)) return "Historical";
      if (feedStatisticType.Equals(FeedStatisticType.HEADLINES)) return "Headlines";
      if (feedStatisticType.Equals(FeedStatisticType.ETF_HOLDINGS)) return "ETF Holdings";
      if (feedStatisticType.Equals(FeedStatisticType.ECONOMIC_INDICATORS)) return "Economic Indicators";
      if (feedStatisticType.Equals(FeedStatisticType.EARNINGS_ANNOUNCEMENTS)) return "Earnings Announcements";
      if (feedStatisticType.Equals(FeedStatisticType.DIVIDEND_HISTORY)) return "Dividend History";
      if (feedStatisticType.Equals(FeedStatisticType.CURRENCY_CONVERSION)) return "Currency Conversion";
      if (feedStatisticType.Equals(FeedStatisticType.ANALYST_RATINGS)) return "Analyst Ratings";
      if (feedStatisticType.Equals(FeedStatisticType.ANALYST_PRICE_TARGET)) return "Analyst Price Target";
      return "Invalid";
    }
    public static FeedStatisticType FromString(String strFeedStatisticType)
    {
      if (strFeedStatisticType.Equals("Zacks Rank")) return FeedStatisticType.ZACKS_RANK;
      if (strFeedStatisticType.Equals("Valuations")) return FeedStatisticType.VALUATIONS;
      if (strFeedStatisticType.Equals("Yield Curve")) return FeedStatisticType.YIELD_CURVE;
      if (strFeedStatisticType.Equals("Splits")) return FeedStatisticType.SPLITS;
      if (strFeedStatisticType.Equals("Security Master")) return FeedStatisticType.SECURITY_MASTER;
      if (strFeedStatisticType.Equals("SEC Filings")) return FeedStatisticType.SEC_FILINGS;
      if (strFeedStatisticType.Equals("Prices")) return FeedStatisticType.PRICES;
      if (strFeedStatisticType.Equals("Options")) return FeedStatisticType.OPTIONS;
      if (strFeedStatisticType.Equals("Insider Transactions")) return FeedStatisticType.INSIDER_TRANSACTIONS;
      if (strFeedStatisticType.Equals("Fundamentals")) return FeedStatisticType.FUNDAMENTALS;
      if (strFeedStatisticType.Equals("Income Statement")) return FeedStatisticType.INCOME_STATEMENT;
      if (strFeedStatisticType.Equals("Cashflow Statement")) return FeedStatisticType.CASHFLOW_STATEMENT;
      if (strFeedStatisticType.Equals("Balance Sheet")) return FeedStatisticType.BALANCE_SHEET;
      if (strFeedStatisticType.Equals("Historical")) return FeedStatisticType.HISTORICAL;
      if (strFeedStatisticType.Equals("Headlines")) return FeedStatisticType.HEADLINES;
      if (strFeedStatisticType.Equals("ETF Holdings")) return FeedStatisticType.ETF_HOLDINGS;
      if (strFeedStatisticType.Equals("Economic Indicators")) return FeedStatisticType.ECONOMIC_INDICATORS;
      if (strFeedStatisticType.Equals("Earnings Announcements")) return FeedStatisticType.EARNINGS_ANNOUNCEMENTS;
      if (strFeedStatisticType.Equals("Dividend History")) return FeedStatisticType.DIVIDEND_HISTORY;
      if (strFeedStatisticType.Equals("Currency Conversion")) return FeedStatisticType.CURRENCY_CONVERSION;
      if (strFeedStatisticType.Equals("Analyst Ratings")) return FeedStatisticType.ANALYST_RATINGS;
      if (strFeedStatisticType.Equals("Analyst Price Target")) return FeedStatisticType.ANALYST_PRICE_TARGET;
      return FeedStatisticType.INVALID;
    }
  }
}
