using CMSMicroservice.Domain.Events;
using Microsoft.Extensions.Logging;

namespace CMSMicroservice.Application.OtpTokenCQ.EventHandlers;

public class CreateNewOtpTokenEventHandler : INotificationHandler<CreateNewOtpTokenEvent>
{
    private readonly ILogger<CreateNewOtpTokenEventHandler> _logger;

    public CreateNewOtpTokenEventHandler(ILogger<CreateNewOtpTokenEventHandler> logger)
    {
        _logger = logger;
    }

    public Task Handle(CreateNewOtpTokenEvent notification, CancellationToken cancellationToken)
    {
        _logger.LogInformation("Domain Event: {DomainEvent}", notification.GetType().Name);

        return Task.CompletedTask;
    }
}
