namespace ERPCore.Domain.Entities;

/// <summary>
/// Per-employee payroll summary row (FR-HR-PAY-05). EpfEmployerAmount/EtfEmployerAmount
/// are informational/liability only, never subtracted from NetSalary
/// (docs/12-BACKEND-HRM.md B.4). Model: docs/12-BACKEND-HRM.md Part C.6.
/// </summary>
public class PayrollLine
{
    public int PayrollLineId { get; set; }
    public int PayrollRunId { get; set; }
    public PayrollRun? PayrollRun { get; set; }
    public int EmployeeId { get; set; }
    public Employee? Employee { get; set; }

    public decimal BasicSalary { get; set; }
    public decimal TotalAllowances { get; set; }
    public decimal OvertimeAmount { get; set; }
    public decimal GrossSalary { get; set; }

    public decimal LateDeductionAmount { get; set; }
    public decimal NoPayAmount { get; set; }
    public decimal LoanDeductionAmount { get; set; }
    public decimal EpfEmployeeAmount { get; set; }
    public decimal EpfEmployerAmount { get; set; }
    public decimal EtfEmployerAmount { get; set; }
    public decimal TaxAmount { get; set; }
    public decimal OtherDeductionsAmount { get; set; }
    public decimal NetSalary { get; set; }

    public int WorkingDays { get; set; }
    public int PresentDays { get; set; }
    public int AbsentDays { get; set; }
    public int LeaveDays { get; set; }
    public int OtMinutesTotal { get; set; }
    public int LateMinutesTotal { get; set; }

    public uint RowVersion { get; set; }

    public List<PayrollLineComponent> Components { get; set; } = new();
}
