namespace MiGu.DB.Domains.Fleet;

/// <summary>
/// 车辆报警的平台侧记录（表 vehicle_alarms）。
/// 出现报警→开一条 active 记录；文案/级别变化→先 clear 再建新 active；消失→cleared。
/// </summary>
public sealed class VehicleAlarmRecord
{
    public string Id { get; set; } = Guid.NewGuid().ToString("D");
    public int CarId { get; set; }
    public string CarName { get; set; } = "";
    /// <summary>报警文案（车体_AlarmInfo）。</summary>
    public string Info { get; set; } = "";
    /// <summary>报警级别（车体_AlarmLevel，未知为 0）。</summary>
    public int Level { get; set; }
    /// <summary>active | cleared</summary>
    public string Status { get; set; } = "active";
    public DateTimeOffset FirstAt { get; set; }
    public DateTimeOffset LastAt { get; set; }
    public DateTimeOffset? ResolvedAt { get; set; }
    /// <summary>持续时长（秒），恢复后写入。</summary>
    public long? DurationSecs { get; set; }
    /// <summary>预留：平台侧确认（不代表车端消警）。</summary>
    public bool Acknowledged { get; set; }
    public DateTimeOffset? AcknowledgedAt { get; set; }
    public string? AcknowledgedBy { get; set; }
}
