using ERPCore.Domain.Enums;

namespace ERPCore.Domain.Entities;

/// <summary>
/// GRN line (FR-GRN-04..08). <see cref="UnitCost"/> is the PO-derived cost for
/// PO-based receipts (client cost ignored — 02-SECURITY C.3) or the entered cost
/// for direct receipts. <see cref="ReceivedValue"/> = qty × unitCost.
/// <see cref="HoldStatus"/> gates issuability. Model: docs/10 Part C.3.
/// </summary>
public class GrnLine
{
    public int GrnLineId { get; set; }

    public int GrnId { get; set; }
    public Grn? Grn { get; set; }

    public int? PoLineId { get; set; }
    public PoLine? PoLine { get; set; }

    public int ItemId { get; set; }
    public Item? Item { get; set; }

    public int UomId { get; set; }
    public Uom? Uom { get; set; }

    public int? BinId { get; set; }
    public Bin? Bin { get; set; }

    public int? BatchId { get; set; }
    public Batch? Batch { get; set; }

    public decimal Qty { get; set; }
    public decimal UnitCost { get; set; }
    public decimal ReceivedValue { get; set; }
    public HoldStatus HoldStatus { get; set; } = HoldStatus.Available;
}
