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

namespace CMSMicroservice.Application.UserCQ.EventHandlers;

public class CreateNewUserEventHandler : INotificationHandler<CreateNewUserEvent>
{
    private readonly ILogger<CreateNewUserEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
