namespace Baya.Application.Common;

/// <summary>
/// Business-day arithmetic for customer-facing ETAs (the BNPL 7–10-day refund window). Fridays are skipped as
/// the Iranian bank weekend; Thursday half-days and public holidays are not modelled here (the ETA is an
/// estimate surfaced in the UI, not a settlement guarantee — the authoritative confirmation is the provider
/// reconciliation callback). A later refinement can route this through <c>IHolidayCalendar</c>.
/// </summary>
public static class BusinessDays
{
    public static DateOnly Add(DateOnly start, int businessDays)
    {
        var date = start;
        var added = 0;
        while (added < businessDays)
        {
            date = date.AddDays(1);
            if (date.DayOfWeek != DayOfWeek.Friday)
                added++;
        }
        return date;
    }
}
