namespace MiGu.Server.Fleet;

/// <summary>
/// CDM 搬运任务的平台侧快照（表 cdm_tasks）。
/// 以任务 Id 为主键；SimpleLite/StandardScene 把终态任务从自身 JSON 里删除，这里则永久保留=完整历史，
/// 且 SimpleLite 关闭后平台仍可从本表读取最近快照。
/// </summary>
public sealed class CdmTaskRecord
{
    public string Id { get; set; } = "";
    public string? TaskId { get; set; }
    public int MissionId { get; set; }
    public string MissionName { get; set; } = "";
    public string MissionTypeName { get; set; } = "";
    public int SrcSiteId { get; set; }
    public string SrcLabel { get; set; } = "";
    public int DstSiteId { get; set; }
    public string DstLabel { get; set; } = "";
    public string Status { get; set; } = "";
    public string StatusCode { get; set; } = "";
    public int? CarId { get; set; }
    public string? CarName { get; set; }
    public int Priority { get; set; }
    /// <summary>下发/开始/结束时间：直接存投影返回的 ISO 字符串（可空）。</summary>
    public string? CreateTime { get; set; }
    public string? StartTime { get; set; }
    public string? FinishTime { get; set; }
    public string? StuckReason { get; set; }
    public bool Overdue { get; set; }
    /// <summary>平台首次/最近一次同步到该任务的时间。</summary>
    public DateTimeOffset FirstSeenAt { get; set; }
    public DateTimeOffset LastSeenAt { get; set; }
}
