namespace TrackQrApi.Features.Email.Services;

public interface IEmailService
{
    Task SendPasswordResetEmailAsync(string toEmail, string resetToken, CancellationToken ct = default);
    Task SendEmailVerificationAsync(string toEmail, string verificationToken, CancellationToken ct = default);
    Task SendWelcomeEmailAsync(string toEmail, string userName, CancellationToken ct = default);
}

public class EmailSettings
{
    public string Provider { get; set; } = "smtp"; // smtp, sendgrid, ses
    public string FromEmail { get; set; } = "noreply@trakqr.com";
    public string FromName { get; set; } = "TrakQR";
    public string BaseUrl { get; set; } = "https://trakqr.com";

    // SMTP settings
    public SmtpSettings? Smtp { get; set; }

    // SendGrid settings
    public SendGridSettings? SendGrid { get; set; }
}

public class SmtpSettings
{
    public string Host { get; set; } = "localhost";
    public int Port { get; set; } = 587;
    public bool UseSsl { get; set; } = true;
    public string? Username { get; set; }
    public string? Password { get; set; }
}

public class SendGridSettings
{
    public string ApiKey { get; set; } = string.Empty;
}