namespace Electricity.Api.Entities
{
    public partial class ElectricityLog
    {
        public string Date { get; set; } = null!;
        public string TimeUtc { get; set; } = null!;
        public double CurrentPowerUsage { get; set; }
        public double TotalPowerConsumptionDay { get; set; }
        public double TotalPowerConsumptionNight { get; set; }
        public double CurrentPowerReturn { get; set; }
        public double TotalPowerReturnDay { get; set; }
        public double TotalPowerReturnNight { get; set; }
        public long DayTarifEnabled { get; set; }
        public double GasConsumptionInCubicMeters { get; set; }

        public DateTime GetDateTime() => DateTime
            .Parse(
                $"{Date}T{TimeUtc}Z",
                null,
                System.Globalization.DateTimeStyles.AssumeUniversal)
            .ToUniversalTime();
    }
}
