using System;

namespace CncModels.Dto.Production
{
    /// <summary>
    /// cnc_daily_production 日汇总表列表项
    /// </summary>
    public class DailyProductionListItem
    {
        public int Id { get; set; }
        public int MachineId { get; set; }
        public string MachineName { get; set; }
        public DateTime ProductionDate { get; set; }
        public string ProgramName { get; set; }
        public decimal TotalQuantity { get; set; }
        public int SegmentCount { get; set; }
        public decimal? TotalRunTime { get; set; }
        public decimal? TotalCuttingTime { get; set; }
        public decimal? TotalCycleTime { get; set; }
        public int? WorkerId { get; set; }

        // 前端兼容字段（序列化时填充）
        public string date => ProductionDate.ToString("yyyy-MM-dd");
        public decimal quantity => TotalQuantity;
        public decimal? runTime => TotalRunTime;
        public decimal? cuttingTime => TotalCuttingTime;
        public string dataStatus => TotalQuantity > 0 ? "normal" : "data_missing";
        public bool isAdjusted => false;
    }
}
