using System.ComponentModel.DataAnnotations;

namespace CryptoSaving.Models
{
    public class TradeListViewModel
    {
        public int Id { get; set; }

        [Display(Name = "Moneda")]
        public int CoinId { get; set; }

        [Display(Name = "Moneda")]
        public string Symbol { get; set; }

        [Display(Name = "Fecha Inversión")]
        public DateTime Date { get; set; }

        [Display(Name = "Valor de Compra (USD)")]
        public double BuyValue { get; set; }

        [Display(Name = "Cantidad")]
        public double Quantity { get; set; }

        [Display(Name = "Inversión (USD)")]
        public double InvestmentValue { get; set; }

        [Display(Name = "Moneda Hoy (USD)")]
        public double TodayCoinValue { get; set; }

        [Display(Name = "Inv. Hoy (USD)")]
        public double TodayInvestmentValue { get; set; }

        [Display(Name = "USD")]
        public double ResultsValue => Math.Round((TodayInvestmentValue - InvestmentValue),2);

        [Display(Name = "(%)")]
        public double ResultsPercent => Math.Round((TodayInvestmentValue >= InvestmentValue) ? ((TodayInvestmentValue * 100 / InvestmentValue) - 100) : (-1 * (100 - (TodayInvestmentValue * 100 / InvestmentValue))),2);

    }
}
