using Lada.Framework.Data.Enums;
using Lada.Framework.DTO;
using Lada.Framework.Infrastructures.Helpers;

namespace Ladaer.BackEnd.Infrastructures.DTO.Items.Orders
{
    public class OrderAddressItem : BaseModel<int>
    {
        public int OrderId { get; set; }
        public string Name { get; set; }
        public string PhoneNumber1 { get; set; }
        public string PhoneNumber2 { get; set; }
        public string Address1 { get; set; }
        public string Address2 { get; set; }
        public AddressType AddressType { get; set; }
        public string AddressTypeStr => AddressType.GetDescription();
        public int CityId { get; set; }
        public int DistrictId { get; set; }
        public int WardId { get; set; }

        public string FullAddress { get; set; }

        public string Note { get; set; }

        /// <summary>
        /// Thời gian hẹn lấy / giao hàng
        /// </summary>
        public DateTimeOffset? ScheduledTime { get; set; }

        public string ScheduledTimeStr => ScheduledTime.HasValue ? ScheduledTime.Value.ToLocalTime().ToString("dd/MM/yyyy HH:mm") : "";

        /// <summary>
        /// Cho phép sửa hay không
        /// </summary>
        public bool CanEdit { get; set; } = false;
    }
}
