//
// This is here so CodeMaid doesn't reorganize this document
//
namespace EgwCoreLib.Lux.Data.DbModel.Production
{
///
/// Batch di produzione (CdP = Commessa di Produzione)
/// - raggruppamento di PARTS
/// - le parts possono arrivare da 1/+ POR
/// - il set procede insieme ove necessario
/// - in relazione 1...N con gli ODL = ItemStep (perché ogni ODL è una singola fase e ho sempre 1/+ fasi su cui esploderlo)
///
[Table("production_batch")]
public class ProductionBatchModel
{
///
/// ID del Batch di produzione
///
[Key]
public int ProdBatchID { get; set; }
///
/// Environment di riferimento
///
public EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS Envir { get; set; } = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
///
/// Codice calcolato (13 char)
/// - tipo (BC.)
/// - anno (yyyy)
/// - id annuale (000000x8)
/// es: "BC.20250012AF
///
public string BatchTag { get; set; } = "";
///
/// Descrizione
///
public string Description { get; set; } = "";
///
/// DataOra consegna dell'intera commessa
///
public DateTime DueDate { get; set; } = DateTime.Today.AddMonths(6);
///
/// DataOra inizio effettivo
///
public DateTime? DateStart { get; set; } = null;
///
/// DataOra fine
///
public DateTime? DateEnd { get; set; } = null;
#if false
///
/// DataOra pianificata per inizio (prima fase)
///
public DateTime? PlannedStart { get; set; } = null;
///
/// Tempo stimato complessivo per realizzazione
///
public decimal EstimLeadTime { get; set; } = 0;
///
/// Tempo stimato sola lavorazione
///
public decimal EstimWorkTime { get; set; } = 0;
///
/// Indica che il batch è stato pianificato
///
[NotMapped]
public bool IsPlanned
{
get => PlannedStart != null;
}
///
/// Indica che sia passata la data attesa di completamento
///
[NotMapped]
public bool IsExpired
{
get => DueDate <= DateTime.Today;
}
#endif
}
}