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

namespace Ladaer.BackEnd.Infrastructures.DTO.Items.Trucks
{
    public class TruckItem : BaseItem<int>
    {
        public string LicensePlate { get; set; }
        public string? Brand { get; set; }
        public string? Model { get; set; }
        public string AgencyName { get; set; }
        
        public decimal MaxPayload { get; set; }
        public int CargoLength { get; set; }
        public int CargoWidth { get; set; }
        public int CargoHeight { get; set; }
        
        public OperatingStatus OperatingStatus { get; set; }
        public string OperatingStatusStr => OperatingStatus.GetDescription();

        public TruckStatus Status { get; set; }
        public string StatusStr => Status.GetDescription();

        public int CurrentDriverId { get; set; }
        public string PicUserName { get; set; }
        public string PicFullName { get; set; }
        
        public int ManufacturingYear { get; set; }
        public string? RegistrationInfo { get; set; }
        public decimal FuelQuotaPer100Km { get; set; }
        
        /// <summary>
        /// Giá trị ODO gần nhất khi đổ dầu
        /// </summary>
        public int? LastRefillOdo { get; set; }

        /// <summary>
        /// Danh sách media (ảnh đăng ký, đăng kiểm)
        /// </summary>
        public List<TruckMediaItem>? MediaItems { get; set; }
    }

    /// <summary>
    /// Item hiển thị media xe tải
    /// </summary>
    public class TruckMediaItem
    {
        public int Id { get; set; }
        public Guid MediaId { get; set; }
        public string MediaUrl { get; set; }
        public TruckMediaType MediaType { get; set; }
        public string MediaTypeStr => MediaType.GetDescription();
        public int DisplayOrder { get; set; }
    }
}
