using System.ComponentModel;

namespace FasdDesktopUi.Basics.Models
{
    public class TicketOverviewModel : INotifyPropertyChanged
    {
        #region Selections-Properties

        private bool _ticketsNewSelected;
        public bool TicketsNewSelected
        {
            get => _ticketsNewSelected;
            set { if (_ticketsNewSelected != value) { _ticketsNewSelected = value; OnPropertyChanged(nameof(TicketsNewSelected)); } }
        }

        private bool _ticketsActiveSelected;
        public bool TicketsActiveSelected
        {
            get => _ticketsActiveSelected;
            set { if (_ticketsActiveSelected != value) { _ticketsActiveSelected = value; OnPropertyChanged(nameof(TicketsActiveSelected)); } }
        }

        private bool _ticketsCriticalSelected;
        public bool TicketsCriticalSelected
        {
            get => _ticketsCriticalSelected;
            set { if (_ticketsCriticalSelected != value) { _ticketsCriticalSelected = value; OnPropertyChanged(nameof(TicketsCriticalSelected)); } }
        }

        private bool _ticketsNewInfoSelected;
        public bool TicketsNewInfoSelected
        {
            get => _ticketsNewInfoSelected;
            set { if (_ticketsNewInfoSelected != value) { _ticketsNewInfoSelected = value; OnPropertyChanged(nameof(TicketsNewInfoSelected)); } }
        }

        private bool _incidentNewSelected;
        public bool IncidentNewSelected
        {
            get => _incidentNewSelected;
            set { if (_incidentNewSelected != value) { _incidentNewSelected = value; OnPropertyChanged(nameof(IncidentNewSelected)); } }
        }

        private bool _incidentActiveSelected;
        public bool IncidentActiveSelected
        {
            get => _incidentActiveSelected;
            set { if (_incidentActiveSelected != value) { _incidentActiveSelected = value; OnPropertyChanged(nameof(IncidentActiveSelected)); } }
        }

        private bool _incidentCriticalSelected;
        public bool IncidentCriticalSelected
        {
            get => _incidentCriticalSelected;
            set { if (_incidentCriticalSelected != value) { _incidentCriticalSelected = value; OnPropertyChanged(nameof(IncidentCriticalSelected)); } }
        }

        private bool _incidentNewInfoSelected;
        public bool IncidentNewInfoSelected
        {
            get => _incidentNewInfoSelected;
            set { if (_incidentNewInfoSelected != value) { _incidentNewInfoSelected = value; OnPropertyChanged(nameof(IncidentNewInfoSelected)); } }
        }

        private bool _unassignedTicketsSelected;
        public bool UnassignedTicketsSelected
        {
            get => _unassignedTicketsSelected;
            set { if (_unassignedTicketsSelected != value) { _unassignedTicketsSelected = value; OnPropertyChanged(nameof(UnassignedTicketsSelected)); } }
        }

        private bool _unassignedTicketsCriticalSelected;
        public bool UnassignedTicketsCriticalSelected
        {
            get => _unassignedTicketsCriticalSelected;
            set { if (_unassignedTicketsCriticalSelected != value) { _unassignedTicketsCriticalSelected = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalSelected)); } }
        }
        #endregion

        #region Highlight-Properties
        private bool _ticketsNewHighlighted;
        public bool TicketsNewHighlighted { get => _ticketsNewHighlighted; set { if (_ticketsNewHighlighted != value) { _ticketsNewHighlighted = value; OnPropertyChanged(nameof(TicketsNewHighlighted)); } } }

        private bool _ticketsActiveHighlighted;
        public bool TicketsActiveHighlighted { get => _ticketsActiveHighlighted; set { if (_ticketsActiveHighlighted != value) { _ticketsActiveHighlighted = value; OnPropertyChanged(nameof(TicketsActiveHighlighted)); } } }

        private bool _ticketsCriticalHighlighted;
        public bool TicketsCriticalHighlighted { get => _ticketsCriticalHighlighted; set { if (_ticketsCriticalHighlighted != value) { _ticketsCriticalHighlighted = value; OnPropertyChanged(nameof(TicketsCriticalHighlighted)); } } }

        private bool _ticketsNewInfoHighlighted;
        public bool TicketsNewInfoHighlighted { get => _ticketsNewInfoHighlighted; set { if (_ticketsNewInfoHighlighted != value) { _ticketsNewInfoHighlighted = value; OnPropertyChanged(nameof(TicketsNewInfoHighlighted)); } } }

        private bool _incidentNewHighlighted;
        public bool IncidentNewHighlighted { get => _incidentNewHighlighted; set { if (_incidentNewHighlighted != value) { _incidentNewHighlighted = value; OnPropertyChanged(nameof(IncidentNewHighlighted)); } } }

        private bool _incidentActiveHighlighted;
        public bool IncidentActiveHighlighted { get => _incidentActiveHighlighted; set { if (_incidentActiveHighlighted != value) { _incidentActiveHighlighted = value; OnPropertyChanged(nameof(IncidentActiveHighlighted)); } } }

        private bool _incidentCriticalHighlighted;
        public bool IncidentCriticalHighlighted { get => _incidentCriticalHighlighted; set { if (_incidentCriticalHighlighted != value) { _incidentCriticalHighlighted = value; OnPropertyChanged(nameof(IncidentCriticalHighlighted)); } } }

        private bool _incidentNewInfoHighlighted;
        public bool IncidentNewInfoHighlighted { get => _incidentNewInfoHighlighted; set { if (_incidentNewInfoHighlighted != value) { _incidentNewInfoHighlighted = value; OnPropertyChanged(nameof(IncidentNewInfoHighlighted)); } } }

        private bool _unassignedTicketsHighlighted;
        public bool UnassignedTicketsHighlighted { get => _unassignedTicketsHighlighted; set { if (_unassignedTicketsHighlighted != value) { _unassignedTicketsHighlighted = value; OnPropertyChanged(nameof(UnassignedTicketsHighlighted)); } } }

        private bool _unassignedTicketsCriticalHighlighted;
        public bool UnassignedTicketsCriticalHighlighted { get => _unassignedTicketsCriticalHighlighted; set { if (_unassignedTicketsCriticalHighlighted != value) { _unassignedTicketsCriticalHighlighted = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalHighlighted)); } } }
        #endregion

        #region Change Hint Properties
        private string _ticketsNewChangeHint;
        public string TicketsNewChangeHint { get => _ticketsNewChangeHint; set { if (_ticketsNewChangeHint != value) { _ticketsNewChangeHint = value; OnPropertyChanged(nameof(TicketsNewChangeHint)); } } }

        private string _ticketsActiveChangeHint;
        public string TicketsActiveChangeHint { get => _ticketsActiveChangeHint; set { if (_ticketsActiveChangeHint != value) { _ticketsActiveChangeHint = value; OnPropertyChanged(nameof(TicketsActiveChangeHint)); } } }

        private string _ticketsCriticalChangeHint;
        public string TicketsCriticalChangeHint { get => _ticketsCriticalChangeHint; set { if (_ticketsCriticalChangeHint != value) { _ticketsCriticalChangeHint = value; OnPropertyChanged(nameof(TicketsCriticalChangeHint)); } } }

        private string _ticketsNewInfoChangeHint;
        public string TicketsNewInfoChangeHint { get => _ticketsNewInfoChangeHint; set { if (_ticketsNewInfoChangeHint != value) { _ticketsNewInfoChangeHint = value; OnPropertyChanged(nameof(TicketsNewInfoChangeHint)); } } }

        private string _incidentNewChangeHint;
        public string IncidentNewChangeHint { get => _incidentNewChangeHint; set { if (_incidentNewChangeHint != value) { _incidentNewChangeHint = value; OnPropertyChanged(nameof(IncidentNewChangeHint)); } } }

        private string _incidentActiveChangeHint;
        public string IncidentActiveChangeHint { get => _incidentActiveChangeHint; set { if (_incidentActiveChangeHint != value) { _incidentActiveChangeHint = value; OnPropertyChanged(nameof(IncidentActiveChangeHint)); } } }

        private string _incidentCriticalChangeHint;
        public string IncidentCriticalChangeHint { get => _incidentCriticalChangeHint; set { if (_incidentCriticalChangeHint != value) { _incidentCriticalChangeHint = value; OnPropertyChanged(nameof(IncidentCriticalChangeHint)); } } }

        private string _incidentNewInfoChangeHint;
        public string IncidentNewInfoChangeHint { get => _incidentNewInfoChangeHint; set { if (_incidentNewInfoChangeHint != value) { _incidentNewInfoChangeHint = value; OnPropertyChanged(nameof(IncidentNewInfoChangeHint)); } } }

        private string _unassignedTicketsChangeHint;
        public string UnassignedTicketsChangeHint { get => _unassignedTicketsChangeHint; set { if (_unassignedTicketsChangeHint != value) { _unassignedTicketsChangeHint = value; OnPropertyChanged(nameof(UnassignedTicketsChangeHint)); } } }

        private string _unassignedTicketsCriticalChangeHint;
        public string UnassignedTicketsCriticalChangeHint { get => _unassignedTicketsCriticalChangeHint; set { if (_unassignedTicketsCriticalChangeHint != value) { _unassignedTicketsCriticalChangeHint = value; OnPropertyChanged(nameof(UnassignedTicketsCriticalChangeHint)); } } }
        #endregion

        #region Ticket & Incident-Properties

        // Ticket Properties
        private int _ticketsNew;
        public int TicketsNew { get => _ticketsNew; set { _ticketsNew = value; OnPropertyChanged(nameof(TicketsNew)); } }

        private int _ticketsActive;
        public int TicketsActive { get => _ticketsActive; set { _ticketsActive = value; OnPropertyChanged(nameof(TicketsActive)); } }

        private int _ticketsCritical;
        public int TicketsCritical { get => _ticketsCritical; set { _ticketsCritical = value; OnPropertyChanged(nameof(TicketsCritical)); } }

        private int _ticketsNewInfo;
        public int TicketsNewInfo { get => _ticketsNewInfo; set { _ticketsNewInfo = value; OnPropertyChanged(nameof(TicketsNewInfo)); } }

        // Incident Properties
        private int _incidentNew;
        public int IncidentNew { get => _incidentNew; set { _incidentNew = value; OnPropertyChanged(nameof(IncidentNew)); } }

        private int _incidentActive;
        public int IncidentActive { get => _incidentActive; set { _incidentActive = value; OnPropertyChanged(nameof(IncidentActive)); } }

        private int _incidentCritical;
        public int IncidentCritical { get => _incidentCritical; set { _incidentCritical = value; OnPropertyChanged(nameof(IncidentCritical)); } }

        private int _incidentNewInfo;
        public int IncidentNewInfo { get => _incidentNewInfo; set { _incidentNewInfo = value; OnPropertyChanged(nameof(IncidentNewInfo)); } }

        // Unassigned Ticket Properties
        private int _unassignedTickets;
        public int UnassignedTickets { get => _unassignedTickets; set { _unassignedTickets = value; OnPropertyChanged(nameof(UnassignedTickets)); } }

        private int _unassignedTicketsCritical;
        public int UnassignedTicketsCritical { get => _unassignedTicketsCritical; set { _unassignedTicketsCritical = value; OnPropertyChanged(nameof(UnassignedTicketsCritical)); } }


        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnPropertyChanged(string propertyName) =>
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        #endregion

        #region Helper-Methods    

        public void ResetSelection()
        {
            TicketsNewSelected = false;
            TicketsActiveSelected = false;
            TicketsCriticalSelected = false;
            TicketsNewInfoSelected = false;

            IncidentNewSelected = false;
            IncidentActiveSelected = false;
            IncidentCriticalSelected = false;
            IncidentNewInfoSelected = false;

            UnassignedTicketsSelected = false;
            UnassignedTicketsCriticalSelected = false;
        }

        public void ResetHighlights()
        {
            TicketsNewHighlighted = false;
            TicketsActiveHighlighted = false;
            TicketsCriticalHighlighted = false;
            TicketsNewInfoHighlighted = false;

            IncidentNewHighlighted = false;
            IncidentActiveHighlighted = false;
            IncidentCriticalHighlighted = false;
            IncidentNewInfoHighlighted = false;

            UnassignedTicketsHighlighted = false;
            UnassignedTicketsCriticalHighlighted = false;

            TicketsNewChangeHint = null;
            TicketsActiveChangeHint = null;
            TicketsCriticalChangeHint = null;
            TicketsNewInfoChangeHint = null;

            IncidentNewChangeHint = null;
            IncidentActiveChangeHint = null;
            IncidentCriticalChangeHint = null;
            IncidentNewInfoChangeHint = null;

            UnassignedTicketsChangeHint = null;
            UnassignedTicketsCriticalChangeHint = null;
        }
        #endregion

        public TicketOverviewModel()
        {

        }
    }

}
