namespace Meezi.Core.Interfaces;

public record KavenegarAccountInfo(long RemainCredit, string AccountType);

public record BulkSendResult(int SentCount, int FailedCount);

public interface ISmsService
{
    /// <summary>Send a one-time password via Kavenegar Verify/Lookup template.</summary>
    Task SendOtpAsync(string phone, string otp, CancellationToken cancellationToken = default);

    /// <summary>Send a plain-text message to a single recipient.</summary>
    Task SendMessageAsync(string phone, string message, CancellationToken cancellationToken = default);

    /// <summary>
    /// Send the same message to many recipients in batches of up to 200.
    /// Never throws — failures per batch are counted and returned.
    /// </summary>
    Task<BulkSendResult> SendBulkAsync(IReadOnlyList<string> phones, string message, CancellationToken cancellationToken = default);

    /// <summary>Returns credit balance from the Kavenegar account, or null if not configured.</summary>
    Task<KavenegarAccountInfo?> GetAccountInfoAsync(CancellationToken cancellationToken = default);
}
