using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankTV.Helpers;

namespace BankTV.Model.Stock
{
    public class StockItem : AbstractModel
    {
        public string Name { get; set; }
        public DateTime EntryDate { get; set; }
        public decimal Opening { get; set; }
        public decimal Max { get; set; }
        public decimal Min { get; set; }
        public decimal Closing { get; set; }
        public decimal Trade { get; set; }
        public StockPriceDirection Direction 
        {
            get
            {
                decimal diff = Closing - Opening;
                if (diff > 0)
                {
                    return StockPriceDirection.UP;
                }   //if
                if (diff < 0)
                {
                    return StockPriceDirection.DOWN;
                }   //if
                return StockPriceDirection.NOCHANGE;
            }
        }

        public enum StockPriceDirection
        {
            UP,
            DOWN,
            NOCHANGE
        };

    }
}
