using SolutionErp.Domain.Common;
using SolutionErp.Domain.Contracts;   // reuse ChangelogAction

namespace SolutionErp.Domain.Budgets;

// Audit log unified cho mọi thay đổi trên ngân sách.
public class BudgetChangelog : BaseEntity
{
    public Guid BudgetId { get; set; }
    public Budget? Budget { get; set; }

    public BudgetEntityType EntityType { get; set; }
    public Guid? EntityId { get; set; }
    public ChangelogAction Action { get; set; }
    public BudgetPhase? PhaseAtChange { get; set; }
    public Guid? UserId { get; set; }
    public string? UserName { get; set; }
    public string? Summary { get; set; }
    public string? FieldChangesJson { get; set; }
    public string? ContextNote { get; set; }
}

public enum BudgetEntityType
{
    Header = 1,
    Detail = 2,
    Workflow = 3,
}
