using ERPCore.Domain.Enums;

namespace ERPCore.Domain.Entities;

/// <summary>
/// Vendor master (FR-MD-06). Mutable aggregate with a <see cref="RowVersion"/>
/// ETag token. Deactivated, not deleted, when referenced (FR-MD-08).
/// Model: docs/10-BACKEND-PHASE1.md Part C.1.
/// </summary>
public class Vendor
{
    public int VendorId { get; set; }
    public string Code { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public string? Terms { get; set; }
    public string? TaxReg { get; set; }
    public string Currency { get; set; } = "LKR";
    public EntityStatus Status { get; set; } = EntityStatus.Active;

    public DateTime CreatedAt { get; set; }
    public DateTime? UpdatedAt { get; set; }

    /// <summary>PostgreSQL xmin-backed optimistic concurrency token (ETag source).</summary>
    public uint RowVersion { get; set; }
}
