using ColaFlow.Modules.Identity.Domain.Aggregates.Users;
using ColaFlow.Modules.Identity.Domain.Entities;

namespace ColaFlow.Modules.Identity.Domain.Repositories;

/// <summary>
/// Repository interface for EmailVerificationToken entity
/// </summary>
public interface IEmailVerificationTokenRepository
{
    /// <summary>
    /// Get verification token by token hash
    /// </summary>
    Task<EmailVerificationToken?> GetByTokenHashAsync(
        string tokenHash,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// Get active verification token by user ID
    /// </summary>
    Task<EmailVerificationToken?> GetActiveByUserIdAsync(
        UserId userId,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// Add a new verification token
    /// </summary>
    Task AddAsync(
        EmailVerificationToken token,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// Update an existing verification token
    /// </summary>
    Task UpdateAsync(
        EmailVerificationToken token,
        CancellationToken cancellationToken = default);
}
