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

namespace EVCB_OCPP.WSServer.Dto
{
    public class ChargingPrice
    {
        private string _StartTime = "";
        private string _EndTime = "";
        public string StartTime
        {
            set
            {
                _StartTime = value;
                if(!value.Contains("M"))
                {                    
                    DateTime dt = new DateTime(2021, 01, 01, int.Parse(_StartTime.Split(':')[0]), int.Parse(_StartTime.Split(':')[1]), 0, DateTimeKind.Utc);
                    _StartTime = dt.ToString("hh:mm tt", new CultureInfo("en-us"));
                }
               
            }
            get
            { return _StartTime; }
        }

        public string EndTime
        {
            set
            {
                _EndTime = value;
                if (!value.Contains("M"))
                {
                    DateTime dt = new DateTime(2021, 01, 01, int.Parse(_EndTime.Split(':')[0]), int.Parse(_EndTime.Split(':')[1]), 0, DateTimeKind.Utc);
                    _EndTime = dt.ToString("hh:mm tt", new CultureInfo("en-us"));
                }
                
            }
            get
            { return _EndTime; }
        }

        public decimal Fee { set; get; }
    }


    public class ChargingBill
    {
        public string StartTime { set; get; }

        public string EndTime { set; get; }

        public decimal Total { set; get; }

        public decimal PeriodEnergy { set; get; }

        /// <summary>
        /// 費率
        /// </summary>
        public decimal Fee { set; get; }
    }
}
