using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static EgtBEAMWALL.Core.ConstBeam;

namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
    // <Auto-Generated>
    // This is here so CodeMaid doesn't reorganize this document
    // </Auto-Generated>
    /// <summary>
    /// Tabella deiu raggruppamenti PROJ in forma di PROD
    /// </summary>
    [Table("ProdList")]
    public class ProdModel
    {
        #region Public Properties

        /// <summary>
        /// Chiave univoca DB
        /// </summary>
        [Key, Column("ProdDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ProdDbId { get; set; }

        [Column("Description")]
        public string Description { get; set; } = "";

        /// <summary>
        /// Data Creazione
        /// </summary>
        [Index]
        [Column("DtCreated")]
        public DateTime DtCreated { get; set; }

        /// <summary>
        /// Stato NEW = creato ma NON salvato
        /// </summary>
        [Column("IsNew")]
        public bool IsNew { get; set; } = true;

        /// <summary>
        /// Stato locked, quando aperto da un dispositivo in rete
        /// </summary>
        [Column("Lock")]
        public bool Locked { get; set; } = false;

        /// <summary>
        ///  Chiave univoca per EgtBM
        /// </summary>
        [Column("Id")]
        [Index]
        public int ProdId { get; set; }

        /// <summary>
        /// Tipologia del progetto (Travi, Pareti, ...)
        /// </summary>
        public BWType PType { get; set; } = BWType.NULL;

        /// <summary>
        /// Macchina
        /// </summary>
        [Column("Machine")]
        public string Machine { get; set; } = "";

        /// <summary>
        /// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
        /// </summary>
        [Column("LockedBy")]
        public string LockedBy { get; set; } = "";

        /// <summary>
        /// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
        /// </summary>
        [Column("LockDate")]
        public DateTime LockDate { get; set; } = DateTime.MinValue;

        /// <summary>
        /// Record attivo (se false == cancellazione logica)
        /// </summary>
        [Index]
        [Column("IsActive")]
        public bool IsActive { get; set; } = true;

        /// <summary>
        /// Stato Prodotto = inviato ALMENO UNA VOLTA al supervisore --> NON eliminabile se non in modo logico
        /// </summary>
        [Index]
        [Column("IsProduced")]
        public bool IsProduced { get; set; } = false;

        /// <summary>
        /// Stato Archiviato = NON visualizzabile normalmente, già prodotto
        /// </summary>
        [Index]
        [Column("IsArchived")]
        public bool IsArchived { get; set; } = false;

        #endregion Public Properties
    }
}