using ERPCore.Domain.Enums;

namespace ERPCore.Domain.Entities;

/// <summary>
/// Effective-dated salary structure header (FR-HR-PAY-02) — the audit trail a
/// salary revision needs (docs/12-BACKEND-HRM.md §13): exactly one row with
/// <see cref="EffectiveTo"/> null (the current one) per employee at a time.
/// Model: docs/12-BACKEND-HRM.md Part C.6.
/// </summary>
public class EmployeeSalaryStructure
{
    public int EmployeeSalaryStructureId { get; set; }
    public int EmployeeId { get; set; }
    public Employee? Employee { get; set; }

    public DateTime EffectiveFrom { get; set; }
    public DateTime? EffectiveTo { get; set; }
    public decimal BasicSalary { get; set; }
    public string Currency { get; set; } = "LKR";
    public SalaryStructureStatus Status { get; set; } = SalaryStructureStatus.Active;

    public int ApprovedBy { get; set; }
    public DateTime ApprovedAt { get; set; }
    public int CreatedBy { get; set; }
    public DateTime CreatedAt { get; set; }
    public uint RowVersion { get; set; }

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