using System;
using System.Collections.Generic;

namespace CNCSystem.Models.System
{
    public class Alarm
    {
        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 DeviceName { get; set; }
        public bool IsResolved { get; set; }
        public DateTime OccurrenceTime { get; set; }
        public DateTime? ResolutionTime { get; set; }
        public string ResolutionNote { get; set; }
        public DateTime CreatedAt { get; set; }
    }

    public class AlarmRule
    {
        public int Id { get; set; }
        public string RuleName { get; set; }
        public string Condition { get; set; }
        public string AlarmType { get; set; }
        public string AlarmLevel { get; set; }
        public bool IsEnabled { get; set; }
        public int? DeviceId { get; set; }
        public DateTime CreatedAt { get; set; }
        public DateTime UpdatedAt { get; set; }
    }

    public class StatisticRule
    {
        public int Id { get; set; }
        public string RuleName { get; set; }
        public string Description { get; set; }
        public string MetricFormula { get; set; }
        public List<string> GroupByDimensions { get; set; }
        public bool IsEnabled { get; set; }
        public DateTime CreatedAt { get; set; }
        public DateTime UpdatedAt { get; set; }
    }

    public class SystemConfig
    {
        public int Id { get; set; }
        public string ConfigKey { get; set; }
        public string ConfigValue { get; set; }
        public string Description { get; set; }
        public DateTime CreatedAt { get; set; }
        public DateTime UpdatedAt { get; set; }
    }

    public class SystemHealth
    {
        public DateTime CheckTime { get; set; }
        public bool DatabaseConnected { get; set; }
        public int OnlineDeviceCount { get; set; }
        public int TotalDeviceCount { get; set; }
        public int ActiveAlarmCount { get; set; }
        public double CollectionSuccessRate { get; set; }
        public double AverageResponseTime { get; set; }
        public long DatabaseSize { get; set; }
        public double CpuUsage { get; set; }
        public double MemoryUsage { get; set; }
        public double DiskUsage { get; set; }
    }

    public class SystemInfo
    {
        public string Version { get; set; }
        public string Environment { get; set; }
        public DateTime StartTime { get; set; }
        public double Uptime { get; set; }
        public int ProcessId { get; set; }
        public string MachineName { get; set; }
        public string OperatingSystem { get; set; }
        public string FrameworkVersion { get; set; }
    }
}