using Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static Core.Enum;
#nullable disable
namespace LiMan.DB.DBModels
{
//
// This is here so CodeMaid doesn't reorganize this document
//
//[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))]
[Table("SubLicenze")]
public partial class SubLicenzaModel
{
#region Public Properties
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdxSubLic { get; set; }
///
/// IDX licenza master
///
public int IdxLic { get; set; } = 0;
///
/// Codice univoco della sub licenza generata
///
public string CodImpiego { get; set; }
///
/// Data scadenza VETO x cambio destinazione
///
public DateTime VetoUnlock { get; set; } = DateTime.Today.AddMonths(2);
///
/// Tipologia di licenza gestita
///
public TipoLicenza Tipo { get; set; } = TipoLicenza.UserKey;
///
/// Chiave opzionale collegata all'utente
///
public string Chiave { get; set; }
[NotMapped]
public bool Locked
{
get => (VetoUnlock.Subtract(DateTime.Today).TotalDays > 0);
}
[ForeignKey("IdxLic")]
public virtual LicenzaModel LicenzaNav { get; set; }
#endregion Public Properties
}
}