using System.ComponentModel.DataAnnotations;

namespace ApiTerceiroSimulador.Models.OpenDelivery
{
    public class PriceCurrency
    {
        /// <summary>
        /// Price value. 4 decimals places are accepted
        /// </summary>
        public required decimal Value { get; set; }

        /// <summary>
        /// The 3-letter ISO 4217 currency code.
        /// </summary>
        [Required, RegularExpression("^[A-Z]{3}$")]
        public required string Currency { get; set; } = Currencies.BrasilianReal;

        public PriceCurrency() 
        { 
        
        }

        public PriceCurrency(decimal value)
        {
            Value = value;
        }

        public PriceCurrency(decimal value, string currency)
        {
            Value = value;
            Currency = currency;
        }
    }
}
