using System;
using System.Collections.Generic;

namespace Haoliang.Models.System
{
    public class AlarmStatistics
    {
        public DateTime Date { get; set; }
        public string AlarmType { get; set; }
        public int TotalCount { get; set; }
        public int ResolvedCount { get; set; }
        public int UnresolvedCount { get; set; }
        public decimal ResolutionRate { get; set; }
        public TimeSpan AverageResolutionTime { get; set; }
    }

    public class AlarmNotification
    {
        public int Id { get; set; }
        public int AlarmId { get; set; }
        public string NotificationType { get; set; } // Email, SMS, WeChat
        public string Recipient { get; set; }
        public string Subject { get; set; }
        public string Content { get; set; }
        public bool IsSent { get; set; }
        public DateTime SendTime { get; set; }
        public string SendResult { get; set; }
        public DateTime CreatedAt { get; set; }
    }

    public class AlarmViewModel
    {
        public int Id { get; set; }
        public string AlarmType { get; set; }
        public string AlarmLevel { get; set; }
        public string AlarmContent { get; set; }
        public int? DeviceId { get; set; }
        public string DeviceCode { get; set; }
        public string DeviceName { get; set; }
        public string AlarmRuleName { get; set; }
        public bool IsResolved { get; set; }
        public DateTime OccurrenceTime { get; set; }
        public DateTime? ResolutionTime { get; set; }
        public string ResolutionNote { get; set; }
        public string ResolvedBy { get; set; }
        public List<AlarmNotification> Notifications { get; set; }
        public DateTime CreatedAt { get; set; }
    }

    public class AlarmFilter
    {
        public List<int> DeviceIds { get; set; }
        public List<string> AlarmTypes { get; set; }
        public List<string> AlarmLevels { get; set; }
        public bool? IsResolved { get; set; }
        public DateTime? StartDate { get; set; }
        public DateTime? EndDate { get; set; }
        public string SearchKeyword { get; set; }
    }
}