using ERPCore.Domain.Entities;
using ERPCore.Domain.Enums;

namespace ERPCore.Services.Interfaces;

/// <summary>
/// Resolves a production formula quantity to the only unit stock speaks: a count of the
/// item's base UOM. Replaces the old per-item UOM conversion table — everything needed is
/// on the item row, so this does no I/O.
/// </summary>
public interface IItemMeasure
{
    /// <summary>
    /// Formula quantity → packs. <see cref="StageQtyUnit.Pack"/> passes straight through;
    /// <see cref="StageQtyUnit.Content"/> divides by the item's content size, so 2000 ml of
    /// a 500 ml bottle is 4 bottles and 300 ml is 0.6 of one.
    /// </summary>
    decimal ToPacks(Item item, decimal formulaQty, StageQtyUnit unit);

    /// <summary>Packs → formula quantity. The exact inverse of <see cref="ToPacks"/>, for display.</summary>
    decimal FromPacks(Item item, decimal packs, StageQtyUnit unit);

    /// <summary>Whether the item carries a usable content size.</summary>
    bool HasContent(Item item);
}
