namespace Apollinare.Domain.Entities.Warehouse;
///
/// Articolo del modulo magazzino con gestione completa di partite e seriali
///
public class WarehouseArticle : BaseEntity
{
///
/// Codice univoco articolo (SKU)
///
public string Code { get; set; } = string.Empty;
///
/// Descrizione articolo
///
public string Description { get; set; } = string.Empty;
///
/// Descrizione breve per etichette
///
public string? ShortDescription { get; set; }
///
/// Codice a barre principale (EAN/UPC)
///
public string? Barcode { get; set; }
///
/// Codice fornitore/produttore
///
public string? ManufacturerCode { get; set; }
///
/// Categoria articolo
///
public int? CategoryId { get; set; }
///
/// Unità di misura principale (es. PZ, KG, LT, MT)
///
public string UnitOfMeasure { get; set; } = "PZ";
///
/// Unità di misura secondaria per conversione
///
public string? SecondaryUnitOfMeasure { get; set; }
///
/// Fattore di conversione tra UoM primaria e secondaria
///
public decimal? UnitConversionFactor { get; set; }
///
/// Tipo di gestione magazzino
///
public StockManagementType StockManagement { get; set; } = StockManagementType.Standard;
///
/// Se true, l'articolo è gestito a partite (lotti)
///
public bool IsBatchManaged { get; set; }
///
/// Se true, l'articolo è gestito a seriali
///
public bool IsSerialManaged { get; set; }
///
/// Se true, l'articolo ha scadenza
///
public bool HasExpiry { get; set; }
///
/// Giorni di preavviso scadenza
///
public int? ExpiryWarningDays { get; set; }
///
/// Scorta minima (sotto questo livello scatta alert)
///
public decimal? MinimumStock { get; set; }
///
/// Scorta massima
///
public decimal? MaximumStock { get; set; }
///
/// Punto di riordino
///
public decimal? ReorderPoint { get; set; }
///
/// Quantità di riordino standard
///
public decimal? ReorderQuantity { get; set; }
///
/// Lead time in giorni per approvvigionamento
///
public int? LeadTimeDays { get; set; }
///
/// Metodo di valorizzazione per questo articolo (override del default)
///
public ValuationMethod? ValuationMethod { get; set; }
///
/// Costo standard (per valorizzazione a costo standard)
///
public decimal? StandardCost { get; set; }
///
/// Ultimo costo di acquisto
///
public decimal? LastPurchaseCost { get; set; }
///
/// Costo medio ponderato corrente
///
public decimal? WeightedAverageCost { get; set; }
///
/// Prezzo di vendita base
///
public decimal? BaseSellingPrice { get; set; }
///
/// Peso in Kg
///
public decimal? Weight { get; set; }
///
/// Volume in metri cubi
///
public decimal? Volume { get; set; }
///
/// Larghezza in cm
///
public decimal? Width { get; set; }
///
/// Altezza in cm
///
public decimal? Height { get; set; }
///
/// Profondità in cm
///
public decimal? Depth { get; set; }
///
/// Immagine principale
///
public byte[]? Image { get; set; }
///
/// Mime type immagine
///
public string? ImageMimeType { get; set; }
///
/// Se attivo, l'articolo può essere movimentato
///
public bool IsActive { get; set; } = true;
///
/// Note aggiuntive
///
public string? Notes { get; set; }
// Navigation properties
public WarehouseArticleCategory? Category { get; set; }
public ICollection StockLevels { get; set; } = new List();
public ICollection MovementLines { get; set; } = new List();
public ICollection Batches { get; set; } = new List();
public ICollection Serials { get; set; } = new List();
public ICollection Barcodes { get; set; } = new List();
}
///
/// Tipo di gestione magazzino per l'articolo
///
public enum StockManagementType
{
///
/// Gestione standard (quantità)
///
Standard = 0,
///
/// Non gestito a magazzino (servizi, ecc.)
///
NotManaged = 1,
///
/// Gestione a peso variabile
///
VariableWeight = 2,
///
/// Kit/Distinta base
///
Kit = 3
}
///
/// Metodo di valorizzazione magazzino
///
public enum ValuationMethod
{
///
/// Costo medio ponderato
///
WeightedAverage = 0,
///
/// First In First Out
///
FIFO = 1,
///
/// Last In First Out
///
LIFO = 2,
///
/// Costo standard
///
StandardCost = 3,
///
/// Costo specifico (per partita/seriale)
///
SpecificCost = 4
}