using System;
using System.Collections.Generic;
using System.Threading;

namespace MDL.Models
{
    /// <summary>
    /// 自动集包任务状态
    /// </summary>
    public class AutoPackTaskStatus
    {
        public string TaskId { get; set; }
        public string TagNumber { get; set; }
        public string Status { get; set; } // pending/processing/completed/failed/cancelled
        public int TotalCount { get; set; }
        public int ProcessedCount { get; set; }
        public int SuccessCount { get; set; }
        public int FailedCount { get; set; }
        public string CurrentWaybill { get; set; }
        public string Message { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime? EndTime { get; set; }
        public List<AutoPackFailedItem> FailedItems { get; set; } = new();
        public CancellationTokenSource CancellationTokenSource { get; set; }
    }

    public class AutoPackFailedItem
    {
        public string WaybillNumber { get; set; }
        public int ErrorCode { get; set; }
        public string ErrorMessage { get; set; }
    }
}
