using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MarketData.MarketDataModel
{
  public class Splits  : List<Split>
  {
    public Splits()
    {
    }
    public Splits(List<Split> splits)
    {
      foreach(Split split in splits)Add(split);
    }
  }
  public class Split
  {
    public Split()
    {
      Applied=false;
    }
    public String Exchange{get;set;}
    public String Symbol{get;set;}
    public DateTime EffectiveDate{get;set;}
    public String StrRatio{get;set;}
    public double Ratio
    {
      get
      {
        if(null==StrRatio||!StrRatio.Contains('-'))return double.NaN;
        String[] elements=StrRatio.Split('-');
        return double.Parse(elements[1])/double.Parse(elements[0]);
      }
    }
    public bool Applied{get;set;}
    public DateTime AppliedLeastRecent{get;set;}
    public DateTime AppliedMostRecent{get;set;}
    public DateTime Modified{get;set;}
    public DateTime Created{get;set;}
  }
}
