using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//
// This is here so CodeMaid doesn't reorganize this document
//
namespace LiMan.DB.DTO
{
///
/// DTO relativo alle info RAGGRUPPATE x applicativo
///
public class AppStatusDTO
{
///
/// CodApp Richiesta
///
public string CodApp { get; set; } = "";
///
/// Conteggio del numero totale installazioni
///
public int NumInst { get; set; } = 1;
///
/// Conteggio del numero totale degli impieghi attivi (es conteggio IOB)
///
public int NumImp { get; set; } = 1;
///
/// Versione Release corrente
///
public string VersNumCurrent { get; set; } = "0.0.0.0";
///
/// Dizionario Versioni Installate
///
public Dictionary DictVersNumInst { get; set; } = new Dictionary();
///
/// Dizionario Stato Update, dove la chiave è UpToDateStatus come
/// 4 = corrente, 4 blocchi uguali (0.0.0.0)
/// 3 = 3 uguali, cambia 4 blocco (0.0.0.x)
/// 2 = 2 uguali, cambia 3 blocco (0.0.x.x)
/// 1 = 1 uguali, cambia 2 blocco (0.x.x.x)
/// 0 = 0 uguali, cambia 1 blocco (x.x.x.x)
///
public Dictionary DictUpdate { get; set; } = new Dictionary();
///
/// Dettaglio delle versioni installate con tutte le info
///
public List DetailInstalled { get; set; } = new List();
///
/// Score dello stato di aggiornamento complessivo
///
public double UpdateScore
{
get => DictUpdate != null ? (double)(DictUpdate.Sum(x => x.Key * x.Value)) / (4 * DictUpdate.Sum(x => x.Value)) : 0;
}
///
/// Data Ora ultimo controllo
///
public DateTime DtCheck { get; set; } = DateTime.Now;
}
}