// EN: Two-factor authentication service interface
// VI: Interface service xác thực hai yếu tố

namespace IamService.Infrastructure.TwoFactor;

/// <summary>
/// EN: Two-factor authentication service interface.
/// VI: Interface service xác thực hai yếu tố.
/// </summary>
public interface ITwoFactorService
{
    /// <summary>
    /// EN: Generate a new secret key for 2FA.
    /// VI: Tạo secret key mới cho 2FA.
    /// </summary>
    string GenerateSecretKey();
    
    /// <summary>
    /// EN: Generate QR code URI for authenticator apps.
    /// VI: Tạo URI QR code cho ứng dụng authenticator.
    /// </summary>
    string GenerateQrCodeUri(string email, string secretKey);
    
    /// <summary>
    /// EN: Generate QR code as base64 image.
    /// VI: Tạo QR code dưới dạng ảnh base64.
    /// </summary>
    string GenerateQrCodeBase64(string email, string secretKey);
    
    /// <summary>
    /// EN: Validate TOTP code against secret key.
    /// VI: Xác thực mã TOTP với secret key.
    /// </summary>
    bool ValidateCode(string secretKey, string code);
    
    /// <summary>
    /// EN: Generate recovery codes.
    /// VI: Tạo mã khôi phục.
    /// </summary>
    IEnumerable<string> GenerateRecoveryCodes(int count = 10);
}
