Files
lux/EgwCoreLib.Lux.Data/DbModel/Production/ProductionItemModel.cs
T
2026-01-19 10:38:43 +01:00

101 lines
3.1 KiB
C#

using EgwCoreLib.Lux.Data.DbModel.Sales;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace EgwCoreLib.Lux.Data.DbModel.Production
{
/// <summary>
/// Item da produrre
/// </summary>
[Table("production_item")]
public class ProductionItemModel
{
/// <summary>
/// ID dell'articolo
/// </summary>
[Key]
public int ProdItemID { get; set; }
/// <summary>
/// Riga Ordine da cui scaturisce
/// </summary>
public int OrderRowID { get; set; } = 0;
/// <summary>
/// CodArticolo (opzionale) numerico
/// </summary>
public int ItemCode { get; set; } = 0;
/// <summary>
/// CodArticolo (opzionale) string
/// </summary>
public string ExtItemCode { get; set; } = "";
/// <summary>
/// Riferimento al record di ProductionGrou impiegato per effettuare le assegnazioni di produzione
/// </summary>
public int? ProdGroupID { get; set; }
/// <summary>
/// Batch di produzione (ODL) cui è correlato (può essere nullo inizialmente e poi variato)
/// </summary>
public int? ProdBatchID { get; set; }
#if false
/// <summary>
/// Etichetta dell'item, nel formato vecchio da eliminare
/// PI.000000x8
/// </summary>
[Obsolete("Sostituita da ProdItemTag")]
public string ProdLabel { get; set; } = "";
#endif
/// <summary>
/// Etichetta dell'item, nel formato con contatore annuale
/// PI.2025.000000x8
/// </summary>
public string? ProdItemTag { get; set; } = null;
/// <summary>
/// Tempo stimato di esecuzione pezzo
/// </summary>
public double EstimTime { get; set; } = 0;
/// <summary>
/// Codice calcolato da chiave ProdItemID, cambiare con generazione da count4er tipo
/// PI.2025.000000x8
/// </summary>
[NotMapped]
public string ProdItemUID
{
get => $"PT.{ProdItemID:X16}";
}
/// <summary>
/// Navigazione OrderRow
/// </summary>
[ForeignKey("OrderRowID")]
public virtual OrderRowModel OrderRowNav { get; set; } = null!;
/// <summary>
/// Navigazione ProdGroup (definizione carico macchine)
/// </summary>
[ForeignKey("ProdGroupID")]
public virtual ProductionGroupModel? ProductionGroupNav { get; set; }
/// <summary>
/// Navigazione Batch Produzione (gruppo avanzamento logistico)
/// </summary>
[ForeignKey("ProdBatchID")]
public virtual ProductionBatchModel? ProductionBatchNav { get; set; }
/// <summary>
/// Navigazione verso tabella Item2Odl
/// </summary>
public ICollection<ProductionItem2ODLModel> Item2OdlNav { get; set; } = new List<ProductionItem2ODLModel>();
}
}