using Edge.Core.Database.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace Edge.Core.UniversalApi
{
    /// <summary>
    /// litefcccore fire an event to notify outside clients.
    /// </summary>
    public class EventDescriptor
    {
        public string Name { get; set; }
        public object Data { get; set; }

        public IEnumerable<HubClient> ToClients { get; set; }
    }

    public class HubClient
    {
    }





    public enum GenericAlarmSeverity
    {
        Fatal,
        Error,
        Warning,
        Information
    }

    /// <summary>
    /// Used for send a simple and unified alarm data to UI.
    /// </summary>
    public class GenericAlarm
    {
        public const string UniversalApiEventName = "OnGenericAlarm";
        //public string Originator { get; set; }
        /// <summary>
        /// Gets or sets the alarm message title, LocalizedContent format is support.
        ///     please keep this shorter for better user exp in UI, and fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// Gets or sets the alarm message detail, LocalizedContent format is support.
        ///     please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
        /// </summary>
        public string Detail { get; set; }

        /// <summary>
        /// Abstract description for a serial of alarms that could help to group alarms, LocalizedContent format is support.
        ///     this is mostly used by UI app that providing a group box to group similar alarms.
        ///     please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
        /// </summary>
        public string Category { get; set; }

        /// <summary>
        /// Abstract description for a serial of alarms that could help to further group alarms besides Category, LocalizedContent format is support.
        ///     this is mostly used by UI app that providing a group box to group similar alarms.
        ///     please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
        /// </summary>
        public string SubCategory { get; set; }

        /// <summary>
        /// Used to store specific business data that the caller may use it when get the historical generic alarms. 
        /// </summary>
        
        /// <summary>
        /// could be anything that recognized by front end(mostly the Web html/javascript).
        /// </summary>
        public string Action { get; set; }
        public GenericAlarmSeverity Severity { get; set; }

        /// <summary>
        /// alarms with same identity will be treat as the same alarm, thus only the earliest fired single alarm will be persist, following alarms will be ignore for persist.
        /// leave this value null or empty will treat every fired alarm is a new one, thus each alarm will be persist.
        /// </summary>
        //public string Identity { get; set; }
        //public DateTime OpeningTimestamp { get; set; }

        //public string ClosedReason { get; set; }
        //public DateTime? ClosedTimestamp { get; set; }
    }
}