using ERPCore.Domain.Enums;

namespace ERPCore.Domain.Entities;

/// <summary>
/// Inter-warehouse stock transfer header (FR-STK-05/06). Dispatch consumes source
/// FIFO layers into in-transit; receive creates the destination layer at the
/// inherited cost (cost-preserving). Mutable aggregate with an
/// <see cref="RowVersion"/> token (docs/10 C.10). Model: docs/10 Part C.6.
/// </summary>
public class StockTransfer
{
    public int TransferId { get; set; }
    public string DocNo { get; set; } = string.Empty;

    public int SrcWarehouseId { get; set; }
    public Warehouse? SrcWarehouse { get; set; }

    public int DestWarehouseId { get; set; }
    public Warehouse? DestWarehouse { get; set; }

    public TransferStatus Status { get; set; } = TransferStatus.Draft;

    public int CreatedBy { get; set; }
    public User? Creator { get; set; }

    public DateTime CreatedAt { get; set; }
    public uint RowVersion { get; set; }

    public ICollection<StockTransferLine> Lines { get; set; } = new List<StockTransferLine>();
}
