using ERPCore.Dtos.Hrm;

namespace ERPCore.Services.Interfaces;

/// <summary>Loan/Advance business logic (FR-HR-PAY-03, docs/13-BACKEND-HRM-API.md §6).</summary>
public interface IEmployeeLoanService
{
    Task<List<EmployeeLoanDto>> ListAsync(int employeeId, CancellationToken ct = default);
    Task<EmployeeLoanDto?> GetAsync(int employeeId, int loanId, CancellationToken ct = default);
    Task<EmployeeLoanDto> CreateAsync(int employeeId, CreateEmployeeLoanRequest request, int actorUserId, CancellationToken ct = default);

    /// <summary>Due, not-yet-deducted installments for an employee in a given period — consumed by PayrollCalculationService.</summary>
    Task<List<Domain.Entities.LoanInstallment>> GetDueInstallmentsAsync(int employeeId, int periodYear, int periodMonth, CancellationToken ct = default);
}
