namespace Apollinare.Domain.Entities.Warehouse;

/// <summary>
/// Codici a barre aggiuntivi per un articolo (multi-barcode support)
/// </summary>
public class ArticleBarcode : BaseEntity
{
    /// <summary>
    /// Articolo di riferimento
    /// </summary>
    public int ArticleId { get; set; }

    /// <summary>
    /// Codice a barre
    /// </summary>
    public string Barcode { get; set; } = string.Empty;

    /// <summary>
    /// Tipo codice a barre
    /// </summary>
    public BarcodeType Type { get; set; } = BarcodeType.EAN13;

    /// <summary>
    /// Descrizione (es. "Confezione da 6", "Pallet")
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// Quantità associata al barcode (es. 6 per confezione da 6)
    /// </summary>
    public decimal Quantity { get; set; } = 1;

    /// <summary>
    /// Se è il barcode principale
    /// </summary>
    public bool IsPrimary { get; set; }

    /// <summary>
    /// Se attivo
    /// </summary>
    public bool IsActive { get; set; } = true;

    // Navigation properties
    public WarehouseArticle? Article { get; set; }
}

/// <summary>
/// Tipo di codice a barre
/// </summary>
public enum BarcodeType
{
    /// <summary>
    /// EAN-13 (European Article Number)
    /// </summary>
    EAN13 = 0,

    /// <summary>
    /// EAN-8
    /// </summary>
    EAN8 = 1,

    /// <summary>
    /// UPC-A (Universal Product Code)
    /// </summary>
    UPCA = 2,

    /// <summary>
    /// UPC-E
    /// </summary>
    UPCE = 3,

    /// <summary>
    /// Code 128
    /// </summary>
    Code128 = 4,

    /// <summary>
    /// Code 39
    /// </summary>
    Code39 = 5,

    /// <summary>
    /// QR Code
    /// </summary>
    QRCode = 6,

    /// <summary>
    /// DataMatrix
    /// </summary>
    DataMatrix = 7,

    /// <summary>
    /// Codice interno
    /// </summary>
    Internal = 8
}
